Description
For a mount at /bin or /etc, check both the container path and its backing volume. Remove unused mounts and set readOnly: true for files the container only reads.
Potential impact
A writable mount can allow changes to container executables or configuration. A host-backed volume can extend that impact to the node. Read-only access can still expose file contents.
Remediation
If submounts also need protection, add recursiveReadOnly: Enabled. The feature became stable in Kubernetes 1.33 and requires Linux 5.12 or later and compatible runtimes. Omit mountPropagation or set it to None.
Examples
The excerpts show mount options at /bin. Supply the omitted vol-0 volume source and the image you intend to run.
Before
apiVersion: v1
kind: Pod
metadata:
name: pod-0
spec:
containers:
- name: pod-0
image: k8s.gcr.io/test-webserver
volumeMounts:
- mountPath: /bin
name: vol-0
readOnly: false
recursiveReadOnly: Disabled
After
apiVersion: v1
kind: Pod
metadata:
name: pod-0
spec:
containers:
- name: pod-0
image: k8s.gcr.io/test-webserver
volumeMounts:
- mountPath: /bin
name: vol-0
readOnly: true
recursiveReadOnly: Enabled
With Enabled, the mount fails if the requirements are unmet. Check that submounts are read-only for this container and the application still works. Review write access through other mounts separately.