SocialGouv / support

Support de l'activité des startups SocialGouv
http://socialgouv.github.io/support
7 stars 5 forks source link

OVH-DEV/PROD securityContext #457

Open octomir opened 1 year ago

octomir commented 1 year ago

Sur tous les pods déployé sur le cluster OVH, nous distingons 67 pods au total avec 31 pods sans securityContext (namespace -/- pods)

DEV

NS pods
1000jours-blues-preprod harbor.fabrique.social.gouv.fr/1000jours/1000jours-blues/app:preprod-728e5e89d7697972402e1e763504fa786c9d7939
1000jours-dashboard-preprod harbor.fabrique.social.gouv.fr/1000jours/app-dashboard/app:preprod-11755d9a6555cb6708187b79e4c0349193f6bf35
archifiltre-site-preprod harbor.fabrique.social.gouv.fr/archifiltre/archifiltre-site/app:preprod-265f527c54ac64a3ee91b8203bb0cdafcf388492
archifiltre-site-v2-preprod harbor.fabrique.social.gouv.fr/archifiltre/archifiltre-site-v2/app:preprod-7777217daa216d734002e79862ab93a20681e2bd
archifiltre-statistics-preprod harbor.fabrique.social.gouv.fr/archifiltre/archifiltre-statistics/app:preprod-43ec918ccfcb32f2f8ef77c807c1337e21674cbe
bpco-preprod harbor.fabrique.social.gouv.fr/bpco-mieux/bpco/api:preprod-8b5674eecde8744b669ae1d38b59ecdff4cf5978
bpco-site-preprod harbor.fabrique.social.gouv.fr/bpco-mieux/bpco-site/app:preprod-fc581e687c6e67ebc5efa6324c8c7b9ed195e84b
bpco-site-renovate-socialgouvdocker-images-4et7n2li harbor.fabrique.social.gouv.fr/bpco-mieux/bpco-site/app:sha-3ef0cfdc857b9d5bb66833e477d9479eecfcf943
bpco-site-renovate-typescript-5-x-1n3mn1xm harbor.fabrique.social.gouv.fr/bpco-mieux/bpco-site/app:sha-458592ea52393e65fcfe0be95b45daf267d9dfe8
carnets-feat-ovh-4bm2y4lw harbor.fabrique.social.gouv.fr/fabrique/carnets/app:sha-9b85b393116aec455c8f7c7c11cbfdbe0dfc72c8
carnets-feat-ovh-4bm2y4lw harbor.fabrique.social.gouv.fr/fabrique/carnets/hasura:sha-9b85b393116aec455c8f7c7c11cbfdbe0dfc72c8
cattle-system rancher/rancher-agent:v2.7.4
cattle-system rancher/rancher-agent:v2.7.4
cattle-system rancher/rancher-webhook:v0.3.5
consommables-preprod harbor.fabrique.social.gouv.fr/fabrique/consommables/app:preprod-26f7925a81d5d481819f413364ec2590c8255175
csi-s3 quay.io/k8scsi/csi-provisioner:v2.1.0 cr.yandex/crp9ftr22d26age3hulg/csi-s3:0.36.2
csi-s3 quay.io/k8scsi/csi-node-driver-registrar:v1.2.0 cr.yandex/crp9ftr22d26age3hulg/csi-s3:0.36.2
csi-s3 quay.io/k8scsi/csi-node-driver-registrar:v1.2.0 cr.yandex/crp9ftr22d26age3hulg/csi-s3:0.36.2
csi-s3 quay.io/k8scsi/csi-node-driver-registrar:v1.2.0 cr.yandex/crp9ftr22d26age3hulg/csi-s3:0.36.2
csi-s3 quay.io/k8scsi/csi-node-driver-registrar:v1.2.0 cr.yandex/crp9ftr22d26age3hulg/csi-s3:0.36.2
e2esdk-dev sosedoff/pgweb:0.11.12
env-1000jours-dashboard-renovate-all-devdependencies-2de2iyna harbor.fabrique.social.gouv.fr/1000jours/app-dashboard/app:sha-d9d87562d2bfd284d07729aed230f33f4260a051
env-1000jours-dashboard-renovate-cypress-13-x-51vo5n8f harbor.fabrique.social.gouv.fr/1000jours/app-dashboard/app:sha-540dfb2af558947185628a60428d6e944134b35f
env-1000jours-dashboard-renovate-testing-library-jest-b2eomcij harbor.fabrique.social.gouv.fr/1000jours/app-dashboard/app:sha-5fe4d847357689f7788eb0942d6e359a42d1c28f
jardinmental-preprod harbor.fabrique.social.gouv.fr/monsuivipsy/jardinmental/app:preprod-4fad57147cc745c2e386595e85fb578d07528556
monsuivipsy-site-preprod harbor.fabrique.social.gouv.fr/monsuivipsy/monsuivipsy-site/app:preprod-ec75926d27b18af3eb64f7c6f118f1c11312dc07
nata-site-preprod harbor.fabrique.social.gouv.fr/nata/nata-site/app:preprod-0325d496a1619000ebf62c303461e38d65b783b3
nos1000jours-blues-epds-pro-preprod harbor.fabrique.social.gouv.fr/1000jours/nos1000jours-blues-epds-pro/app:preprod-7c0525a55a235cd464f2c9e569746f4305b4462b
nos1000jours-blues-epds-widget-preprod harbor.fabrique.social.gouv.fr/1000jours/nos1000jours-blues-epds-widget/app:preprod-11680ef0a32d17ef7f6da36b61205d5909f1dfd8
nos1000jours-landing-preprod harbor.fabrique.social.gouv.fr/1000jours/nos1000jours-landing/app:preprod-6a2e3ea76780daf4567e10e3eb51553e22365de0
ozensemble-site-preprod harbor.fabrique.social.gouv.fr/ozensemble/ozensemble-site/app:preprod-d962fb766e3272d07fe4e754ca6b516495236982
recosante-fix-use-cnpg-in-dev-2cherc3v harbor.fabrique.social.gouv.fr/recosante/api:sha-82b5eea6b2f7d8ded300fb2eef6e2956fdc9deac
recosante-fix-use-cnpg-in-dev-2cherc3v mher/flower:1.2
recosante-fix-use-cnpg-in-dev-2cherc3v harbor.fabrique.social.gouv.fr/recosante/frontend:sha-82b5eea6b2f7d8ded300fb2eef6e2956fdc9deac
recosante-fix-use-cnpg-in-dev-2cherc3v harbor.fabrique.social.gouv.fr/recosante/indice:sha-82b5eea6b2f7d8ded300fb2eef6e2956fdc9deac
recosante-fix-use-cnpg-in-dev-2cherc3v postgres:14
ressourcerie-preprod harbor.fabrique.social.gouv.fr/ressourcerie/ressourcerie/app:preprod-fe4711b89d66987d117a3fe5b7892f3242e24e6a
sandbox-preprod harbor.fabrique.social.gouv.fr/sandbox/sandbox/app:preprod-7ce517ffe5af1423504064865b6adf9801373aed
secretariat-feat-disable-user-5ad1vht0 harbor.fabrique.social.gouv.fr/secretariat/secretariat/app:sha-e1002d547b3a1d3cb831fd8fa3fe0554b4f8e182
secretariat-feat-disable-user-5ad1vht0 harbor.fabrique.social.gouv.fr/secretariat/secretariat/hasura:sha-e1002d547b3a1d3cb831fd8fa3fe0554b4f8e182
secretariat-preprod harbor.fabrique.social.gouv.fr/secretariat/secretariat/app:preprod-770c45423e4e0906b2e095543433448d30bd07cd
secretariat-preprod harbor.fabrique.social.gouv.fr/secretariat/secretariat/hasura:preprod-4100a3e324a951e2596d9f414d6db9feabc17360
standup-preprod harbor.fabrique.social.gouv.fr/fabrique/standup/app:preprod-fde8d8e6a12d20042641dd45fa496cf4e3fa290b
template-empty harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-be4ce701129f679833c5704d43cc173313de335c
template-empty sosedoff/pgweb:0.14.1
template-feat-zero-downtime-lightship-on-hasura-branc-59r98s1x harbor.fabrique.social.gouv.fr/fabrique/template/hasura:sha-499b35f06cadf88f9aaff9a65f6cc0dd40050494
template-feat-zero-downtime-lightship-on-hasura-branc-59r98s1x maildev/maildev:2.1.0
template-feat-zero-downtime-lightship-on-hasura-branc-59r98s1x sosedoff/pgweb:0.14.1
template-feat-zero-downtime-lightship-on-hasura-branc-59r98s1x sosedoff/pgweb:0.14.1
template-feat-zero-downtime-ngninx-4e00xl3u harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-2b8ba7970327b56cc5fb18e6e06679e259472b73
template-hasura harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-c4f71e9acec0246ad7ff1eca961073b1cf184f90
template-hasura harbor.fabrique.social.gouv.fr/fabrique/template/hasura:sha-c4f71e9acec0246ad7ff1eca961073b1cf184f90
template-hasura maildev/maildev:2.1.0
template-hasura sosedoff/pgweb:0.14.1
template-hasura sosedoff/pgweb:0.14.1
template-hasura3 harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-6f1c7507f151de94d844b460ae2b14c077a45cc6
template-hasura3 harbor.fabrique.social.gouv.fr/fabrique/template/hasura:sha-6f1c7507f151de94d844b460ae2b14c077a45cc6
template-hasura3 maildev/maildev:2.1.0
template-hasura3 sosedoff/pgweb:0.14.1
template-hasura3 sosedoff/pgweb:0.14.1
template-preprod harbor.fabrique.social.gouv.fr/fabrique/template/app:preprod-f8fd068c4a55020fb50f8c8db57d4de68518e2c1
template-renovate-hasura-patch-all-1x0aggh2 harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-b0d7368cff669c58a39c594307f1a7f8400d68cd
template-renovate-hasura-patch-all-1x0aggh2 harbor.fabrique.social.gouv.fr/fabrique/template/hasura:sha-b0d7368cff669c58a39c594307f1a7f8400d68cd
template-renovate-hasura-patch-all-1x0aggh2 maildev/maildev:2.1.0
template-renovate-hasura-patch-all-1x0aggh2 sosedoff/pgweb:0.14.1
template-renovate-hasura-patch-all-1x0aggh2 sosedoff/pgweb:0.14.1
template-renovate-main-node-16-alpine3-18-z510pgju harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-ddcf9cc0fc43c718ef22b0bcca276696afc48ffd
template-renovate-main-patch-all-22rw565y harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-54cda22b28d2eeea8e4fd215051afb64794acd23
template-revolunet-patch-1 harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-ca2e659affa0f2e0a9cf19f3f059964f75ce47eb
template-revolunet-patch-1 harbor.fabrique.social.gouv.fr/fabrique/template/hasura:sha-ca2e659affa0f2e0a9cf19f3f059964f75ce47eb
template-revolunet-patch-1 maildev/maildev:2.1.0
template-revolunet-patch-1 sosedoff/pgweb:0.11.8
template-revolunet-patch-1 sosedoff/pgweb:0.11.8
template-test-buildkit harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-40e807d0e8b10d3e7db9a762bc2142ecb910c489
template-test-e2e2 harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-b256205ae2addc3644d6d6ef0999e815517e01ad
template-test-e2e2 harbor.fabrique.social.gouv.fr/fabrique/template/hasura:sha-b256205ae2addc3644d6d6ef0999e815517e01ad
template-test-e2e2 maildev/maildev:2.1.0
template-test-e2e2 sosedoff/pgweb:0.11.8
template-test-e2e2 sosedoff/pgweb:0.11.8
template-test43 harbor.fabrique.social.gouv.fr/fabrique/template/app:sha-f8fd068c4a55020fb50f8c8db57d4de68518e2c1
test-storage-csi-s3 ghcr.io/socialgouv/docker/nginx:sha-fcaf24f
tumeplay-fix-test-csi-s3-4fy0mty5 harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/backend:sha-8a1612702c6bc5f1e340d88fc9f761cb5646ad40
tumeplay-fix-test-csi-s3-4fy0mty5 harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/backend:sha-8a1612702c6bc5f1e340d88fc9f761cb5646ad40
tumeplay-fix-test-csi-s3-4fy0mty5 harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/dashboard:sha-8a1612702c6bc5f1e340d88fc9f761cb5646ad40
tumeplay-fix-test-csi-s3-4fy0mty5 harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/frontend-aime:sha-8a1612702c6bc5f1e340d88fc9f761cb5646ad40
tumeplay-fix-test-csi-s3-4fy0mty5 harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/frontend-guyane:sha-8a1612702c6bc5f1e340d88fc9f761cb5646ad40
tumeplay-fix-test-csi-s3-4fy0mty5 harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/frontend-metropole:sha-8a1612702c6bc5f1e340d88fc9f761cb5646ad40
tumeplay-preprod harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/backend:preprod-8a7863a655258db05be6e161e579432a05783bf6
tumeplay-preprod harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/dashboard:preprod-8a7863a655258db05be6e161e579432a05783bf6
tumeplay-preprod harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/frontend-aime:preprod-8a7863a655258db05be6e161e579432a05783bf6
tumeplay-preprod harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/frontend-guyane:preprod-8a7863a655258db05be6e161e579432a05783bf6
tumeplay-preprod harbor.fabrique.social.gouv.fr/tumeplay/tumeplay/frontend-metropole:preprod-8a7863a655258db05be6e161e579432a05783bf6
www-beta harbor.fabrique.social.gouv.fr/fabrique/www/app:sha-9d3bd85d939dbb827147b5a076bf09efd9833923
www-charon harbor.fabrique.social.gouv.fr/fabrique/www/app:sha-5e1777c5e43823026d0f7ad8d6322c4e75f94409
www-client-filters harbor.fabrique.social.gouv.fr/fabrique/www/app:sha-8acc6f1811a9afcc5f1733735df617cc8a2701bf
www-filters harbor.fabrique.social.gouv.fr/fabrique/www/app:sha-7daa7a33df9f13cd2de31cea5e4406ae7e883699
www-startups-list-details harbor.fabrique.social.gouv.fr/fabrique/www/app:sha-2d1840f156fcb853658689b0e9a9620dd525612d
www-startups-list-details harbor.fabrique.social.gouv.fr/fabrique/www/app:sha-2d1840f156fcb853658689b0e9a9620dd525612d

PROD

NS pods
template harbor.fabrique.social.gouv.fr/fabrique/template/app:v1.16.4
consommables harbor.fabrique.social.gouv.fr/fabrique/consommables/app:v1.0.6
revolunet commented 1 year ago

Fait :

revolunet commented 1 year ago

Atelier avec @octomir :

A faire côté SRE :

NB: kyverno n'est installé que sur OVH

Pour aller plus loin (readOnlyFileSystem) https://luppeng.wordpress.com/2022/04/16/nginx-with-read-only-filesystem-in-kubernetes/

octomir commented 1 year ago

A faire coté SRE: la regle runAsNonRoot empeche l'execution des pods

un roolback a été fait en attente de correction coté SRE

Namespace pods Status Error Type
template-empty pgweb-5855695c97-qmlv4 CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-feat-zero-downtime-lightship-on-hasura-branc-59r98s1x maildev-865f7c5c78-5cjrx CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-feat-zero-downtime-lightship-on-hasura-branc-59r98s1x pgweb-hasura-56f8dcdcb4-vgwdl CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-feat-zero-downtime-lightship-on-hasura-branc-59r98s1x pgweb-keycloak-78dcd46dc9-qtplv CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-hasura maildev-7fc9b654f9-rz7rd CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-hasura3 maildev-6f7dbb5759-v2dhv CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-hasura3 pgweb-hasura-5544c5589c-b9sfr CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-hasura3 pgweb-keycloak-5645dd448c-qnwgf CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-renovate-hasura-patch-all-1x0aggh2 maildev-6d8fcb4854-fztz7 CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-revolunet-patch-1 maildev-84587695c6-mcl98 CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-revolunet-patch-1 pgweb-hasura-7c8d54f7f9-k99sv Init:CreateContainerConfigError Error: container has runAsNonRoot and image will run as root ...
template-revolunet-patch-1 pgweb-keycloak-7888fd9cf7-b8927 Init:CreateContainerConfigError Error: container has runAsNonRoot and image will run as root ...
template-test-e2e2 maildev-5646c786d7-mc7vk CreateContainerConfigError Error: container has runAsNonRoot and image has non-numeric user (node), cannot verify user is non-root
template-test-e2e2 pgweb-hasura-5d566cf8b-kf5fq Init:CreateContainerConfigError Error: container has runAsNonRoot and image will run as root ...
template-test-e2e2 pgweb-keycloak-5d99fbf6b4-sxjpj Init:CreateContainerConfigError Error: container has runAsNonRoot and image will run as root ...
igorrenquin commented 1 year ago

Kyverno peut appliquer une règle de mise en oeuvre des security context pour les appliquer automatiquement

devthejo commented 1 year ago

maildev PR: https://github.com/SocialGouv/helm-charts/pull/46

octomir commented 1 year ago

Kyverno Rule Security Contaction mutation for pods & containers

https://gitlab.fabrique.social.gouv.fr/infra/apps-infra/-/blob/main/kyverno/templates/mas-security-context.yaml

igorrenquin commented 1 year ago