Scan a container image with Trivy in a CI pipeline

domain: aquasecurity.github.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install Trivy in your CI environment using the official install script, package manager, or by pulling the aquasec/trivy Docker image; pin a specific version tag
  2. Run trivy image IMAGE_NAME:TAG to scan for OS package vulnerabilities, language-specific dependencies, and misconfigurations; use --severity HIGH,CRITICAL to limit output to actionable findings
  3. Add --exit-code 1 to fail the pipeline when vulnerabilities at or above the specified severity are detected; use --ignore-unfixed to skip vulnerabilities that have no available fix
  4. Output results in a machine-readable format with --format json or --format sarif and save to a file with --output results.json for downstream processing or dashboard upload
  5. For reproducible scans, download the Trivy vulnerability database to a local cache directory and use --skip-update in air-gapped pipelines or to avoid rate limiting on the GitHub advisory database
  6. Scan infrastructure-as-code files alongside images with trivy config . to detect misconfigured Kubernetes manifests, Dockerfiles, and Terraform files in the same pipeline step

Known gotchas

Related routes

Scan IaC and container images together using Trivy in a CI pipeline
aquasecurity.github.io/trivy · 6 steps · unrated
Scan a container image for vulnerabilities and gate CI on severity thresholds using Trivy
aquasecurity.github.io/trivy · 5 steps · unrated
Scan a container image for vulnerabilities and generate an SBOM simultaneously using Trivy, outputting results in CycloneDX format
aquasecurity.github.io/trivy · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans