CKAD Practice Question: Application Environment, Configuration and Security
Which TWO of the following are valid fields in a container's SecurityContext to restrict privilege escalation? (Select two.)
⚠ Common exam trap
CNCF often tests the distinction between fields that *prevent* privilege escalation versus fields that enforce other security constraints like filesystem immutability or user identity, leading candidates to confuse `readOnlyRootFilesystem` or `runAsNonRoot` with escalation control.
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
✓
allowPrivilegeEscalation
A is correct because `allowPrivilegeEscalation` directly controls whether a process can gain more privileges than its parent, such as via setuid binaries or file capabilities. Setting it to `false` prevents privilege escalation, which is a core security requirement for restricting container breakout.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
allowPrivilegeEscalation
Why this is correct
Setting this to false prevents privilege escalation.
- ✗
readOnlyRootFilesystem
Why it's wrong here
This prevents writes to the root filesystem but does not affect privilege escalation.
- ✗
runAsNonRoot
Why it's wrong here
This ensures the container does not run as root but does not prevent privilege escalation if the container runs as a non-root user.
- ✗
privileged
Why it's wrong here
'privileged' is a pod-level field, not inside securityContext.
- ✓
capabilities
Why this is correct
Dropping all capabilities and adding only necessary ones limits privilege escalation.
Go deeper
Related to this question
About these practice questions
This CKAD question is part of Courseiva's 160-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 CKAD 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 CKAD exam.