Refactor Dockerfile and Helm chart to enhance security and user permissions
All checks were successful
Talks slides — image & chart / vars (push) Successful in 1s
Talks slides — image & chart / Helm chart (push) Successful in 11s
Talks slides — image & chart / Build container image (push) Successful in 33s

- Updated Dockerfile to run as non-root user 'nginx' and adjusted Nginx configuration for improved security.
- Added pod security context in values.yaml to align with the non-root user setup.
- Refined deployment.yaml to utilize the new pod security context for better compliance with Kubernetes security standards.
This commit is contained in:
Le Prévost-Corvellec Arnault
2026-04-08 21:36:09 +02:00
parent e1576d2360
commit 9a4942daad
3 changed files with 28 additions and 13 deletions

View File

@@ -24,15 +24,14 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
seccompProfile:
type: RuntimeDefault
{{- toYaml .Values.slides.podSecurityContext | nindent 8 }}
containers:
- name: nginx
image: "{{ .Values.slides.image.repository }}:{{ .Values.slides.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.slides.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
# Port 8080 dans le conteneur : pas besoin de NET_BIND_SERVICE (ports privilégiés).
# Image : USER nginx + master non-root → pas de SETUID/SETGID ; port 8080 → pas de NET_BIND_SERVICE.
capabilities:
drop: ["ALL"]
readOnlyRootFilesystem: false