DevOpsintermediate

Trivy vs Grype

Trivy vs Grype compared for 2026: Trivy 0.76 as an all-in-one scanner for vulnerabilities, IaC misconfigurations, secrets, licences, SBOMs and Kubernetes vs Grype 0.122 as a focused vulnerability matcher built on Syft SBOMs with EPSS, KEV and risk sorting, OpenVEX and an explicit DB age check. Includes an offline test we ran, database and network behaviour, the March 2026 Trivy supply-chain incident, output formats, binary sizes and a clear pick per situation.

Quick Answer

Trivy and Grype are both Apache-2.0 command-line scanners that find known CVEs in container images, filesystems and SBOMs, and both run in CI with no server. The difference is scope. Trivy (Aqua Security, 0.76.2 on 5 November 2026) is a Swiss army knife: one binary scans images, filesystems, remote Git repos, VM images and live Kubernetes clusters for vulnerabilities, IaC misconfigurations (Dockerfile, Terraform, CloudFormation, Kubernetes, Helm, ARM, Ansible), secrets and licences, and writes CycloneDX or SPDX SBOMs. Grype (Anchore, 0.122.0 on 16 November 2026) does one job: match packages that its sibling Syft catalogs against Anchore's vulnerability database, then rank findings by EPSS, CISA KEV and a risk score, filter them with OpenVEX, and refuse a database older than 120 hours by default. In our offline test Trivy 0.76.2 found 5 Dockerfile, 11 Terraform and 1 secret finding in about 1.2 seconds using its embedded checks, while Grype could not scan at all without downloading its DB. Pick Trivy if you want one tool for the whole pipeline; pick Grype (with Syft) if you want a sharp SBOM-first vulnerability gate and already cover IaC and secrets elsewhere.

Last updated November 17, 2026. Covers Trivy 0.76.2 (5 November 2026) with the current docs (coverage, databases, cache, air-gap, client/server, VEX, SBOM, misconfiguration, secret, licence, Kubernetes, telemetry, signature verification, Aqua comparison) and advisory GHSA-69fq-xp46-6x23, against Grype 0.122.0 (16 November 2026) and Syft 1.57.2 with Anchore's OSS docs (installation, CLI, configuration, architecture, data sources, grype-db architecture, DB v5 EOL) and Anchore pricing page, all read on 17 November 2026, plus an offline scan we ran the same day.

Feature comparison of Trivy vs Grype
FeatureTrivyGrype
Licence & Maintainer
Apache-2.0; maintained by Aqua Security
Apache-2.0; sponsored by Anchore
What It Scans For
Vulnerabilities, IaC misconfigurations, secrets, licences, SBOM
Vulnerabilities only (SBOMs via Syft)
Scan Targets
Container image, filesystem, rootfs, remote Git repo, VM image, Kubernetes cluster, SBOM
Registry, Docker, Podman, OCI dir/archive, Singularity, containers-storage, directory, SBOM, PURL, CPE
OS Package Coverage
Alpine 2.2-3.22 and edge, Wolfi, Chainguard, RHEL 6-9 (10 SBOM only), Alma, Rocky, Oracle, Amazon Linux 1/2/2023, Azure Linux, SUSE, Photon, Debian, Ubuntu and more
Alpine, Wolfi, Chainguard, MinimOS, Debian, Ubuntu, ECHO, RHEL, Alma, Oracle, Amazon Linux, Azure Linux/Mariner, SUSE
Language Ecosystems
Ruby, Python (incl. uv.lock, poetry.lock), Node.js, Go, Rust, Java, .NET, PHP, Dart, Elixir, Swift, C/C++, Julia
.NET, Go, Java, JavaScript, Python, Ruby, Rust, GitHub Actions (GHSA), plus NVD/CPE matching; Bitnami packages
IaC & Misconfiguration
Yes: Dockerfile, Terraform, CloudFormation, Kubernetes, Helm, ARM, Ansible; custom Rego checks
No
Secret Detection
Yes, built-in rules (runs client-side)
No (Anchore Enterprise has container secret scanning)
Licence Scanning
Yes, classified Forbidden/Restricted/Reciprocal/etc. per Google's licence classification
No (Anchore's separate Grant tool covers licences)
SBOM Generation
CycloneDX JSON and SPDX (no CycloneDX XML)
Via Syft: CycloneDX, SPDX, Syft JSON
Scanning an Existing SBOM
Yes, scans CycloneDX and SPDX SBOMs
Yes: Syft JSON, CycloneDX, SPDX, also piped on stdin
Prioritisation Signals
Severity, fixed/unfixed status, ignore policies; advanced prioritisation is in Aqua's commercial product
EPSS, CISA KEV and risk score; sort-by package/severity/epss/risk/kev
VEX Support
Experimental: CycloneDX, OpenVEX, CSAF files, VEX repository, OCI attestations, SBOM references
OpenVEX documents to filter or augment results (--vex, vex-add)
Vulnerability Database
trivy-db, trivy-java-db and trivy-checks pulled as OCI artifacts (mirror.gcr.io, then ghcr.io)
SQLite DB (schema v6) from grype.anchore.io, built daily; cached in ~/.cache/grype/db
Offline / Air-gapped Use
--skip-db-update, --offline-scan, custom --db-repository mirrors; embedded IaC checks
grype db import of a downloaded archive; auto-update can be turned off
Output Formats
Table, JSON, SARIF, template, CycloneDX, SPDX, GitHub dependency snapshot
Table, JSON, CycloneDX (XML and JSON), SARIF, template
CI Gating
--exit-code with --severity, --ignore-unfixed, .trivyignore and policies
--fail-on severity, --only-fixed, ignore rules incl. VEX status
Kubernetes
trivy k8s (experimental) and Trivy Operator
No cluster scan; scan images individually or via Anchore Enterprise
Server / Shared Cache
Yes: trivy server with Redis or filesystem cache
No
Telemetry & Phone-home
Anonymous usage telemetry on by default; --disable-telemetry, plus --skip-version-check
Checks for new app and DB versions on launch (check-for-app-update, db auto-update); both configurable
Release Signing
Cosign keyless; sigstore bundles on every release asset since 0.68.1; GPG for RPM/DEB
Install script verifies signatures with cosign (-v); checksums published per release
Binary Size (linux-amd64)
176 MB binary (52.7 MB tar.gz) for 0.76.2
95 MB binary (32.7 MB tar.gz) for 0.122.0
Commercial Edition
Aqua platform: UI, registry scanning, RBAC/SSO, commercial feeds with SLA (price on request)
Anchore Enterprise: SBOM management, policy packs (NIST/CIS/FedRAMP/DoD), malware and secrets for containers (price on request)
Latest Release (Nov 2026)
0.76.2 (5 Nov 2026)
0.122.0 (16 Nov 2026); Syft 1.57.2

Trivy

Trivy is an open-source security scanner maintained by Aqua Security. It is organised as targets (container image, filesystem, remote Git repository, VM image, Kubernetes) and scanners (vulnerabilities, IaC misconfigurations, secrets, licences, plus SBOM generation), so one CLI covers most of what a pipeline needs to check before shipping. Aqua's commercial platform builds on it with a web UI, registry scanning, RBAC and commercial vulnerability feeds.

Pros

  • One binary covers CVEs, IaC misconfigurations, secrets, licences, SBOMs and Kubernetes cluster scans
  • Misconfiguration checks for Dockerfile, Terraform, CloudFormation, Kubernetes, Helm, Azure ARM and Ansible, with embedded checks as an offline fallback
  • Reads and writes CycloneDX and SPDX, and accepts VEX as CycloneDX, OpenVEX or CSAF documents plus a VEX repository
  • Client/server mode with a shared Redis cache, where secrets and misconfig scans stay on the client
  • Trivy Operator runs it continuously inside a cluster; official GitHub Action, VS Code extension and many CI guides
  • Largest community of the two: about 39,500 GitHub stars on 17 November 2026

Cons

  • In March 2026 attackers published a malicious v0.69.4 release and rewrote trivy-action and setup-trivy tags (GHSA-69fq-xp46-6x23); pin by digest or commit SHA
  • Databases come from public free registries (mirror.gcr.io, then ghcr.io) and can be rate limited under load; plan a mirror for big CI fleets
  • Large binary: 176 MB uncompressed for linux-amd64 0.76.2
  • VEX and Kubernetes scanning are still marked experimental in the docs
  • Sends anonymous usage telemetry by default; you must pass --disable-telemetry and --skip-version-check to stop all phone-home

Best For

Teams that want a single scanner in CI and on developer laptops for images, IaC, secrets, licences and SBOMs, and platform teams scanning Kubernetes clusters with Trivy Operator.

Grype

Grype is Anchore's open-source vulnerability scanner for container images, filesystems and SBOMs. It uses Syft (Anchore's SBOM generator, built in as a library) to catalog packages, matches them against the Grype vulnerability database built daily from distro feeds, GitHub Security Advisories and NVD, and ranks results with EPSS, CISA KEV and a risk score. Anchore Enterprise is the commercial platform around it.

Pros

  • Focused and composable: Syft produces the SBOM once, Grype re-scans it later in seconds without touching the image
  • Prioritisation built in: sort by EPSS, KEV or a combined risk score, not just severity
  • Explicit freshness guarantees: the DB is hash-checked on start and rejected if built more than 120 hours ago
  • Many inputs: registry, Docker, Podman, OCI dirs, Singularity, containers-storage, directories, SBOMs, PURLs and CPEs
  • Handy triage commands: grype explain for a CVE and grype db search by package, PURL or CPE
  • Fast release cadence: four releases between 2 and 16 November 2026

Cons

  • Vulnerabilities only: no IaC, secret or licence scanning in the open-source tool
  • Cannot scan anything without its database; we saw 'failed to load vulnerability db' with no network
  • No built-in server or shared cache mode for many clients
  • Releases older than 0.88.0 stopped getting DB updates on 6 March 2026 when schema v5 was retired
  • Smaller community than Trivy (about 13,300 GitHub stars on 17 November 2026)

Best For

Teams that build an SBOM per artifact and want a fast, well-prioritised vulnerability gate (EPSS/KEV) in CI, or that already run separate IaC and secret scanners and want each tool to do one thing.

Scope: an all-in-one scanner versus a focused matcher

Trivy's model is targets times scanners. The targets are container images, filesystems, rootfs, remote Git repositories, VM images and Kubernetes clusters; the scanners are vulnerabilities, misconfigurations, secrets and licences, and any target can also be written out as a CycloneDX or SPDX SBOM. Misconfiguration checks cover Dockerfile, Terraform, CloudFormation, Kubernetes manifests, Helm charts, Azure ARM templates and Ansible, and you can add custom Rego checks. That makes Trivy a reasonable replacement for three tools in a small pipeline. Grype deliberately does less. It turns its input into a package list using Syft, matches each package against the Grype database with ecosystem-, distro- and CPE-based matchers, and reports vulnerabilities. Everything else lives in sibling tools: Syft for SBOMs, Grant for licences, and Anchore Enterprise for secrets, malware and policy packs. The practical question is what else you already run. If you have Checkov or tfsec-style IaC checks and a dedicated secret scanner such as Gitleaks, Grype slots in as the CVE gate without overlapping. If you have nothing yet, Trivy gets you broad coverage on day one. Note that in Trivy's image, fs and repo commands the misconfig scanner is off by default; you enable it with --scanners vuln,misconfig,secret or use trivy config.

Databases, freshness and air-gapped operation

Neither tool ships its vulnerability data inside the binary. Trivy downloads three OCI artifacts: trivy-db for vulnerabilities, trivy-java-db for identifying JARs by hash, and trivy-checks for misconfiguration logic. By default it pulls from mirror.gcr.io/aquasec and falls back to ghcr.io/aquasecurity, and the docs warn that these are public free infrastructure that can rate limit under heavy load; the fix is --db-repository pointing at your own registry, which accepts several values and falls back on 429 or 5xx errors. If the checks bundle cannot be fetched, Trivy uses the checks embedded in the binary, which is exactly what happened in our sandboxed test. Grype downloads a single SQLite database (schema v6) from grype.anchore.io, built by a daily publisher job from sources including Alpine SecDB, Debian, Ubuntu, Red Hat, SUSE, Amazon Linux, Wolfi, Chainguard, GitHub Security Advisories and NVD. On start it validates the DB hash and, by default, refuses a database built more than 120 hours ago, and it checks for updates at most every two hours. For air-gapped networks you download the archive elsewhere and run grype db import. Schema matters too: Grype releases older than 0.88.0 stopped receiving data on 6 March 2026 when Anchore retired schema v5, so pinned old versions in CI fail quietly into stale results unless you upgrade.

Prioritisation, VEX and CI gating

Both tools gate a build on severity: Trivy with --exit-code and --severity, Grype with --fail-on, and both can ignore unfixed issues (Trivy --ignore-unfixed, Grype --only-fixed). Where they differ is what happens after the build fails. Grype ships exploit-likelihood signals in the open-source tool: results can be sorted by EPSS score, by presence in CISA's Known Exploited Vulnerabilities list or by a combined risk score, and grype explain prints the reasoning for a given CVE. Trivy's open-source triage is severity and fixed status plus ignore files and policies; Aqua's comparison page lists exploitability, reachability and contextual prioritisation as commercial features. For VEX, Trivy is broader on formats (CycloneDX, OpenVEX and CSAF documents, a VEX repository, OCI attestations and SBOM references) but labels the feature experimental. Grype reads OpenVEX and lets ignore rules match on VEX status and justification. Output formats are similar: both produce JSON, SARIF for GitHub code scanning, CycloneDX and Go templates; Trivy adds SPDX and a GitHub dependency snapshot, while Grype emits CycloneDX in XML as well as JSON. For a team drowning in criticals, Grype's EPSS and KEV sorting is the most useful single difference in this comparison.

Supply-chain safety and running them yourself

A scanner runs with access to your source, registry credentials and CI secrets, so its own supply chain matters. On 19 March 2026 an attacker used compromised credentials to publish a malicious Trivy v0.69.4 and force-push 76 of 77 tags of aquasecurity/trivy-action and all 7 tags of setup-trivy to credential-stealing code; on 22 March malicious v0.69.5 and v0.69.6 images appeared on Docker Hub. Aqua's advisory (GHSA-69fq-xp46-6x23) lists exposure windows of roughly 3 to 12 hours and says images referenced by digest, binaries built from source and the official Homebrew formula were not affected. The lesson applies to both tools: pin versions, pin images by digest and actions by commit SHA, and verify signatures. Trivy release assets carry sigstore bundles since 0.68.1 and images are cosign-signed; Grype's install script verifies with cosign when you pass -v, and both publish checksums, which we verified for the binaries we ran. Grype has had its own advisory, GHSA-6gxw-85q2-q646 (high, November 2025), about credential disclosure in JSON output. Operationally, Trivy can run as a server with a Redis cache shared by many clients, keeping secret and misconfig scanning on the client; Grype has no server mode. Trivy also sends anonymous usage telemetry by default.

Worked example: one project, both tools, no network to the databases

On 17 November 2026 we downloaded Trivy 0.76.2, Grype 0.122.0 and Syft 1.57.2 for linux-amd64 from GitHub Releases, checked each archive against the published SHA-256 checksums, and ran them in a sandbox that could not reach mirror.gcr.io, ghcr.io or grype.anchore.io. The test project had a package-lock.json for express 4.17.1, lodash 4.17.20 and jsonwebtoken 8.5.1 (65 dependencies), a Dockerfile based on node:18 with ADD, EXPOSE 22 and no USER, a Terraform file with an S3 bucket and an SSH security group open to 0.0.0.0/0, and an .env file holding a fake GitHub token. trivy fs --scanners misconfig,secret --skip-check-update finished in 1.19 seconds: Dockerfile 27 checks with 5 failures (DS-0002 no non-root USER, DS-0004 port 22, DS-0005 ADD instead of COPY, DS-0026 no HEALTHCHECK, DS-0029 missing --no-install-recommends), Terraform 11 failures including AWS-0107 unrestricted ingress and four public-access-block findings, and one CRITICAL github-pat secret, all from embedded checks. trivy fs --format cyclonedx listed 65 libraries; syft dir:. listed 66 libraries plus file entries in 1.7 seconds. grype sbom: on Syft's output stopped with 'failed to load vulnerability db: database does not exist', so plan DB access or grype db import before relying on Grype in a locked-down runner.

Verdict

Pick Trivy when you want one scanner to cover the whole build: container CVEs, Terraform and Kubernetes misconfigurations, leaked tokens, licences and an SBOM, from a single binary with a GitHub Action, a VS Code extension and an operator for clusters. It is the better default for small teams and for platform teams that need cluster-wide scans. Run it with a pinned version and digest-pinned image or commit-pinned action, mirror its databases if you run many CI jobs, and turn off telemetry if your policy requires it. Pick Grype when the vulnerability gate is the part you care most about and you want it SBOM-first: generate a Syft SBOM per artifact at build time, store it, and let Grype re-scan it daily, ranking by EPSS and KEV so the team works on what is exploited rather than what is merely rated critical. Grype's 120-hour DB age check is also a useful guard against silently stale results. If you choose Grype, add a separate IaC scanner and a secret scanner, because Grype does not do either. Running both is reasonable for high-assurance pipelines: the two use different databases and matching logic, so disagreements are worth a look.

All Comparisons

Trivy vs Grype — FAQ

Common questions answered from the comparison above

Is Trivy or Grype more accurate?

There is no neutral, current benchmark we can point to, and we did not run one. They use different databases (Aqua's trivy-db versus Anchore's daily-built Grype DB) and different matching logic, so results differ on the same image. Run both on a few of your own images, check disagreements against the distro security tracker, and pick the one whose false positives and misses you can live with.

Can Grype scan Terraform, Dockerfiles or secrets like Trivy?

No. Open-source Grype only matches packages to known vulnerabilities. Anchore lists secret and malware scanning for containers as Anchore Enterprise features. If you choose Grype, pair it with a dedicated IaC scanner and a secret scanner, or use Trivy for those jobs.

Do I need Syft to use Grype?

No. Grype embeds Syft as a library, so grype alpine:latest or grype dir:. catalogs packages itself. The standalone Syft CLI is useful when you want to generate and store an SBOM at build time and re-scan it later with grype sbom:path, which is much faster than re-pulling the image.

Is Trivy safe to use after the March 2026 supply-chain attack?

Aqua removed the malicious artifacts and published advisory GHSA-69fq-xp46-6x23 with exposure windows and affected versions (v0.69.4, Docker Hub images v0.69.5 and v0.69.6, trivy-action tags before 0.35.0, setup-trivy before 0.2.6). Current releases are signed with sigstore bundles. Pin a specific version, reference images by digest and actions by commit SHA, verify signatures, and rotate any secrets exposed to an affected run.

How do I run Trivy or Grype in an air-gapped environment?

For Trivy, mirror trivy-db, trivy-java-db and trivy-checks into an internal registry and point --db-repository, --java-db-repository and --checks-bundle-repository at it, or use --skip-db-update with a pre-populated cache and --offline-scan. For Grype, download a DB archive on a connected machine and load it with grype db import; keep in mind the default 120-hour maximum DB age.

Which tool is better in GitHub Actions?

Both produce SARIF for GitHub code scanning and both have official actions (aquasecurity/trivy-action and anchore/scan-action). Trivy covers more in one step; Grype gives EPSS and KEV ranking. Whichever you use, pin the action to a commit SHA, since tag rewriting was the main attack vector in the 2026 Trivy incident.

Get the next comparison by email

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.