1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 09:56:55 +00:00
kyverno/examples/best_practices/policy_validate_container_disallow_priviledgedprivelegesecalation.yaml

30 lines
777 B
YAML
Raw Normal View History

2019-09-03 11:27:04 -07:00
apiVersion: kyverno.io/v1alpha1
2019-09-04 11:29:46 -07:00
kind: ClusterPolicy
2019-09-03 11:27:04 -07:00
metadata:
name: validate-deny-privileged-disallowpriviligedescalation
2019-09-03 11:27:04 -07:00
spec:
validationFailureAction: "audit"
rules:
- name: deny-privileged-disallowpriviligedescalation
2019-09-03 11:27:04 -07:00
exclude:
resources:
2019-09-04 11:08:56 -07:00
namespaces:
- kube-system
2019-09-03 11:27:04 -07:00
match:
resources:
kinds:
- Pod
validate:
2019-09-18 12:31:14 -07:00
message: "Privileged mode is not allowed. Set allowPrivilegeEscalation and privileged to false"
anyPattern:
- spec:
securityContext:
allowPrivilegeEscalation: false
privileged: false
- spec:
containers:
- name: "*"
securityContext:
allowPrivilegeEscalation: false
privileged: false