1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 01:16:55 +00:00
kyverno/examples/Validate/check_not_root.yaml

18 lines
396 B
YAML
Raw Normal View History

apiVersion : kyverno.io/v1alpha1
kind : Policy
metadata :
name : check-non-root
spec :
rules:
- name: check-non-root
resource:
kind: Deployment, StatefuleSet, DaemonSet
validate:
message: "Root user is not allowed"
pattern:
spec:
template:
spec:
securityContext:
runAsNotRoot: true