KCSA · Domain 2: Kubernetes Cluster Component Security · 22% of the exam
Task 2.5: Container Runtime
The CRI and its runtimes, runtime classes and sandboxed runtimes, access to the runtime socket and why mounting it is dangerous.
Study it
Kubelet, container runtime and kube-proxy
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the CNCF documentation page that proves it.
Question 1 · choose 1
A vendor's monitoring DaemonSet asks to mount /run/containerd/containerd.sock from each node through a hostPath volume. Why does the Kubernetes guide to API server bypass risks treat this as a serious risk?
AThe socket file contains the kubelet's client certificate, which the Pod could read
Bcontainerd rejects connections from inside containers, so the DaemonSet would crash-loop
CIt lets the Pod start or control any container on the node, bypassing API server checks
DData written through a hostPath mount counts against ephemeral storage and evicts Pods
Show the answer and why
AThe socket file contains the kubelet's client certificate, which the Pod could read
Incorrect
The socket is an endpoint of the container runtime's API, not a credential file; the danger is what the runtime API allows a caller to do.
Bcontainerd rejects connections from inside containers, so the DaemonSet would crash-loop
Incorrect
The runtime accepts any process that can reach the socket file; that is why filesystem access to it must be tightly controlled.
CIt lets the Pod start or control any container on the node, bypassing API server checks
Correct
The guide says an attacker with access to the container runtime socket can launch new containers or interact with running ones, bypassing the controls built into the API server.
DData written through a hostPath mount counts against ephemeral storage and evicts Pods
Incorrect
The volumes documentation notes the opposite: hostPath usage is not treated as ephemeral storage usage and must be monitored separately.
The container runtime socket is one of the API server bypass paths the documentation lists. Whoever can reach it can create or control containers directly on the node, out of reach of authorization, admission and audit, so filesystem access to it, including through hostPath, should be tightly controlled.
BThe daemon runs as root while containers drop all capabilities
CImages are pulled without registry credentials
DThe Docker daemon and its containers run as a non-root user
Show the answer and why
AContainers run without any Linux namespaces
Incorrect
Rootless mode keeps container isolation; it changes the user that runs the daemon and containers.
BThe daemon runs as root while containers drop all capabilities
Incorrect
In rootless mode the daemon itself runs as a non-root user.
CImages are pulled without registry credentials
Incorrect
Rootless mode concerns privileges on the host, not registry authentication.
DThe Docker daemon and its containers run as a non-root user
Correct
The rootless mode page says it lets you run the Docker daemon and containers as a non-root user.
Docker's rootless mode runs both the daemon and the containers as an unprivileged user, which limits what a compromise of the daemon or a container breakout can do on the host.
What does Kubernetes' cloud native security overview say about choosing a container runtime?
Acontainerd is the only runtime Kubernetes supports
BNo specific runtime is recommended; check yours meets your security needs
CDocker Engine is required for Pod Security Standards to work
DThe runtime does not matter, because the kubelet provides all of the isolation
Show the answer and why
Acontainerd is the only runtime Kubernetes supports
Incorrect
Kubernetes works with several runtimes through the Container Runtime Interface; the overview recommends none in particular.
BNo specific runtime is recommended; check yours meets your security needs
Correct
The overview says Kubernetes does not recommend a specific container runtime and that you should make sure the runtimes you choose meet your information security needs.
CDocker Engine is required for Pod Security Standards to work
Incorrect
Pod Security Standards are enforced by admission in the API server, independent of the runtime.
DThe runtime does not matter, because the kubelet provides all of the isolation
Incorrect
The kubelet relies on the runtime to set up and run containers, so the runtime's security properties matter.
Kubernetes relies on a container runtime to run containers but does not recommend one. The overview asks you to choose runtimes, and where useful runtimes that provide extra security restrictions, according to your own security needs.