Kubernetes Pod Security Standards (Restricted): Complete Checklist
The six securityContext fields required by Kubernetes Restricted PSS and how to satisfy them without breaking containers.
The six mandatory Restricted PSS controls
Since PodSecurityPolicy was removed in Kubernetes 1.25, built-in Pod Security Admission enforces three profiles: Privileged, Baseline, and Restricted. To pass the Restricted profile without admission errors, every container and initContainer must enforce: (1) allowPrivilegeEscalation: false, (2) capabilities.drop: ["ALL"] (with NET_BIND_SERVICE as the only optional add), (3) runAsNonRoot: true (and non-zero runAsUser if the image defaults to root), (4) seccompProfile.type: RuntimeDefault or Localhost, (5) no privileged: true or host namespaces (hostPID/hostIPC/hostNetwork), and (6) no hostPath volume mounts.
Handling readOnlyRootFilesystem without runtime crashes
While not strictly mandated by PSS Restricted, setting readOnlyRootFilesystem: true is one of the highest-ROI container hardening wins because it blocks attackers from dropping binaries or patching scripts at runtime. Applications that write temporary files, PID files, or caches simply mount memory-backed or size-limited emptyDir volumes at /tmp or /var/cache while leaving the rest of the filesystem immutable.