How do you scan Helm charts and Kubernetes manifests before deployment?
IntermediateScenarioContainer and IaC Security
Answer
Situation read → Misconfigurations like privileged pods and missing limits are easiest to catch before they hit the cluster.
What I'd do →
- Render the chart:
helm template myapp ./chart -f values-prod.yaml > rendered.yaml. - Scan:
trivy config rendered.yaml,kubesec scan, orcheckov -f rendered.yaml. - Validate schema with
kubeconform -strict. - Evaluate custom rules with conftest or Kyverno CLI (
kyverno apply policy.yaml --resource rendered.yaml). - Run on every PR and block on high severity.
Why → Scanning rendered output tests what is actually applied, not just templates.
Interview tip → Scan with the production values file; defaults can hide problems.
More on Container and IaC Security
A team asks whether to use `ubuntu`, `alpine` or a distroless base image. How do you advise?Beginner`trivy image` shows 300 vulnerabilities in your app image. How do you bring this down?BeginnerA Dockerfile runs the app as root. How do you fix it and prove the fix?IntermediateCheckov fails a Terraform PR because an S3 bucket allows public access. What do you change?BeginnerHow do you set up image scanning so nothing vulnerable reaches production?IntermediateAn image passed scanning three weeks ago and runs in production. A new critical CVE is published today. What happens next?Intermediate