Pod Security Standards (Privileged, Baseline, Restricted) & Pod Security Admission (PSA)
Enforce Privileged/Baseline/Restricted profiles with Pod Security Admission.
In plain words
Pod Security profiles are building codes: Restricted is the strict default, Baseline catches obvious hazards, and Privileged leaves the door open. The simple Kubernetes rule is: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
Think of it like…
Pod Security profiles are building codes: Restricted is the strict default, Baseline catches obvious hazards, and Privileged leaves the door open.
Where you’ve seen it
During an access review, the security engineer runs kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite. Expected evidence: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels. If the run instead shows this symptom, stop and restore the last known state: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected.
Words you’ll hear
- PSS
- For this lesson, PSS is the controlling idea: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
- PSA
- PSA is the checkpoint; run
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwriteand inspect the owner chain. Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected. - Restricted
- Restricted is the outcome to preserve; the cost is explicit: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility.
- Verification evidence
- The evidence command is
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite. It connects the declaration to this behavior: Enforce Privileged/Baseline/Restricted profiles with Pod Security Admission.
Visual diagram
Theory & deep dive
How PSS reaches the intended state
Enforce Privileged/Baseline/Restricted profiles with Pod Security Admission. Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
The concrete checkpoint is kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite; compare the PSS owner, PSA state, and Restricted outcome instead of treating YAML acceptance as proof.
Run kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite after the change and correlate the result with Events and the owning object. Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
PSA: failure boundary and production cost
Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected. The prerequisite contract is concrete: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility. A safe design limits blast radius, records the last good configuration, and uses kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite as a deterministic rollback checkpoint.
Capture the current state with kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected.
How it works, step by step
Step 1 of 41. Model the trust boundary
Name the identity, action, resource, and trust boundary before choosing a control: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
- Goal
- Enforce Privileged/Baseline/Restricted profiles with Pod Security Admission.
- Owner
- PSS
When to use it & trade-offs
What it is
Enforce Privileged/Baseline/Restricted profiles with Pod Security Admission. Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
Why it matters: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected. The invariant at risk is specific: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels. The quickest fact check before changing the design is kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite.
When to reach for it
- Use PSS to enforce this invariant: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
- Use PSA evidence from
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwritein reviews and incident timelines. Enforce Privileged/Baseline/Restricted profiles with Pod Security Admission. - Choose the hosted security service route only when this cost is justified by governance or scale: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility.
When to avoid or be careful
- Avoid assuming PSS is complete after YAML submission; the required behavior is concrete: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwritefirst: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected. - Avoid adopting a heavier platform wrapper before measuring its cost: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility.
Native, manual, and managed paths for PSS
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite.Strengths: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
Watch out: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility. Recovery must also recognize this signal: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected.
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite; the expected invariant is: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.Strengths: kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike PSS, it does not make this symptom self-documenting: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected.
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
Watch out: The added platform ownership buys value at this cost: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
- Trace PSS to Restricted through PSA; the invariant is: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
- Recognize the symptom: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected.
- Justify the cost: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility.
- Verify with kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite instead of only inspecting YAML.
Benchmarks & rules of thumb
- 3
- profiles: Privileged, Baseline, and Restricted
- 3
- namespace policy modes: enforce, audit, and warn
- 1
- profile version should be pinned deliberately
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the PSS owner contract: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels.
- Ignoring this telltale condition leads to unrelated changes: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected.
- Repeating
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwritewithout an owner for remediation wastes retry cost. PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels?
- Which owner object, logs, and Events would you inspect for this symptom-Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected-?
- At what threshold would this cost become unacceptable: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility?
kubectl get ns --show-labels; kubectl label ns prod pod-security.kubernetes.io/enforce=restricted --overwrite, name the failure, then justify the cost. Invariant: Pod Security Standards define Privileged, Baseline, and Restricted profiles, and Pod Security Admission enforces, audits, or warns through namespace labels. Failure: Setting only enforce can miss future violations that warn in CI, and an older Pod created before a new namespace policy may remain even after new workloads are rejected. Cost: PSA provides a built-in admission baseline, but exceptions for privileged agents require explicit namespaces, policy versions, and migration visibility.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Pod Security Standards (Privileged, Baseline, Restricted) & Pod Security Admission (PSA) with generative AI interview Q&A and hands-on practice.