Some checks are pending
Pipelines as Code CI / homelab-ci CI has Started
Signed-off-by: gwg313 <gwg313@pm.me>
26 lines
585 B
YAML
26 lines
585 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"]
|
|
exclude:
|
|
any:
|
|
- resources:
|
|
namespaceSelector:
|
|
matchLabels:
|
|
policy.home.arpa/allow-hostpath: "true"
|
|
|
|
validate:
|
|
message: "hostPath volumes are not allowed (escape risk)."
|
|
pattern:
|
|
spec:
|
|
volumes:
|
|
- (hostPath): null
|