1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/test/policy/deny/policy.yaml
Charles-Edouard Brétéché 6a43ec4bcf
chore: fix policies (#8449)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-19 10:28:58 +00:00

31 lines
879 B
YAML

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: path-canonicalize
spec:
admission: true
background: false
rules:
- match:
any:
- resources:
kinds:
- Pod
name: disallow-mount-containerd-sock
validate:
foreach:
- deny:
conditions:
any:
- key: '{{ path_canonicalize(element.hostPath.path) }}'
operator: Equals
value: /var/run/containerd/containerd.sock
- key: '{{ path_canonicalize(element.hostPath.path) }}'
operator: Equals
value: /run/containerd/containerd.sock
- key: '{{ path_canonicalize(element.hostPath.path) }}'
operator: Equals
value: \var\run\containerd\containerd.sock
list: request.object.spec.volumes[]
validationFailureAction: Enforce