mediumMultiple SelectObjective-mapped
CAS-004 Is implementing container security controls Practice Question
A security engineer is implementing container security controls. Which TWO practices are most effective in preventing privilege escalation within a container? (Choose two.)
⚠ Common exam trap
The CAS-004 exam often tests the misconception that SELinux or AppArmor alone can prevent privilege escalation, but these tools enforce access control policies rather than removing the underlying capability to escalate; the trap is that candidates confuse mandatory access control with capability dropping, which directly removes the ability to perform privileged actions.
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
✓
Dropping all capabilities (CAP_DROP=ALL)
Dropping all capabilities with `CAP_DROP=ALL` removes all Linux capabilities from the container, effectively preventing any process inside from performing privileged operations such as changing user IDs, mounting filesystems, or accessing kernel features that could lead to privilege escalation. This is a fundamental container security best practice, as capabilities are the primary mechanism for granting fine-grained privileges to container processes.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Dropping all capabilities (CAP_DROP=ALL)
Why this is correct
Removing capabilities eliminates potential escalation via Linux capabilities.
- ✗
Enabling SELinux
Why it's wrong here
SELinux enforces mandatory access control but does not directly prevent privilege escalation within the container.
- ✗
Using host networking
Why it's wrong here
Host networking reduces isolation and can allow privilege escalation via network.
- ✗
Mounting /var/run/docker.sock
Why it's wrong here
Mounting the Docker socket gives full control over the host Docker daemon, enabling escalation.
- ✓
Setting USER to non-root in the Dockerfile
Why this is correct
Running as non-root prevents direct root access.
Go deeper
Related to this question
About these practice questions
This CAS-005 question is part of Courseiva's 968-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 CAS-005 practice question is part of Courseiva's free CompTIA 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 CAS-005 exam.