Pod Security Standards and Policies
You'll learn how Kubernetes restricts dangerous container configurations through Pod Security Standards and the deprecated Pod Security Policies.
What Are Pod Security Standards?
In Kubernetes, pods can request powerful privileges—like host network access, privileged containers, or dangerous Linux capabilities—that attackers love to exploit. Pod Security Standards (PSS) are three predefined security profiles that define what pod configurations are allowed:
- Privileged: No restrictions (wide open)
- Baseline: Blocks the most dangerous settings while allowing common use cases
- Restricted: Heavily locked down, suitable for security-critical workloads
Think of these like airport security levels: "Privileged" is no screening, "Baseline" is standard TSA checks, and "Restricted" is enhanced screening with strict rules.
How They Work
PSS operates through admission control at the namespace level. You label a namespace with a policy mode:
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restricted
Now any pod attempting to run in production must comply with the restricted standard—no privileged containers, no host paths, limited capabilities, etc. Violations are blocked (enforce), logged (audit), or warned (warn).
Pod Security Policies (Deprecated)
Before PSS, Kubernetes used Pod Security Policies (PSP)—cluster-wide objects that RBAC controlled. PSPs were powerful but complex, with confusing authorization chains. They were deprecated in Kubernetes 1.21 and removed in 1.25. If you encounter them in legacy clusters, migrate to Pod Security Standards.
Key Takeaway: Pod Security Standards provide three graduated security profiles (privileged, baseline, restricted) enforced at the namespace level to prevent dangerous pod configurations—they replace the deprecated Pod Security Policies with a simpler, more maintainable approach.