1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/samples/best_practices/require_ro_rootfs.yaml

24 lines
776 B
YAML
Raw Normal View History

apiVersion: kyverno.io/v1alpha1
kind: ClusterPolicy
metadata:
2019-11-09 16:18:33 -08:00
name: require-ro-rootfs
2019-10-11 18:57:16 -07:00
annotations:
policies.kyverno.io/category: Security Context
2019-10-14 16:33:19 -07:00
policies.kyverno.io/description: A read-only root file system helps to enforce an immutable
infrastructure strategy; the container only needs to write on the mounted volume that p
ersists the state. An immutable root filesystem can also prevent malicious binaries from
writing to the host system.
spec:
rules:
2019-11-09 16:18:33 -08:00
- name: validate-readOnlyRootFilesystem
match:
resources:
kinds:
- Pod
validate:
2019-11-09 16:18:33 -08:00
message: "Root filesystem must be read-only"
pattern:
spec:
containers:
- securityContext:
readOnlyRootFilesystem: true