forked from GoogleCloudPlatform/gke-policy-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
running-as-non-root.yaml
55 lines (55 loc) · 2.01 KB
/
running-as-non-root.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
48
49
50
51
52
53
54
55
# Copyright 2023 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: K8sPSPAllowedUsers
metadata:
name: pss-restricted-v2022-running-as-non-root
labels:
policycontroller.gke.io/bundleName: pss-restricted-v2022
annotations:
policycontroller.gke.io/constraintData: |
"{
bundleName: 'pss-restricted-v2022',
bundleDisplayName: 'Pod Security Standards Restricted v2022',
bundleLink: 'https://github.com/GoogleCloudPlatform/acm-policy-controller-library/tree/master/anthos-bundles/pss-restricted-v2022',
bundleVersion: '202301.0',
bundleDescription: 'Use the Pod Security Standards Restricted v2022 policy bundle with Anthos Policy Controller to to achieve many of the protections of the Kubernetes Pod Security Standards Restricted policy.',
controlNumbers: '[]',
severity: 'UNASSIGNED',
description: 'Containers must be required to run as non-root users. Containers must not set runAsUser to 0.',
remediation: '',
minimumTemplateLibraryVersion: '1.10.1'
}"
spec:
enforcementAction: dryrun
match:
kinds:
- apiGroups:
- ""
kinds:
- Pod
excludedNamespaces:
- kube-system
- asm-system
- config-management-system
- config-management-monitoring
- cert-manager
- gke-connect
- istio-system
- resource-group-system
- gatekeeper-system
parameters:
exemptImages:
- gcr.io/gke-release/asm/proxyv2:*
- gcr.io/anthos-baremetal-release/*
runAsUser:
rule: MustRunAsNonRoot
ranges:
- min: 1
max: 65536