From 478855dc7cc64b7e7a9d8d96b0b0419061dda63e Mon Sep 17 00:00:00 2001 From: Rahul Khiyani Date: Thu, 14 Mar 2019 10:21:50 -0400 Subject: [PATCH] Fluent-logging securityContext securityContext with allowPrivilegeEscalation: false is implemented at container level and leveraged the helm-toolkit snippet Change-Id: Iddb18c87993fd3dc005c55f5678829c2a19718db --- fluent-logging/templates/deployment-fluentd.yaml | 5 +---- .../monitoring/prometheus/exporter-deployment.yaml | 3 +-- fluent-logging/values.yaml | 14 +++++++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fluent-logging/templates/deployment-fluentd.yaml b/fluent-logging/templates/deployment-fluentd.yaml index eb8fde0f8..bd628a58c 100644 --- a/fluent-logging/templates/deployment-fluentd.yaml +++ b/fluent-logging/templates/deployment-fluentd.yaml @@ -94,8 +94,6 @@ spec: configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} spec: - securityContext: - readOnlyRootFilesystem: true {{ dict "envAll" $envAll "application" "fluentd" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} affinity: @@ -109,8 +107,7 @@ spec: - name: fluentd {{ tuple $envAll "fluentd" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.fluentd | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - securityContext: - allowPrivilegeEscalation: false +{{ dict "envAll" $envAll "application" "fluentd" "container" "fluentd" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - /tmp/fluentd.sh - start diff --git a/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml index 929a55dbe..d35be2b5e 100644 --- a/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml @@ -52,8 +52,7 @@ spec: - name: fluentd-exporter {{ tuple $envAll "prometheus_fluentd_exporter" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.prometheus_fluentd_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - securityContext: - allowPrivilegeEscalation: false +{{ dict "envAll" $envAll "application" "fluentd_exporter" "container" "fluentd_exporter" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - /tmp/fluentd-exporter.sh - start diff --git a/fluent-logging/values.yaml b/fluent-logging/values.yaml index 2ac2cd94a..18210d992 100644 --- a/fluent-logging/values.yaml +++ b/fluent-logging/values.yaml @@ -571,11 +571,19 @@ network: port: 32329 pod: - user: + security_context: fluentd: - uid: 65534 + pod: + runAsUser: 65534 + container: + fluentd: + allowPrivilegeEscalation: false fluentd_exporter: - uid: 65534 + pod: + runAsUser: 65534 + container: + fluentd_exporter: + allowPrivilegeEscalation: false affinity: anti: type: