1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 09:26:54 +00:00
kyverno/samples/best_practices/disallow_docker_sock_mount.yaml

24 lines
750 B
YAML
Raw Normal View History

2019-11-13 13:56:20 -08:00
apiVersion: kyverno.io/v1
2019-11-01 13:31:08 -07:00
kind: ClusterPolicy
metadata:
name: disallow-docker-sock-mount
annotations:
policies.kyverno.io/category: Security
policies.kyverno.io/description: The Docker socket bind mount allows access to the
Docker daemon on the node. This access can be used for privilege escalation and
to manage containers outside of Kubernetes, and hence should not be allowed.
spec:
validationFailureAction: audit
2019-11-01 13:31:08 -07:00
rules:
- name: validate-docker-sock-mount
match:
resources:
kinds:
- Pod
validate:
message: "Use of the Docker Unix socket is not allowed"
pattern:
spec:
=(volumes):
2019-11-15 21:16:11 -08:00
- =(hostPath):
path: "!/var/run/docker.sock"