Lesson 4 of 13 · 11m
Pod Security Standards Are the Admission Floor
PSA's privileged, baseline, and restricted levels, the enforce-audit-warn modes on namespace labels, and why existing pods keep their violations.
The guardrail is a namespace label
Pod Security Admission is a built-in admission plugin — beta in 1.23, GA in 1.25, the same release that removed PodSecurityPolicy entirely after four years of deprecation pain. It applies one of three Pod Security Standards to every pod create/update in a namespace:
- privileged: nothing blocked. For
kube-system, CNI agents,kube-proxy— the parts that must be root-adjacent. - baseline: the "don't be obviously hostile" floor. Blocks
hostNetwork/hostPID/hostIPC,hostPathvolumes,privileged: true,hostPort, adding capabilities beyond the baseline set (NET_BIND_SERVICEsurvives), unsafe sysctls, unmasked/proc, non-default seccomp/AppArmor/SELinux settings. - restricted: baseline plus the hardened profile —
runAsNonRoot, capabilitiesdrop: ["ALL"]with at mostNET_BIND_SERVICEre-added, seccomp required (RuntimeDefaultorLocalhost), no privilege escalation, and volumes limited toconfigMap,downwardAPI,emptyDir,ephemeral,persistentVolumeClaim,projected,secret.
You attach levels to namespaces, not clusters:
metadata:
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restrictedenforce rejects violators at admission. audit logs violations as pod-security.kubernetes.io/audit-violations annotations on the request's audit.k8s.io Event in the API server audit log — not on the pod object. warn returns a client-visible warning (kubectl prints it). enforce-version: v1.32 pins the standard to a Kubernetes minor version instead of latest, so the rules don't shift under you on an API server upgrade.
Violations surface as admission errors naming the exact rules broken:
Error from server (Forbidden): pods "web" is forbidden: violates PodSecurity
"restricted:v1.32": runAsNonRoot != true, allowPrivilegeEscalation != false,
unrestricted capabilities, seccompProfileThat message is the policy's diff — it tells you which fields to add, not just that it failed. enforce-version deserves attention here: restricted:latest tracks the API server's minor version, so pinning pod-security.kubernetes.io/enforce-version: v1.32 keeps the rule set stable while the cluster upgrades under you.
The wrong model: retroactive protection
The failure pattern: someone labels a running namespace enforce: restricted, sees existing pods still running, and declares the cluster hardened. Wrong. PSA is admission control — it fires on pod create and update. Pods that already exist keep running their violations until they are recreated, restarted, or rescheduled. A Deployment's pods only change when something touches the pod spec.
That is exactly why the audit mode exists. The correct rollout order:
audit+warnat your target level on the namespace.- Read the violations out of the API server audit log — the annotation lands on the audit.k8s.io Event there, so
kubectl get podswill never show them — and fix the workloads. - Flip
enforceon.
Skipping step 2 gives you a deploy outage instead of a migration.
Exemptions and the honest edge cases
Cluster-level exemptions live in the admission-control config file (--admission-control-config-file on the API server) under PodSecurity — you can exempt specific namespaces, usernames, or runtimeClasses. kube-system is the canonical exemption case: kube-proxy needs host networking and elevated caps to program iptables. Don't force kube-system into restricted; label it privileged and treat it as infrastructure.
There's a subtler exemption too: pods exempted by runtimeClasses in the config. And one scope point people miss — PSA evaluates the pod spec being submitted, not the pod's runtime behavior. A pod can pass restricted cleanly and still run hostile code; the standard bounds what the spec may grant, not what the container may attempt. That gap is the dataplane's problem — seccomp, network policy, runtime detection.
What PSA does not cover, because it was never meant to: the node's own filesystem outside the pod spec, service-account token mounting, network reachability, or the content of container images. It bounds the pod spec's privileges. The rest is the next lessons' job.
What to actually do
Label every namespace. enforce: baseline is the floor for anything that isn't infrastructure — hostPath and privileged have no business in an application namespace. restricted for workloads you control the images of. Then add the audit-mode labels one level up (audit: restricted while you enforce: baseline) so the path to hardening is always measured, never guessed.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
A 257-Byte Password Is the Key: Inside the OpenSSH musl Bypass
CVE-2026-123158 lets an attacker log into a locked account on musl-based systems like Alpine by sending a password nobody set. The trigger is one number, 257, and the reason is a C library returning a single asterisk. I reproduced the exact boundary against musl 1.2.4 and read the fix.
Immich Had Fourteen Advisories and One Bug It Fixed Three Times
Immich's 2026 security record runs to fourteen advisories, and they cluster hard: the sharing features, the OAuth plumbing, and one login redirect parameter that took three separate fixes across eighty-three days. Plus the 3.0 migration traps still waiting for anyone who hasn't jumped yet.
Jellyfin's Threat Model Is Your Brother-in-Law
Four Jellyfin CVEs landed in 2026 and not one of them needs an admin account. One needs only the ability to name a file. Meanwhile Jellyfin 12 shipped in September, the version numbers stopped starting with 10, and every "am I patched" check you wrote is now wrong.
Node.js Fixed 16 Flaws in One Release. Most of Them Live in HTTP/2 and TLS.
The November 11 Node.js security releases fix 16 CVEs across the 26, 24 and 22 lines, seven of them rated high. Nearly all sit in HTTP/2 and TLS, where a remote client can crash a server, leak memory, or get past per-host client-certificate checks.