1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/test/policy/validate/check_not_root.yaml

27 lines
508 B
YAML
Raw Normal View History

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: check-non-root
spec:
admission: true
background: true
2019-10-14 12:36:19 -07:00
rules:
- match:
any:
- resources:
2019-10-14 12:36:19 -07:00
kinds:
- Deployment
- StatefuleSet
- DaemonSet
name: check-non-root
validate:
message: Root user is not allowed
pattern:
spec:
template:
spec:
securityContext:
runAsNonRoot: true
validationFailureAction: Audit