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

31 lines
795 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:
message: "Privileged mode is not allowed. Set allowPrivilegeEscalatin and privileged to false"
# anyPattern:
# - spec:
# securityContext:
# allowPrivilegeEscalation: false
# privileged: false
pattern:
spec:
containers:
- name: "*"
securityContext:
allowPrivilegeEscalation: false
privileged: false