During a security audit, a team discovers that their microservice application, deployed on Kubernetes, is vulnerable to container breakout attacks. The containers run as root and have many Linux capabilities. Which set of Pod Security Standards (PSS) enforcement modes and policies would best mitigate this risk?
Trap 1: Use 'privileged' PSS with Warn mode
Privileged profile disables all Pod Security Standard restrictions, permitting privileged containers, host namespaces, and all Linux capabilities, which maximizes the risk of container breakout. Adding Warn mode does not change this behavior because warning merely adds an admission annotation and does not block or reject the pod, so a compromised container can still leverage root privileges and elevated capabilities to escape.
Trap 2: Use 'baseline' PSS with Audit mode
Baseline profile (non-privileged) does prevent privileged containers and host namespace sharing, but it still allows running as root and keeps default capabilities like CHOWN and SETUID, which are often enough for a breakout. Audit mode is purely reactive: it only logs policy violations and never intercepts them, so pods that violate baseline are admitted and execute with the same dangerous root context, meaning the audit log is of no help during an active attack.
Trap 3: Use 'baseline' PSS with Enforce mode
Baseline with Enforce mode does force every pod to comply with the baseline standard, but baseline still allows root user execution and default capability sets. Even with enforcement, a root-running pod can install kernel modules, modify host files if volumes are mounted, or use standard tools like mount/nsenter to break out, so the enforcement is meaningless if the policy itself is too permissive for the threat model.
- A
Use 'privileged' PSS with Warn mode
Why wrong: Privileged profile disables all Pod Security Standard restrictions, permitting privileged containers, host namespaces, and all Linux capabilities, which maximizes the risk of container breakout. Adding Warn mode does not change this behavior because warning merely adds an admission annotation and does not block or reject the pod, so a compromised container can still leverage root privileges and elevated capabilities to escape.
- B
Use 'baseline' PSS with Audit mode
Why wrong: Baseline profile (non-privileged) does prevent privileged containers and host namespace sharing, but it still allows running as root and keeps default capabilities like CHOWN and SETUID, which are often enough for a breakout. Audit mode is purely reactive: it only logs policy violations and never intercepts them, so pods that violate baseline are admitted and execute with the same dangerous root context, meaning the audit log is of no help during an active attack.
- C
Use 'restricted' PSS with Enforce mode
Restricted profile in Enforce mode is the only combination among the choices that both selects the strongest pod-hardening policy and actually enforces it at admission time. Restricted requires runAsNonRoot=true, sets seccompProfile to RuntimeDefault, drops all capabilities except NET_BIND_SERVICE, and mandates a read-only root filesystem, which together deprive an attacker of the most common kernel exploits. Because Enforce mode rejects non-compliant pods before they are created, there is no opportunity for a restricted-violating pod to run and escape.
- D
Use 'baseline' PSS with Enforce mode
Why wrong: Baseline with Enforce mode does force every pod to comply with the baseline standard, but baseline still allows root user execution and default capability sets. Even with enforcement, a root-running pod can install kernel modules, modify host files if volumes are mounted, or use standard tools like mount/nsenter to break out, so the enforcement is meaningless if the policy itself is too permissive for the threat model.