Apache-2.0🖥️ Self-hostable

Trivy

Trivy

Overview

Trivy — billed by its maintainers as “the all-in-one security scanner” — finds vulnerabilities, misconfigurations, secrets and licence problems across container images, filesystems, Git repositories, virtual-machine images, Kubernetes clusters and SBOMs. It began in 2019 as a personal project by Teppei Fukuda (knqyf263), was written from the start as a single self-contained binary in Go, and joined Aqua Security’s open-source portfolio that same August; Aqua’s Trivy team still maintains it today, with a new release roughly every month (v0.76.0, October 2026). With more than 38,000 GitHub stars it is one of the most widely adopted scanning tools in the cloud-native ecosystem, and it is integrated into CI/CD systems, registries, IDEs and Kubernetes operators.

The design is simple to reason about: Trivy separates targets (what it looks at) from scanners (what it looks for). Five targets — container image, filesystem/rootfs, remote Git repository, VM image and Kubernetes cluster — are examined by four scanners — vulnerability, misconfiguration, secret and licence — and you choose which to run with a single flag, e.g. trivy image --scanners vuln,misconfig,secret myapp:1.0.

Key Features

  • Four scanners, one binary — known vulnerabilities in OS packages, language dependencies, Kubernetes components and unpackaged software; misconfiguration and IaC issues; hard-coded secrets; and licence risk. Vulnerability and secret scanning run by default on image/fs/repo; misconfiguration and licence scanning are opt-in via --scanners or the dedicated config command.
  • Five target types — container images, filesystems and rootfs, remote Git repositories (trivy repo), virtual-machine images (local VMDK, AWS AMIs and EBS snapshots via trivy vm) and live Kubernetes clusters (trivy k8s --report summary, or the Trivy Operator running inside the cluster).
  • Wide package coverage — around 20 OS families (Alpine, Debian, Ubuntu, Red Hat/RHEL, CentOS, Rocky, AlmaLinux, Oracle Linux, SUSE, Amazon Linux, Azure Linux, Bottlerocket, Wolfi, Chainguard, Google Distroless…) and 13 language ecosystems (Ruby, Python, PHP, Node.js, .NET, Java, Go, Rust, C/C++, Elixir, Dart, Swift, Julia). For pre-build projects it reads lock files; for built artefacts it reads installed package metadata.
  • Misconfiguration checks for IaC — Dockerfile, Kubernetes manifests, Terraform (including terraform plan JSON and plan snapshots), CloudFormation, Azure ARM, Helm and Ansible. The checks live in the trivy-checks library, are written mainly in Rego, and ship as an OPA bundle that Trivy caches and refreshes.
  • Custom checks in Rego — the built-in policy set can be extended with your own Rego checks, so organisation-specific rules run in the same engine instead of a separate linter.
  • Secret scanning enabled by default — built-in rules cover cloud keys, API tokens, passwords and private keys across plaintext files (compiled Python .pyc files included). Rules can be extended, disabled or allowed-through with a trivy-secret.yaml config, so known dummy values do not become noise.
  • Licence risk classification — detected licences are mapped onto the Google licence classification (forbidden, restricted, reciprocal, permissive…) with severities, and --license-full extends the scan to source files, Markdown and LICENSE documents; the classifier lists are configurable in trivy.yaml.
  • SBOM in and out — generate CycloneDX or SPDX documents (trivy image -f spdx-json -o sbom.json), scan an existing SBOM as a target (trivy sbom), and detect SBOM files already present inside images. Attestation and VEX support round out the supply-chain workflow.
  • Report formats that fit any pipeline — table (default), JSON, SARIF, template, SBOM and GitHub dependency snapshot, plus trivy convert to re-render a stored JSON report. --exit-code 1 turns findings into a failing build; --severity HIGH,CRITICAL and --ignore-unfixed keep gates useful instead of noisy.
  • Client/server mode — trivy server holds the vulnerability database and serves scans to thin clients with token authentication, so dozens of build agents do not each download and refresh the database. Misconfiguration and secret scanning stay on the client side, so source content never has to leave the machine.
  • Air-gapped and mirror friendly — the checks bundle is embedded in the binary as a fallback, and all three databases (trivy-db, trivy-java-db, trivy-checks) can be fetched from your own registry with --db-repository / --checks-bundle-repository; --skip-db-update and --offline-scan keep runs fully offline.
  • Download and run — one static binary with no runtime dependencies, plus official container images (Docker Hub, GHCR, AWS ECR public), RPM and DEB repositories, GitHub release archives and an install script. Community channels such as Homebrew and distribution packages are available too.

Why Use Trivy?

The appeal is consolidation. Instead of stitching together a CVE scanner, an IaC linter, a secret detector and a licence checker — each with its own database, report format and CI syntax — Trivy answers all four questions from the same command, over the same artefact, in the same report. A developer can run trivy fs . on a laptop, the pipeline can gate an image before it is pushed, the registry can scan what is already stored and the cluster can keep scanning continuously with the Trivy Operator, all producing comparable output.

Practically, that means a short learning curve (one binary, no agent, results in seconds), a vulnerability database assembled by Aqua from NVD and vendor feeds and refreshed automatically, and a deliberate bias toward precision — Trivy is explicit that it tunes detection to minimise false positives, even at the cost of some false negatives, which is what makes it usable as a build gate rather than a report nobody reads. It is Apache-2.0 licensed with no account or paid tier required, and it can run entirely on your own infrastructure: your registry, your server mode, your CI. The one honest caveat for privacy-minded users is that Trivy sends anonymous usage telemetry by default (version, OS, non-revealing scan options, no file paths or image names), and it is switched off with --disable-telemetry.

Use Cases

  • Gate a CI/CD pipeline: scan the image you just built and fail the build on --severity HIGH,CRITICAL --exit-code 1, before anything reaches a registry.
  • Review infrastructure-as-code before it is applied — Dockerfiles, Kubernetes manifests, Helm charts, CloudFormation and Terraform plans — so misconfigurations are caught in a pull request.
  • Keep secrets out of repositories: trivy repo or trivy fs catches committed keys and tokens, complementing tools such as Gitleaks.
  • Audit an existing registry or cluster: scan stored images, or run trivy k8s and the Trivy Operator to see vulnerabilities, misconfigurations and exposed secrets per workload.
  • Produce SBOMs (CycloneDX/SPDX) and attach VEX statements to satisfy supply-chain and compliance requirements.
  • Check licence obligations across a container or codebase before shipping, flagging AGPL/GPL-family components that your policy restricts.
  • Scan virtual-machine images — a base AMI or EBS snapshot — before it is promoted to an account or an image catalogue.
  • Serve many build agents from one database with client/server mode, an especially good fit for air-gapped or bandwidth-limited networks.

Similar

  • Grype and Syft (Anchore) — the closest pairing in the open-source ecosystem: Syft generates the SBOM, Grype scans it. Trivy folds both jobs into one tool.
  • OSV-Scanner (Google) — dependency scanning driven by the OSV database; narrower in scope, with no IaC or VM image coverage.
  • Checkov and tfsec — IaC-focused scanners; tfsec’s checks were folded into Trivy (the aquasecurity/tfsec repository now states “Tfsec is now part of Trivy”).
  • Gitleaks — a dedicated secret scanner; Trivy’s secret scanner covers the same ground with fewer rule-maintenance chores.
  • OSQuery and Lynis — host and system auditing as they run, rather than scanning artefacts for known issues; CrowdSec, Suricata and ClamAV work at the traffic and runtime layers.

Platform

Linux · macOS · Windows · container images · Kubernetes — distributed as a static Go binary (amd64, arm64 and other architectures) with official images on Docker Hub, GitHub Container Registry and AWS ECR public, RPM/DEB repositories, release archives and an install script; also packaged for community channels including Homebrew.

Licence

Apache-2.0 — permissive, with no paid tier required. The licence badge is set from the LICENSE file in the project repository (Aqua Security), which the project homepage also states as “Apache-2.0 License”.

Website

trivy.dev · docs · installation · source on GitHub · Trivy Operator

Explore More Categories

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.