Skip to content

Commit

Permalink
Add restrictive securityContext definitions (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro authored Mar 30, 2024
1 parent 2e4a04d commit 208d5ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
9 changes: 9 additions & 0 deletions charts/dependency-track/templates/api-server/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ spec:
- name: {{ include "dependencytrack.apiServerName" . }}
image: {{ include "dependencytrack.apiServerImage" . }}
imagePullPolicy: {{ .Values.apiServer.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
{{- with .Values.apiServer.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
17 changes: 16 additions & 1 deletion charts/dependency-track/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ spec:
- name: {{ include "dependencytrack.frontendName" . }}
image: {{ include "dependencytrack.frontendImage" . }}
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
{{- with .Values.frontend.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -45,6 +54,9 @@ spec:
- name: web
containerPort: 8080
protocol: TCP
volumeMounts:
- name: tmp
mountPath: /tmp
livenessProbe:
httpGet:
scheme: HTTP
Expand All @@ -67,4 +79,7 @@ spec:
timeoutSeconds: {{ .Values.frontend.probes.readiness.timeoutSeconds }}
{{- if .Values.apiServer.extraContainers }}
{{- toYaml .Values.apiServer.extraContainers | nindent 6 }}
{{- end }}
{{- end }}
volumes:
- name: tmp
emptyDir: { }

0 comments on commit 208d5ed

Please sign in to comment.