Trivy

A scanner that finds vulnerabilities, misconfigurations, and embedded secrets in container images, code, and Kubernetes.

cat trivy/meta.ymlChecked on 2026-10-25

Safety

Impact Local onlyStays on your machine and sends nothing out
Admin rights
Not required
Test lab
Not required

Usage

Purpose
Defense
Difficulty
Beginner
Type
Command line
Platforms
Linux / macOS / Windows / Docker

Trust

Repository
aquasecurity/trivy
License
PermissiveApache-2.0
GitHub
stars38,7032026-10-25
Maintenance
Actively updatedLast update 2026-10-23
Contents
  1. Introduction
  2. What Trivy is for
  3. Install
  4. Try it safely: scan a local project
  5. Filter the results
  6. Cautions
  7. Read next
  8. Sources

Trivy checks the container images and source code you use for known vulnerabilities and for secrets such as API keys. It scans files on your own machine, so it is an easy first tool to try.

This review is for people who build software with dependencies from Docker, npm, or similar ecosystems. After reading it, you can do the following:

  • List the vulnerable dependencies in a project on your computer
  • Filter the results by severity and start with the ones that have a fix
  • Scan a container image

What Trivy is for

You use Trivy by combining a target (where to look) with scanners (what to look for).

Targets Scanners
Container images OS packages and dependencies (SBOM)
Filesystem (a local folder) Known vulnerabilities (CVEs)
Git repositories (remote) IaC issues and misconfigurations
Virtual machine images Secrets such as API keys
Kubernetes Software licenses

The two columns don’t map one to one. For example, you can look for vulnerabilities, secrets, and misconfigurations in a local folder in a single run.

What it doesn’t doTrivy finds known problems. It doesn’t decide whether a vulnerability can actually be exploited in your setup. It also doesn’t send attacks to anyone’s servers.

Install

The official installation page lists every method. The common ones are:

  • macOS and Linux: brew install trivy with Homebrew
  • Debian, Ubuntu, RHEL, and CentOS: add the official package repository and install from it
  • Windows: download trivy_<version>_windows-64bit.zip from the releases page and unzip it
  • Docker: use the official aquasec/trivy image

After installing, run trivy --version to check that it prints a version number.

Try it safely: scan a local project

  1. Go to the folder of the project you want to check.

  2. Run this command to look for vulnerabilities, secrets, and misconfigurations together:

    trivy fs --scanners vuln,secret,misconfig .
  3. The first run downloads the vulnerability database, so it takes a little longer. When it finishes, Trivy prints the problems it found as a table.

Most of the traffic Trivy sends out is the download of this database and of the misconfiguration checks, both from mirror.gcr.io or ghcr.io. Later runs use the local cache, and --skip-db-update skips the database update. Trivy can also call APIs to identify dependencies; --offline-scan turns that off.

Filter the results

The first results are often long. Use these options to focus on what to fix now.

Option What it does
--severity HIGH,CRITICAL Show only HIGH and CRITICAL findings
--ignore-unfixed Show only vulnerabilities that have a fixed version
--exit-code 1 Exit with code 1 when anything is found, to fail a CI job
-f json -o results.json Save the results to a JSON file

To scan a container image, use trivy image <image>. For example, trivy image --severity HIGH,CRITICAL python:3.4-alpine shows only the serious vulnerabilities in an old Python image.

Cautions

  • In March 2026, Trivy’s own release artifacts were tampered with. Using stolen credentials, an attacker published a malicious v0.69.4 release, malicious tags for the trivy-action and setup-trivy GitHub Actions, and malicious v0.69.5 and v0.69.6 images on Docker Hub. Each was removed within a few hours to about half a day. If any CI job or computer used them during that window, check the official advisory (GHSA-69fq-xp46-6x23) and rotate every secret that environment could reach. Going forward, pin versions and reference images by digest so that a replaced release is less likely to reach you.
  • Don’t panic over the number of findings. Whether a fix is urgent depends on whether you actually use the affected code and whether it is reachable from outside.
  • Deleting a leaked key from the repository is not enough, because it stays in the Git history. Revoke the key and issue a new one.

Sources

  1. Official repository (README)github.com/aquasecurity/trivy
  2. Docs: Installationtrivy.dev/docs/latest/getting-started/installation/
  3. Docs: Filteringtrivy.dev/docs/latest/guide/configuration/filtering/
  4. Docs: Databasestrivy.dev/docs/latest/guide/configuration/db/
  5. Docs: trivy filesystem optionstrivy.dev/docs/latest/guide/references/configuration/cli/trivy_filesystem/
  6. Security advisory GHSA-69fq-xp46-6x23 (March 2026 supply chain compromise)github.com/advisories/GHSA-69fq-xp46-6x23

Checked on 2026-10-25

Similar tools

Gitleaks

Impact Local only
gitleaks/gitleaks

A command-line tool that finds passwords, API keys, and tokens that have slipped into Git repositories and files.

Purpose
Defense
Type
Command line
Difficulty
Beginner
License
PermissiveMIT
Category
Vulnerability scanning
Actively updatedstars30,315Last update 2026-10-23
Read the Gitleaks review

OSV-Scanner

Impact Local only
google/osv-scanner

A command-line tool from Google that reads your project's dependencies and checks them against the OSV.dev vulnerability database.

Purpose
Defense
Type
Command line
Difficulty
Beginner
License
PermissiveApache-2.0
Category
Vulnerability scanning
Actively updatedstars11,264Last update 2026-10-24
Read the OSV-Scanner review

Prowler

Impact Reaches others
prowler-cloud/prowler

An audit tool that reads the configuration of AWS, Azure, Google Cloud, and other clouds and lists the settings that fail security standards.

Purpose
Audit
Type
Command line
Difficulty
Intermediate
License
PermissiveApache-2.0
Category
Containers and cloud
Actively updatedstars15,094Last update 2026-10-25
Read the Prowler review