-
Notifications
You must be signed in to change notification settings - Fork 52
/
restrict-env-var-secrets.yaml
43 lines (43 loc) · 2.19 KB
/
restrict-env-var-secrets.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright 2024 Google LLC
#
# This is “Software” that is licensed under the “General Software” section of
# the Service Specific Terms (https://cloud.google.com/terms/service-terms) for
# usage in accordance with the following “Scope of Use”: This file may only be
# used on an Anthos cluster, including any associated ci/cd use. “Anthos
# cluster” is defined as “A Cluster (of any kind) registered to a fleet project
# where the Anthos API is enabled”.
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sNoEnvVarSecrets
metadata:
name: cis-k8s-v1.7.1-restrict-env-var-secrets
labels:
policycontroller.gke.io/bundleName: cis-k8s-v1.7.1
annotations:
policycontroller.gke.io/bundleVersion: 202403.0-preview
policycontroller.gke.io/constraintData: |-
"{
bundleName: 'cis-k8s-v1.7.1',
bundleDisplayName: 'CIS Kubernetes Benchmark v1.7.1',
bundleLink: 'https://cloud.google.com/anthos-config-management/docs/how-to/using-cis-k8s-benchmark',
bundleVersion: '202403.0-preview',
bundleDescription: 'Use the CIS Kubernetes Benchmark 1.7.1 policy bundle with Policy Controller to evaluate the compliance of your cluster resources against the CIS Kubernetes Benchmark, which is a set of recommendations for configuring Kubernetes to support a robust security posture.',
controlNumbers: '[5.4.1]',
severity: 'UNSPECIFIED',
description: 'Restricts the use of secrets as environment variables in container definitions. Instead, use mounted secret files in data volumes.',
remediation: 'Container definitions cannot use secrets as environment variables. Use a mounted secret file in a data volume. See "Using Secrets as files from a Pod" for more information https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod',
minimumTemplateLibraryVersion: '1.10.2',
constraintHash: '6853a2d8343cb0c596beec6472f3e9e4fc48aeb7ce9f403657e9c33097c4e199'
}"
spec:
enforcementAction: dryrun
match:
excludedNamespaces:
- config-management-system
- gke-connect
- kube-system
- apigee
kinds:
- apiGroups:
- ""
kinds:
- Pod