Merge "Add missing security context to Heat pods/containers"

This commit is contained in:
Zuul 2020-07-17 16:18:05 +00:00 committed by Gerrit Code Review
commit eafe48a136
4 changed files with 27 additions and 0 deletions

View File

@ -53,6 +53,7 @@ spec:
{{ dict "envAll" $envAll "podName" "heat-engine-cleaner" "containerNames" (list "heat-engine-cleaner" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "engine_cleaner" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 10 }}
restartPolicy: OnFailure
nodeSelector:
{{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
@ -62,6 +63,7 @@ spec:
- name: heat-engine-cleaner
{{ tuple $envAll "heat_engine_cleaner" | include "helm-toolkit.snippets.image" | indent 14 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.engine_cleaner | include "helm-toolkit.snippets.kubernetes_resources" | indent 14 }}
{{ dict "envAll" $envAll "application" "engine_cleaner" "container" "heat_engine_cleaner" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 14 }}
command:
- /tmp/heat-engine-cleaner.sh
volumeMounts:

View File

@ -36,6 +36,7 @@ spec:
{{ dict "envAll" $envAll "podName" "heat-domain-ks-user" "containerNames" (list "heat-ks-domain-user" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "ks_user" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
restartPolicy: OnFailure
nodeSelector:
{{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
@ -44,6 +45,7 @@ spec:
containers:
- name: heat-ks-domain-user
{{ tuple $envAll "ks_user" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ dict "envAll" $envAll "application" "ks_user" "container" "heat_ks_domain_user" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/ks-domain-user.sh
volumeMounts:

View File

@ -38,6 +38,7 @@ spec:
{{ dict "envAll" $envAll "podName" "heat-trusts" "containerNames" (list "heat-trusts" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "trusts" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
restartPolicy: OnFailure
nodeSelector:
{{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
@ -47,6 +48,7 @@ spec:
- name: heat-trusts
{{ tuple $envAll "ks_service" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.trusts | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "trusts" "container" "heat_trusts" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- bash
- /tmp/trusts.sh

View File

@ -1048,6 +1048,27 @@ pod:
heat_engine:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
trusts:
pod:
runAsUser: 42424
container:
heat_trusts:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
ks_user:
pod:
runAsUser: 42424
container:
heat_ks_domain_user:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
engine_cleaner:
pod:
runAsUser: 42424
container:
heat_engine_cleaner:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
affinity:
anti:
type: