CertLumen

Certified Kubernetes Application Developer (CKAD) · Section 4 · 25% of the exam

Understand Application Security (SecurityContexts, Capabilities, etc.)

One of the objectives of the Certified Kubernetes Application Developer (CKAD) exam, in the section “Application Environment, Configuration and Security”. Here is what it covers, the points to remember and a question to try.

What it covers

A security context controls the user, group, privileges and Linux capabilities of Pods and containers. This lesson covers the pod-level and container-level fields, dropping capabilities, read-only root filesystems, seccomp and AppArmor, and how Pod Security Admission enforces the Pod Security Standards per namespace.

Points to remember

  • Security context fields exist at Pod level (spec.securityContext) and container level; the container value wins.
  • Container-only fields: capabilities, privileged, allowPrivilegeEscalation, readOnlyRootFilesystem. Pod-only: fsGroup, supplementalGroups.
  • runAsNonRoot: true fails the container when the effective user is root; pair it with a numeric runAsUser.
  • Drop ALL capabilities and add back only what is needed (for example NET_BIND_SERVICE); names are written without the CAP_ prefix.
  • allowPrivilegeEscalation defaults to true; set false to block setuid-style escalation; it conflicts with privileged: true.

Try a question

A team migrating a legacy cluster configuration finds a PodSecurityPolicy manifest used to forbid privileged containers. They are moving to Kubernetes v1.37. What should they use instead?

  1. AKeep the PodSecurityPolicy objects and enable the PodSecurityPolicy admission plugin on the API server
  2. BNetworkPolicy objects that block privileged ports
  3. CA ResourceQuota with privileged: 0
  4. DPod Security Admission with namespace labels, plus ValidatingAdmissionPolicy for custom checks
Show the answer

D. PSP was deprecated in v1.21 and removed in v1.25. The exam-relevant replacement is Pod Security Admission configured with pod-security.kubernetes.io/* labels.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Security Contexts, Capabilities and Pod Security teaches this objective (about 50 minutes), and 13 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 24 objectives · Next objective →