From 2671e4a13d90efcd6c2e531b6148751db3ff85a0 Mon Sep 17 00:00:00 2001 From: Nathael Bonnal Date: Mon, 9 Nov 2026 11:35:17 +0100 Subject: [PATCH] fix(helm): comply with the restricted PodSecurity profile Run as the nginx user (101), drop all capabilities, disable privilege escalation, use the RuntimeDefault seccomp profile and a read-only root filesystem with emptyDir mounts for the nginx cache and pid. Signed-off-by: Nathael Bonnal --- helm/templates/deployment.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index ac678e3..dab5fb0 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -21,6 +21,12 @@ spec: app.kubernetes.io/instance: {{ $.Release.Name }} app.kubernetes.io/name: {{ $name }} spec: + securityContext: + runAsNonRoot: true + runAsUser: 101 + runAsGroup: 101 + seccompProfile: + type: RuntimeDefault containers: - name: {{ $name }} image: {{ include "ferriskey-website.image" (dict "root" $ "app" $app) }} @@ -29,6 +35,18 @@ spec: - name: http containerPort: {{ $app.containerPort }} protocol: TCP + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + volumeMounts: + - name: nginx-cache + mountPath: /var/cache/nginx + - name: nginx-run + mountPath: /run resources: {{- toYaml $app.resources | nindent 12 }} livenessProbe: @@ -43,5 +61,10 @@ spec: port: http initialDelaySeconds: 3 periodSeconds: 5 + volumes: + - name: nginx-cache + emptyDir: {} + - name: nginx-run + emptyDir: {} {{- end }} {{- end }}