mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
6a43ec4bcf
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
31 lines
879 B
YAML
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
|