Interview Prep/Docker/Security and scanning

Add vulnerability scanning to CI so critical findings block the merge.

BeginnerScenarioSecurity and scanning
Answer

Situation read → Shift-left gating.

What I'd do →

trivy image --exit-code 1 --severity CRITICAL --ignore-unfixed app:$SHA
# or
grype app:$SHA --fail-on high
# or
docker scout cves --exit-code --only-severity critical,high app:$SHA

Also scan the Dockerfile with hadolint and IaC with trivy config.

Why → Exit code fails the pipeline; scheduled rescans catch newly disclosed CVEs.

Interview tip → A passing scan today does not mean safe tomorrow; rescan deployed images.

All Docker questions Roadmap: Docker & containers

More on Security and scanning