-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkyverno.yaml
29 lines (29 loc) · 930 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
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: psp-privileged-container
spec:
validationFailureAction: Enforce
rules:
- name: privileged-containers
match:
resources:
kinds:
- Pod
validate:
message: >-
Privileged mode is disallowed. The fields spec.securityContext.privileged,
spec.containers[*].securityContext.privileged
and spec.initContainers[*].securityContext.privileged and
spec.ephemeralContainers[*].securityContext.privileged must not be set to true.
pattern:
spec:
=(initContainers):
- =(securityContext):
=(privileged): "false"
=(ephemeralContainers):
- =(securityContext):
=(privileged): "false"
containers:
- =(securityContext):
=(privileged): "false"