homelab-gitops/platform/kyverno/policies/30-disallow/disallow-hostpath-volumes.yaml
gwg313 baa0216960
add kyverno policies
Signed-off-by: gwg313 <gwg313@pm.me>
2026-05-28 20:09:06 -04:00

20 lines
414 B
YAML

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: disallow-hostpath-volumes
spec:
validationFailureAction: Enforce
rules:
- name: no-hostpath
match:
any:
- resources:
kinds: ["Pod"]
validate:
message: "hostPath volumes are not allowed (escape risk)."
pattern:
spec:
volumes:
- (hostPath): null