Security bash Intermediate

Trivy Container Scan in CI

Scan a Docker image for CVEs in CI and fail the build on critical vulnerabilities.

bash
#!/bin/bash
IMAGE=$1
trivy image \
  --exit-code 1 \
  --severity CRITICAL \
  --no-progress \
  --format table \
  $IMAGE

Prerequisites

  • trivy >= 0.50

Pro Tips

  • → Add --ignore-unfixed to suppress unfixed CVEs.
  • → Integrate in GitHub Actions after docker build step.

Was this module useful?

Share your experience — it helps the team improve.

Leave Feedback

Commercial Licensing

Acquire a production access token or template license for enterprise deployment.

Module Info

Language
bash
Level
Intermediate
Read time
3 min
Published
Dec 2025
License
Commercial License

Newsletter

New modules every week, directly to your inbox.