Interview Prep/DevSecOps/Kubernetes Security

How does Pod Security Admission enforce those standards?

IntermediateConceptKubernetes Security
Answer

PSA is a built-in admission controller (GA in 1.25, replacing PodSecurityPolicy). You opt in per namespace with labels, choosing a level for each of three modes: enforce rejects pods, audit writes an audit annotation, warn returns a warning to the client.

kubectl label ns shop \
  pod-security.kubernetes.io/enforce=restricted \
  pod-security.kubernetes.io/enforce-version=latest \
  pod-security.kubernetes.io/warn=restricted

Rollout pattern: set warn and audit first, fix violations, then turn on enforce. PSA only checks pods, and it is not customisable; anything beyond the standards needs Kyverno, Gatekeeper or ValidatingAdmissionPolicy.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security