Why it matters
A writable root filesystem lets an attacker who gains code execution drop tools and alter binaries inside the container.
How to fix it
Set `readOnlyRootFilesystem: true` and mount an emptyDir where the process must write.
What TrustIvan reads
Read through the Kubernetes API with the read-only role TrustIvan's install creates.
Benchmark controls
- CIS Kubernetes Benchmark 1.9.0, control
5.7.3: A security context is applied to pods and containers. Also checked for this control: Container explicitly disables AppArmor, Container sets a custom SELinux user, role or type, Container mounts /proc unmasked, Workload sets an unsafe sysctl - NSA/CISA Kubernetes Hardening Guidance 1.2, control
pod.immutable-filesystem: Container file systems are immutable
Control numbers are the published ones; the titles are TrustIvan's own short descriptions. The benchmarks belong to their publishers, who do not endorse TrustIvan.
Related checks
- Container runs as a Windows HostProcess
KubernetesSeverity: High
k8s.container.windows-host-process - Container image comes from an untrusted registry
KubernetesSeverity: Medium
k8s.container.untrusted-registry - Container mounts /proc unmasked
KubernetesSeverity: High
k8s.container.unmasked-proc - Container sets a custom SELinux user, role or type
KubernetesSeverity: Medium
k8s.container.selinux-custom - Container reads a Secret through environment variables
KubernetesSeverity: Low
k8s.container.secret-in-env - Container has no seccomp profile
KubernetesSeverity: Low
k8s.container.seccomp-unset
Terms: KSPM (Kubernetes security posture management), Kubernetes RBAC, NSA/CISA Kubernetes Hardening Guidance, CIS Benchmarks
All Kubernetes posture checks · The whole catalogue · How this works in TrustIvan · Documentation