-
Notifications
You must be signed in to change notification settings - Fork 52
/
require-securitycontext.yaml
47 lines (47 loc) · 2.19 KB
/
require-securitycontext.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
44
45
46
47
# 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: K8sPodsRequireSecurityContext
metadata:
name: cis-gke-v1.5.0-require-securitycontext
labels:
policycontroller.gke.io/bundleName: cis-gke-v1.5.0
annotations:
policycontroller.gke.io/bundleVersion: "202405.0"
policycontroller.gke.io/constraintData: |-
"{
bundleName: 'cis-gke-v1.5.0',
bundleDisplayName: 'CIS GKE Benchmark v1.5.0',
bundleLink: 'https://cloud.google.com/anthos-config-management/docs/how-to/using-cis-gke-v1.5',
bundleVersion: '202405.0',
bundleDescription: 'Use the CIS GKE Benchmark 1.5.0 policy bundle with Policy Controller to evaluate the compliance of your cluster resources against the CIS GKE Benchmark v1.5.0, which is a set of recommendations for configuring GKE to support a robust security posture.',
controlNumbers: '[4.6.3]',
severity: 'UNSPECIFIED',
description: 'Requires that Pods define `securityContext`.',
remediation: 'Containers cannot run without a `securityContext` defined. Set your containers `securityContext: `. See "Set the security context for a Pod" for more information: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod',
minimumTemplateLibraryVersion: '1.14.3',
constraintHash: '15277b142d0976eae0bf2fce4eb8bdb49210df870954efbee80d7ff83fdfe369'
}"
spec:
enforcementAction: dryrun
match:
excludedNamespaces:
- kube-system
- config-management-system
- asm-system
- anthos-identity-service
- apigee
kinds:
- apiGroups:
- ""
kinds:
- Pod
parameters:
exemptImages:
- gcr.io/anthos-baremetal-release/*