Sample question 1 — System Hardening
A cluster runs on Ubuntu worker nodes with AppArmor enabled. A sensitive web service should be confined so it can read only its own data directory and cannot traverse into host paths, but the security team does not want to modify the container image. Which step applies the AppArmor confinement to the Pod?
- A. Add an apparmor label to the namespace so the Pod Security admission controller loads the profile for every Pod.
- B. Set the container's seccomp profile to the AppArmor profile name so the runtime enforces the file restrictions.
- C. Load an AppArmor profile on each node and set the container's container.apparmor.security.beta.kubernetes.io
- D. Install AppArmor inside the container and start the application under the profile within the image's entrypoint.
Answer: C. Option C is correct. AppArmor confinement requires loading a profile on the node and referencing it in the container's container.apparmor.security.beta.kubernetes.io annotation. Option A is incorrect because AppArmor is not selected by a namespace label, and Pod Security admission does not load AppArmor profiles. Option B is incorrect because seccomp and AppArmor are different mechanisms, and a seccomp profile cannot enforce AppArmor path rules. Option D is incorrect because installing AppArmor inside the container does not confine the container process to the host's profile.
