How do you enforce seccomp and AppArmor profiles across workloads?
AdvancedScenarioKubernetes Security
Answer
Situation read → Containers run unconfined by default on many setups. RuntimeDefault seccomp blocks a large set of dangerous syscalls with little breakage.
What I'd do →
- Set
seccompProfile: { type: RuntimeDefault }in podsecurityContext; PSArestrictedrequires it. - Enable kubelet
--seccomp-defaultso pods without a profile still getRuntimeDefault. - For high-risk apps, generate custom profiles with Security Profiles Operator recording mode.
- AppArmor: use the
appArmorProfilefield (GA in 1.30) withRuntimeDefaultor a custom loaded profile.
Why → Syscall filtering cuts the kernel attack surface that container escapes depend on.
Interview tip → Mention the seccomp-default kubelet flag; few candidates know it.
More on Kubernetes Security
What are the 4Cs of cloud native security?BeginnerWhat happens to a request between `kubectl apply` and etcd from a security point of view?IntermediateExplain Role, ClusterRole, RoleBinding and ClusterRoleBinding.BeginnerHow do you check what a user or service account is allowed to do?BeginnerWhich RBAC permissions are effectively cluster-admin in disguise?AdvancedHow do service account tokens work now, and what is `automountServiceAccountToken`?Intermediate