1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 01:16:55 +00:00
kyverno/examples/demo/7_container_security_context/policy.yaml
2019-07-25 14:57:44 -04:00

27 lines
No EOL
685 B
YAML
Executable file

apiVersion : kyverno.io/v1alpha1
kind: Policy
metadata:
name: container-security-context
spec:
rules:
- name: validate-user-privilege
match:
resources:
kinds:
- Deployment
selector :
matchLabels:
app.type: prod
validate:
message: "validate container security contexts"
pattern:
spec:
template:
spec:
containers:
- securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
# fields can be customized
# privileged: false
# readOnlyRootFilesystem: true