More Info:
Verifies each namespace is labeled with pod-security.kubernetes.io/enforce set to baseline or restricted so the built-in Pod Security Admission controller rejects unsafe pods.Risk Level
HighAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify noncompliant namespaces (run on any machine with kubectl access):
-
Choose the desired enforcement level for each namespace:
- Use
baselineto allow most workloads while blocking known unsafe patterns. - Use
restrictedfor the strongest isolation where workloads can comply.
- Use
-
Label a single namespace to enforce
baseline(run on any machine with kubectl access): -
Or label a single namespace to enforce
restricted: -
Optionally label multiple namespaces at once (example with baseline):
-
Verify compliance (run on any machine with kubectl access):
Confirm that all relevant namespaces show
enforce=baselineorenforce=restrictedandis_compliant=true.
Using kubectl
Using kubectl
On any machine with kubectl access:For many namespaces at once:
- Identify noncompliant namespaces
- Label each target namespace to enforce
baseline(adjust names as needed; userestrictedinstead if you choose that policy):
- Verification
Automation
Automation

