A read-only root file system helps to enforce an immutable infrastructure strategy; the container only needs to write on the mounted volume that persists the state. An immutable root filesystem can also prevent malicious binaries from writing to the host system. This policy validates that containers define a securityContext with `readOnlyRootFilesystem: true`.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: require-ro-rootfsannotations:policies.kyverno.io/title: Require Read-Only Root Filesystempolicies.kyverno.io/category: Best Practices, EKS Best Practices, PSP Migrationpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Podpolicies.kyverno.io/minversion: 1.6.0policies.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 persists the state. An immutable root filesystem can also prevent malicious binaries from writing to the host system. This policy validates that containers define a securityContext with `readOnlyRootFilesystem: true`."spec:validationFailureAction: Auditbackground: truerules:- name: validate-readOnlyRootFilesystemmatch:any:- resources:kinds:- Podvalidate:message: Root filesystem must be read-only.pattern:spec:containers:- securityContext:readOnlyRootFilesystem: true
This policy prevents the use of the default project in an Application.
Services of type LoadBalancer when deployed inside AWS have support for transport encryption if it is enabled via an annotation. This policy requires that Services of type LoadBalancer contain the annotation service.beta.kubernetes.io/aws-load-balancer-ssl-cert with some value.
This policy prevents updates to the project field after an Application is created.