CKS System Hardening Practice Question
A pod is configured with a custom seccomp profile stored at /var/lib/kubelet/seccomp/custom-profile.json. The pod manifest uses securityContext.seccompProfile with type: Localhost and localhostProfile: "custom-profile.json". The pod fails to start with an error 'seccomp profile not found'. What is the most likely cause?
⚠ Common exam trap
CNCF often tests the misconception that `localhostProfile` requires an absolute path, but in reality it is a relative path from the kubelet's seccomp directory, and the error 'not found' points to a missing file, not a path format issue.
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
✓
The custom-profile.json file is not present on the node filesystem.
The error 'seccomp profile not found' indicates that the Kubernetes kubelet cannot locate the specified profile file on the node's filesystem. When using `type: Localhost`, the `localhostProfile` value is resolved relative to the kubelet's seccomp profile root directory (default `/var/lib/kubelet/seccomp`). If the file `custom-profile.json` does not exist at that path on the node, the pod will fail to start.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The securityContext.seccompProfile.defaultRuntimeProfile field must be set to 'custom-profile.json'.
Why it's wrong here
The seccompProfile API defines only `type` and `localhostProfile` as configurable fields; `defaultRuntimeProfile` does not exist. A custom JSON profile is attached by setting `type: Localhost` and specifying `localhostProfile: custom-profile.json`. Setting a nonexistent field would be rejected by API validation or ignored, not load the file.
- ✗
The seccomp profile should be defined in the pod's annotations, not securityContext.
Why it's wrong here
Kubernetes originally supported seccomp via pod annotations, such as `seccomp.security.alpha.kubernetes.io/pod`, but these were deprecated in favor of the native `securityContext.seccompProfile` field. In current releases, annotations are no longer honored for seccomp, so placing the profile reference there would have no effect. The correct declarative approach is to set `securityContext.seccompProfile.localhostProfile` and `type: Localhost`.
- ✓
The custom-profile.json file is not present on the node filesystem.
Why this is correct
A missing localhost profile file prevents the container runtime from initializing the container. When `type: Localhost` is used, the kubelet resolves `localhostProfile` against the node's seccomp profile root and sends the path to the runtime; if the file is not present, the container creation fails with a file-not-found error and the pod never reaches Running. Always verify that the profile file exists on every worker node that may schedule the pod.
- ✗
The localhostProfile field must be an absolute path.
Why it's wrong here
The `localhostProfile` field must not be specified as an absolute path; it is interpreted relative to the node's seccomp profile root (usually `/var/lib/kubelet/seccomp`). For example, `custom-profile.json` resolves to `/var/lib/kubelet/seccomp/custom-profile.json`. Using an absolute path like `/var/lib/kubelet/seccomp/custom-profile.json` would cause the kubelet to concatenate it incorrectly, so the file would not be found.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKS question from scratch — 845 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.