Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make container securityContext configurable #147

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions charts/dependency-track/templates/api-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,7 @@ 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
securityContext: {{ toYaml .Values.apiServer.securityContext | nindent 10 }}
{{- with .Values.apiServer.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,7 @@ 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
securityContext: {{ toYaml .Values.apiServer.securityContext | nindent 10 }}
{{- with .Values.apiServer.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
10 changes: 1 addition & 9 deletions charts/dependency-track/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@ spec:
- name: {{ include "dependencytrack.frontendName" . }}
image: {{ include "dependencytrack.frontendImage" . }}
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: false # RO filesystems are not supported by the frontend
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.frontend.securityContext | nindent 10 }}
{{- with .Values.frontend.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
21 changes: 21 additions & 0 deletions charts/dependency-track/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ apiServer:
# For OpenShift, explicitly set this to null.
podSecurityContext:
fsGroup: 1000
# -- Security context of the Container.
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
persistentVolume:
enabled: false
className: ""
Expand Down Expand Up @@ -134,6 +144,17 @@ frontend:
limits:
cpu: 500m
memory: 128Mi
# -- Security context of the Container.
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
# RO filesystems are not supported by the frontend
readOnlyRootFilesystem: false
seccompProfile:
type: RuntimeDefault
extraEnv: []
extraEnvFrom: []
extraContainers: []
Expand Down
10 changes: 1 addition & 9 deletions charts/hyades/templates/api-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,7 @@ spec:
- name: {{ include "hyades.apiServerName" . }}
image: {{ include "hyades.apiServerImage" . }}
imagePullPolicy: {{ .Values.apiServer.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.apiServer.securityContext | nindent 10 }}
{{- with .Values.apiServer.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
10 changes: 1 addition & 9 deletions charts/hyades/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,7 @@ spec:
- name: {{ include "hyades.frontendName" . }}
image: {{ include "hyades.frontendImage" . }}
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: false # RO filesystems are not supported by the frontend
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.frontend.securityContext | nindent 10 }}
{{- with .Values.frontend.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
10 changes: 1 addition & 9 deletions charts/hyades/templates/mirror-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ spec:
- name: {{ include "hyades.mirrorServiceName" . }}
image: {{ include "hyades.mirrorServiceImage" . }}
imagePullPolicy: {{ .Values.mirrorService.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.mirrorService.securityContext | nindent 10 }}
{{- with .Values.mirrorService.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ spec:
- name: {{ include "hyades.notificationPublisherName" . }}
image: {{ include "hyades.notificationPublisherImage" . }}
imagePullPolicy: {{ .Values.notificationPublisher.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.notificationPublisher.securityContext | nindent 10 }}
{{- with .Values.notificationPublisher.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
10 changes: 1 addition & 9 deletions charts/hyades/templates/repo-meta-analyzer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ spec:
- name: {{ include "hyades.repoMetaAnalyzerName" . }}
image: {{ include "hyades.repoMetaAnalyzerImage" . }}
imagePullPolicy: {{ .Values.repoMetaAnalyzer.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.repoMetaAnalyzer.securityContext | nindent 10 }}
{{- with .Values.repoMetaAnalyzer.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
10 changes: 1 addition & 9 deletions charts/hyades/templates/vuln-analyzer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ spec:
- name: {{ include "hyades.vulnAnalyzerName" . }}
image: {{ include "hyades.vulnAnalyzerImage" . }}
imagePullPolicy: {{ .Values.vulnAnalyzer.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.vulnAnalyzer.securityContext | nindent 10 }}
{{- with .Values.vulnAnalyzer.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
10 changes: 1 addition & 9 deletions charts/hyades/templates/vuln-analyzer/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,7 @@ spec:
- name: {{ include "hyades.vulnAnalyzerName" . }}
image: {{ include "hyades.vulnAnalyzerImage" . }}
imagePullPolicy: {{ .Values.vulnAnalyzer.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
securityContext: {{ toYaml .Values.vulnAnalyzer.securityContext | nindent 10 }}
{{- with .Values.vulnAnalyzer.command }}
command: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
29 changes: 29 additions & 0 deletions charts/hyades/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ apiServer:
limits:
cpu: "4"
memory: 2Gi
# -- Security context of the Container.
securityContext: &hyadesSecurityContext
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
extraEnv: []
extraEnvFrom: []
probes:
Expand Down Expand Up @@ -124,6 +134,17 @@ frontend:
limits:
cpu: 500m
memory: 128Mi
# -- Security context of the Container.
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
# RO filesystems are not supported by the frontend
readOnlyRootFilesystem: false
seccompProfile:
type: RuntimeDefault
extraEnv: []
extraEnvFrom: []
probes:
Expand Down Expand Up @@ -174,6 +195,8 @@ mirrorService:
limits:
cpu: "2"
memory: 2Gi
# -- Security context of the container.
securityContext: *hyadesSecurityContext
extraEnv: []
extraEnvFrom: []
probes:
Expand Down Expand Up @@ -218,6 +241,8 @@ notificationPublisher:
limits:
cpu: "2"
memory: 2Gi
# -- Security context of the container.
securityContext: *hyadesSecurityContext
extraEnv: []
extraEnvFrom: []
probes:
Expand Down Expand Up @@ -262,6 +287,8 @@ repoMetaAnalyzer:
limits:
cpu: "2"
memory: 2Gi
# -- Security context of the container.
securityContext: *hyadesSecurityContext
extraEnv: []
extraEnvFrom: []
probes:
Expand Down Expand Up @@ -311,6 +338,8 @@ vulnAnalyzer:
limits:
cpu: "2"
memory: 2Gi
# -- Security context of the container.
securityContext: *hyadesSecurityContext
persistentVolume:
# -- Whether to use a persistent volume to store application state.
# Has no effect unless useStatefulSet is true. Is pointless unless
Expand Down
2 changes: 1 addition & 1 deletion ct.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
target-branch: main
helm-extra-args: --timeout 180s
helm-extra-args: --timeout 240s
check-version-increment: false