Kubernetes Pod Security Standards
Advancedv1.0.0
Implement Pod Security Standards (PSS) to enforce security baselines across namespaces — restrict privileged containers, host access, capabilities, and volume types.
Content
Overview
Pod Security Standards (PSS) define three security profiles — Privileged, Baseline, and Restricted — that control what pods can and cannot do. Since Kubernetes 1.25, Pod Security Admission (PSA) is the built-in enforcement mechanism replacing the deprecated PodSecurityPolicy.
Why This Matters
- -Prevent container escapes — restrict host namespace access and privileged mode
- -Compliance — SOC2, HIPAA, PCI-DSS require container security controls
- -Defense in depth — even if RBAC is misconfigured, PSS limits what pods can do
- -Cluster-wide baseline — consistent security across all namespaces
Security Profiles
Privileged (No restrictions)
Baseline (Prevent known privilege escalations)
Restricted (Hardened best practices)
Step 1: Enable PSA on Namespaces
Step 2: Configure Pods for Restricted Profile
Step 3: Apply to All Application Namespaces
Step 4: Handle Exceptions
Best Practices
- -Start with
warnmode to identify non-compliant workloads before enforcing - -Use
restrictedfor all application namespaces - -Only use
privilegedfor system namespaces (kube-system, monitoring agents) - -Always set
allowPrivilegeEscalation: falseand drop ALL capabilities - -Enable
readOnlyRootFilesystem: trueand mount tmpfs where writes are needed
Common Mistakes
- -Jumping straight to
enforcewithout auditing existing workloads - -Granting privileged profile to application namespaces "just to make it work"
- -Forgetting seccompProfile (required for restricted profile)
- -Not dropping ALL capabilities before adding back specific ones
FAQ
Discussion
Loading comments...