-
Notifications
You must be signed in to change notification settings - Fork 4
/
kyverno.yaml
30 lines (30 loc) · 960 Bytes
/
kyverno.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
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: psp-allowprivilegeescalation
spec:
validationFailureAction: Enforce
rules:
- name: psp-allowprivilegeescalation
match:
resources:
kinds:
- Pod
validate:
message: >-
Privilege escalation is disallowed. The fields
spec.containers[*].securityContext.allowPrivilegeEscalation, and
spec.initContainers[*].securityContext.allowPrivilegeEscalation, and
spec.ephemeralContainers[*].securityContext.allowPrivilegeEscalation must
be undefined or set to `false`.
pattern:
spec:
=(initContainers):
- =(securityContext):
=(allowPrivilegeEscalation): "false"
=(ephemeralContainers):
- =(securityContext):
=(allowPrivilegeEscalation): "false"
containers:
- =(securityContext):
=(allowPrivilegeEscalation): "false"