CKS System Hardening Practice Question
Which of the following host access settings should be avoided to minimize the attack surface from containers? (Select the setting that increases risk the most.)
⚠ Common exam trap
The CKS exam often tests the misconception that resource limits or read-only filesystems are more critical for security than namespace isolation, but the core principle is that sharing the host PID namespace breaks container isolation at the kernel level, which is far more dangerous than misconfiguring capabilities or resource constraints.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
hostPID: true
Setting `hostPID: true` allows a container to share the host's process ID namespace, enabling it to see all processes running on the host. This breaks the fundamental isolation that containers should provide, giving a compromised container direct visibility into host processes and the ability to potentially interact with them (e.g., sending signals). This significantly increases the attack surface and is the most dangerous setting among the options.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
hostPID: true
Why this is correct
Setting `hostPID: true` grants a container direct access to the host’s process ID namespace, allowing it to view and potentially interact with all processes running on the host. This violates the principle of namespace isolation, which is the core constraint the stem targets for minimising attack surface. Exposing host PID enables privilege escalation or information leakage from other containers or system services.
- ✗
securityContext: capabilities: drop: ["ALL"]
Why it's wrong here
Dropping all Linux capabilities removes privileged operations from the container's effective, permitted, and inheritable capability sets. This is a recommended security hardening measure because it limits the container's ability to perform kernel-level operations even if an attacker gains code execution inside the container. It does not grant any host access; rather, it reduces the container's attack surface by ensuring it runs with the least privilege necessary.
- ✗
readOnlyRootFilesystem: true
Why it's wrong here
Setting the container's root filesystem to read-only prevents the container from writing to its own root filesystem, which blocks an attacker from modifying system binaries, libraries, or configuration files within the container. This is a defense-in-depth measure that restricts the impact of a compromise: even if an attacker achieves code execution, they cannot persist changes or plant malicious executables in the container's root layer. It does not expose any host resources; it actually reduces the container's capabilities to interact with the host.
- ✗
resources: limits: memory: "512Mi"
Why it's wrong here
Defining a memory limit constrains the container to a maximum of 512 Mebibytes of memory, mitigating the risk of memory exhaustion that could cause a denial-of-service on the shared host kernel. This is a standard resource management practice that prevents a single container from consuming all available memory and destabilizing the node. It has no bearing on host access; it is a limit on the container's resource consumption, not a privilege or namespace sharing setting.
Go deeper
Related to this question
About these practice questions
This CKS question is part of Courseiva's 845-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.