CKS System Hardening Practice Question
Which TWO of the following are valid methods to apply a seccomp profile to a pod in Kubernetes?
⚠ Common exam trap
CNCF often tests the distinction between deprecated/removed features (like PodSecurityPolicy) and current stable APIs, and the trap here is that candidates confuse the old annotation-based approach (`seccomp.security.alpha.kubernetes.io/pod`) with the modern `securityContext.seccompProfile.type` field, or mistake AppArmor annotations for seccomp annotations.
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
✓
Setting 'securityContext.seccompProfile.type' in the pod spec
The `securityContext.seccompProfile.type` field in the pod spec is the current, stable method to apply a seccomp profile to a pod in Kubernetes (since v1.19). This field directly specifies the seccomp profile type (e.g., `RuntimeDefault`, `Localhost`, or `Unconfined`) at the container or pod level, and is the recommended approach in modern clusters.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Setting 'securityContext.seccompProfile.type' in the pod spec
Why this is correct
This is the current recommended way.
- ✗
Adding annotation 'container.apparmor.security.beta.kubernetes.io/<container>'
Why it's wrong here
This is for AppArmor, not seccomp.
- ✗
Including 'seccomp' profile in PodSecurityPolicy
Why it's wrong here
PodSecurityPolicy is deprecated and removed in v1.25.
- ✗
Including 'seccompProfile' under 'spec.securityContext' at the pod level
Why it's wrong here
seccompProfile is a container-level field, not pod-level.
- ✓
Adding annotation 'seccomp.security.alpha.kubernetes.io/pod'
Why this is correct
This is the older alpha annotation method.
Go deeper
Related to this question
About these practice questions
One of 114 original CKS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.