Interview Prep/DevSecOps/Container image and IaC scanning

Helm chart passes Checkov in the repo but fails in Kyverno at deploy time

AdvancedTroubleshootingContainer image and IaC scanning
Answer

Likely causes → Checkov scanned the chart with default values; production values files enable a sidecar, hostPath or a different securityContext.

Diagnose →

helm template app ./chart -f values-prod.yaml > rendered.yaml
checkov -f rendered.yaml --framework kubernetes
kyverno apply ./policies -r rendered.yaml

Fix → Scan rendered output for every environment's values file, and run the same Kyverno policies in CI with kyverno apply.

Prevent → One policy source used in both CI (shift-left) and admission (enforcement).

All DevSecOps questions

More on Container image and IaC scanning