Interview Prep/DevSecOps/Kubernetes admission control and Pod Security

Kyverno `PolicyReport` shows 400 `fail` results, but nothing was blocked

BeginnerTroubleshootingKubernetes admission control and Pod Security
Answer

Likely causes → Policies run with validationFailureAction: Audit (or failureAction: Audit in newer versions), and background scans report existing violations.

Diagnose →

kubectl get policyreport -A
kubectl get policyreport -n prod -o json | jq -r '.results[] | select(.result=="fail") | "\(.policy) \(.resources[0].name)"' | sort | uniq -c

Fix → That is expected in audit. Use the reports to drive fixes per team, then switch to Enforce.

Prevent → Publish policy reports to a dashboard (Policy Reporter) so teams see their own debt.

All DevSecOps questions Roadmap: Policy as code

More on Kubernetes admission control and Pod Security