From 3cd1b78b686ad2d58d2c461d5488cf84a7e723c5 Mon Sep 17 00:00:00 2001 From: pd2839 Date: Tue, 19 Mar 2019 13:21:19 -0500 Subject: [PATCH] Implement Security Context for Keystone Implement container security context for the following Keystone resources: - Keystone server deployment Change-Id: Ia68b5ebe4d76e0405d67224d976fee013cc02d0b --- keystone/templates/deployment-api.yaml | 5 +---- keystone/values.yaml | 9 +++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/keystone/templates/deployment-api.yaml b/keystone/templates/deployment-api.yaml index 2d45810ef1..e3cfe39b88 100644 --- a/keystone/templates/deployment-api.yaml +++ b/keystone/templates/deployment-api.yaml @@ -46,8 +46,6 @@ spec: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} spec: - securityContext: - readOnlyRootFilesystem: true {{ dict "envAll" $envAll "application" "keystone" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} affinity: @@ -61,8 +59,7 @@ spec: - name: keystone-api {{ tuple $envAll "keystone_api" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - securityContext: - allowPrivilegeEscalation: false +{{ dict "envAll" $envAll "application" "keystone" "container" "keystone_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - /tmp/keystone-api.sh - start diff --git a/keystone/values.yaml b/keystone/values.yaml index 4c2a1d6ee5..db11062d8d 100644 --- a/keystone/values.yaml +++ b/keystone/values.yaml @@ -152,9 +152,14 @@ dependencies: service: local_image_registry pod: - user: + security_context: keystone: - uid: 42424 + pod: + runAsUser: 42424 + container: + keystone_api: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false affinity: anti: type: