2019-10-08 22:05:15 -07:00
|
|
|
apiVersion: kyverno.io/v1alpha1
|
|
|
|
kind: ClusterPolicy
|
|
|
|
metadata:
|
2019-10-08 22:09:58 -07:00
|
|
|
name: validate-readonly-rootfilesystem
|
2019-10-11 18:57:16 -07:00
|
|
|
annotations:
|
|
|
|
policies.kyverno.io/category: Security Context
|
|
|
|
policies.kyverno.io/description: Containers should run with read-only rootfilesystem
|
2019-10-08 22:05:15 -07:00
|
|
|
spec:
|
|
|
|
rules:
|
2019-10-08 22:09:58 -07:00
|
|
|
- name: validate-readonly-rootfilesystem
|
2019-10-08 22:05:15 -07:00
|
|
|
match:
|
|
|
|
resources:
|
|
|
|
kinds:
|
|
|
|
- Pod
|
|
|
|
validate:
|
2019-10-08 22:09:58 -07:00
|
|
|
message: "Container require read-only rootfilesystem"
|
2019-10-08 22:05:15 -07:00
|
|
|
pattern:
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- securityContext:
|
2019-10-08 22:09:58 -07:00
|
|
|
readOnlyRootFilesystem: true
|