Skip to content

Grype

19 commands

Anchore’s vulnerability scanner for container images and filesystems; pairs naturally with Syft SBOMs.

  • vulnerability scanning
  • containers
  • SBOM

Install Grype

brew install grype

Scanning7

grype <image>

Scans a container image (pulled from a registry or the local Docker daemon) and lists vulnerable packages with severity and fixed versions.

Link
grype dir:<path>

Scans a directory on disk, such as a project with lock files.

Link
grype sbom:<file>

Scans an existing SBOM instead of the image — fast and repeatable.

Link
grype docker-archive:<file>

Scans an image saved with docker save.

Link
grype registry:<image>

Pulls directly from a registry without needing a Docker daemon.

Link
grype <image> --scope all-layers

Also reports packages removed in later layers but still present in the image.

Link
grype <image> --platform <os/arch>

Scans a specific platform variant of a multi-arch image.

Link

Filtering and CI4

grype <image> --only-fixed

Shows only vulnerabilities that already have a fix available — the actionable list.

Link
grype <image> --fail-on <severity>

Exits with status 1 if anything at or above the severity is found, failing a CI job.

Link
grype <image> --ignore-states <states>

Hides findings whose fix state you have accepted.

Link
grype <image> -c <config>

Uses a config file, for example with an ignore list of accepted CVEs.

Link

Output4

grype <image> -o json

Machine-readable JSON with full match details.

Link
grype <image> -o sarif

SARIF for GitHub code scanning and other tools.

Link
grype <image> -o cyclonedx

A CycloneDX document with vulnerability data.

Link
grype <image> -o template -t <file>

Renders a custom Go template, for example an HTML report.

Link

Database4

grype db status

Shows the vulnerability database version and when it was built.

Link
grype db update

Downloads the latest database.

grype db check

Reports whether a newer database is available.

Link
grype explain --id <cve> < <json>

Explains why a CVE matched and which packages it affects.

Link