Bird
0
0

A cluster admin set pod-security.kubernetes.io/enforce=baseline on a namespace, but pods with hostPath volumes are still allowed. What should be checked to fix this?

medium📝 Troubleshoot Q7 of 15
Kubernetes - RBAC and Security
A cluster admin set pod-security.kubernetes.io/enforce=baseline on a namespace, but pods with hostPath volumes are still allowed. What should be checked to fix this?
AAdd a network policy to block hostPath volumes.
BChange the label to enforce=restricted instead of baseline.
CRemove the label to disable pod security enforcement.
DVerify if the Pod Security Admission Controller webhook is properly configured.
Step-by-Step Solution
Solution:
  1. Step 1: Understand baseline profile restrictions

    Baseline profile allows hostPath volumes; the restricted profile forbids them.
  2. Step 2: To block hostPath volumes

    Change the label to enforce=restricted to apply the stricter policy.
  3. Final Answer:

    Change the label to enforce=restricted instead of baseline. -> Option B
  4. Quick Check:

    Restricted blocks hostPath; baseline allows [OK]
Quick Trick: Baseline allows hostPath; use restricted to block [OK]
Common Mistakes:
  • Confusing baseline with restricted profile
  • Checking webhook unnecessarily
  • Using network policy for volume restrictions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes