mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
7562bea6db
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
40 lines
867 B
YAML
40 lines
867 B
YAML
---
|
|
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: drop-all-capabilities
|
|
spec:
|
|
admission: true
|
|
background: true
|
|
rules:
|
|
- match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
name: drop-all-containers
|
|
validate:
|
|
message: Drop all must be defined for every container in the Pod.
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- securityContext:
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
- match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
name: drop-all-initcontainers
|
|
validate:
|
|
message: Drop all must be defined for every container in the Pod.
|
|
pattern:
|
|
spec:
|
|
initContainers:
|
|
- securityContext:
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
validationFailureAction: Audit
|