1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/examples/validate/check_not_root.yaml

22 lines
449 B
YAML
Raw Normal View History

apiVersion : kyverno.io/v1alpha1
kind : Policy
metadata :
name : check-non-root
spec :
rules:
- name: check-non-root
2019-07-25 14:57:44 -04:00
match:
resources:
kinds:
- Deployment
- StatefuleSet
- DaemonSet
validate:
message: "Root user is not allowed"
pattern:
spec:
template:
spec:
securityContext:
2019-05-23 20:37:11 +03:00
runAsNonRoot: true