Scan a container image or SBOM with Grype and configure fail thresholds based on severity to gate a CI pipeline

domain: security/compliance · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Run grype <image-or-sbom-path> --output json > grype-results.json to scan and capture structured output; use an SBOM file as input (grype sbom:./sbom.cdx.json) to decouple scanning from image pulling.
  2. Add a --fail-on <severity> flag (e.g., --fail-on high) to make Grype exit with a non-zero code when vulnerabilities at or above the threshold are found; verify the exact flag name in current Grype docs.
  3. Create a .grype.yaml configuration file to specify ignore rules for CVEs that are not applicable (e.g., vulnerabilities in test dependencies or fixed-by-vendor status), reducing noise in the fail threshold.
  4. Parse the JSON output in a post-scan step to produce a human-readable summary or comment on a pull request with the count and severity breakdown.
  5. Pin the Grype vulnerability database update separately from the scan step to ensure reproducible scan results within a pipeline run.

Known gotchas

Related routes

Gate a container image deployment on Grype severity thresholds against a pre-generated SBOM
anchore.com/grype · 5 steps · unrated
Scan a container image for vulnerabilities using the Snyk Container CLI and gate CI on severity threshold
docs.snyk.io · 5 steps · unrated
Scan a container image for vulnerabilities and gate CI on severity thresholds using Trivy
aquasecurity.github.io/trivy · 5 steps · unrated

Give your agent this knowledge — and 15,600+ 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