1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/test/more/require_drop_all.yaml

41 lines
867 B
YAML
Raw Normal View History

---
2020-12-01 10:37:46 -05:00
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: drop-all-capabilities
spec:
admission: true
background: true
2020-12-01 10:37:46 -05:00
rules:
- match:
any:
- resources:
kinds:
- Pod
name: drop-all-containers
2020-12-01 10:37:46 -05:00
validate:
message: Drop all must be defined for every container in the Pod.
2020-12-01 10:37:46 -05:00
pattern:
spec:
containers:
- securityContext:
capabilities:
drop:
- ALL
- match:
any:
- resources:
kinds:
- Pod
name: drop-all-initcontainers
2020-12-01 10:37:46 -05:00
validate:
message: Drop all must be defined for every container in the Pod.
2020-12-01 10:37:46 -05:00
pattern:
spec:
initContainers:
- securityContext:
capabilities:
drop:
- ALL
validationFailureAction: Audit