Skip to content

Commit

Permalink
Merge pull request #2620 from alphagov/update-init-containers-PSS-com…
Browse files Browse the repository at this point in the history
…pliant

Update init containers to be PSS compliant in the apps namespace
  • Loading branch information
nimalank7 authored Oct 4, 2024
2 parents 862b334 + 6eb6ac4 commit d42e649
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
2 changes: 2 additions & 0 deletions charts/db-backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1001
seccompProfile:
type: RuntimeDefault

serviceAccount:
create: true
Expand Down
7 changes: 5 additions & 2 deletions charts/generic-govuk-app/templates/assets-upload-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ spec:
- name: assets-to-upload
mountPath: /assets-to-upload
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation | default "false" }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot | default "true" }}
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem | default "true" }}
seccompProfile:
type: RuntimeDefault
capabilities:
drop: ["ALL"]
containers:
Expand Down
11 changes: 10 additions & 1 deletion charts/generic-govuk-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ spec:
volumeMounts:
- name: assets
mountPath: /assets
securityContext:
allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation | default "false" }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot | default "true" }}
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem | default "true" }}
seccompProfile:
type: RuntimeDefault
capabilities:
drop: ["ALL"]

{{- end }}
containers:
- name: app
Expand Down Expand Up @@ -127,7 +136,7 @@ spec:
{{- end }}
securityContext:
allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation }}
readOnlyRootFilesystem: true
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFileSystem }}
capabilities:
drop: ["ALL"]
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions charts/generic-govuk-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ securityContext:
allowPrivilegeEscalation: false
runAsUser: 1001
runAsGroup: 1001
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]

sentry:
enabled: true
Expand Down
9 changes: 7 additions & 2 deletions charts/govuk-jobs/templates/govuk-mirror-sync-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ spec:
cpu: 2
memory: 15000Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation | default "false" }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot | default "true" }}
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem | default "true" }}
seccompProfile:
type: RuntimeDefault
capabilities:
drop: {{ .Values.securityContext.capabilities.drop }}
volumeMounts:
- name: app-mirror-sync
mountPath: /data
Expand Down
2 changes: 1 addition & 1 deletion charts/govuk-jobs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ podSecurityContext:
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
drop: ["ALL"]
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1001
Expand Down

0 comments on commit d42e649

Please sign in to comment.