Skip to content

Commit

Permalink
🔒 Add support for securityContext
Browse files Browse the repository at this point in the history
Default to settings that satisfy the [restricted Pod Security Standard](https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted)
  • Loading branch information
mikebryant committed Dec 7, 2023
1 parent 5dd5ef8 commit c7b12d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deploy/charts/google-cas-issuer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ spec:
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}

{{- with .Values.nodeSelector }}
nodeSelector:
Expand All @@ -59,6 +63,10 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
16 changes: 16 additions & 0 deletions deploy/charts/google-cas-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ affinity: {}
# values:
# - master

# -- Pod Security Context
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault

# -- Container Security Context to be set on the controller component container
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
containerSecurityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true

# -- Kubernetes pod tolerations for google-cas-issuer
tolerations: []
# -- Allow scheduling of DaemonSet on all nodes
Expand Down

0 comments on commit c7b12d1

Please sign in to comment.