CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Security Specialist

AppArmor and seccomp Profiles for Pods

The largest piece of genuinely new ground between KCSA and CKS. This guide writes an AppArmor profile, loads it on a node, confines a Pod with it and proves the difference against an identical Pod - then does the same for seccomp, including how to check a running container rather than trusting its manifest.

System Hardening Guide 17 of 40 Advanced

AppArmor is configured through securityContext.appArmorProfile since 1.30; the old container.apparmor.security.beta.kubernetes.io annotation is deprecated. Both profiles must exist on every node the Pod might be scheduled to.

The cka7001 cluster: one control plane and 1 schedulable worker, on Cilium.
Server NameIP AddressOSRolesCPURAMHDD
CKA7001192.168.0.51Ubuntu 26.04 LTSControl Plane Node (tainted NoSchedule)2 Core4 GB50 GB
CKA7001-NODE01192.168.0.52Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

This guide includes

Use this because it is the largest piece of genuinely new ground between KCSA and CKS. This matters because both controls are enforced by the kernel rather than by Kubernetes - the profile has to exist on the node before any Pod can name it.

Before you start

  1. What the node already enforces

  2. Write a profile and load it

  3. Confine a Pod with it

  4. The other kernel control, and how to see it

  5. A seccomp profile of your own

Official sources