Use Read-Only Filesystem

Do not generally permit containers with readOnlyRootFilesystem=true. The root filesystem should be immutable, to prevent potential attacker from tampering with the filesystem or writing foreign executables to disk.

Risk Level: High
Cloud Entity: Pods
CloudGuard Rule ID: D9.K8S.AC.05
Covered by Spectral: No
Category: Compute

GSL LOGIC

KubernetesPod should have spec.containers contain-all [ securityContext.readOnlyRootFilesystem=true ] and (spec.initContainers isEmpty() or spec.initContainers contain-all [ securityContext.readOnlyRootFilesystem=true ])

REMEDIATION

Pods

Pods are the smallest deployable units of computing that can be created and managed in Kubernetes.A Pod is a group of one or more containers (such as Docker containers), with shared storage/network, and a specification for how to run the containers.

Compliance Frameworks

  • Container Admission Control