PROVIDER - unified container and IaC security scanning
Trivy
Trivy is Aqua Security's open source scanner, covering 5 targets - images, filesystems, repositories, Kubernetes and IaC - with one binary while detecting dependency vulnerabilities, misconfigurations and hard-coded secrets and emitting CycloneDX or SPDX SBOMs; visualisation and commercial SCA depth are its gaps.
Service Overview
Trivy is the open source security scanner from Aqua Security. A single binary covers multiple targets: container images, filesystems, code repositories, Kubernetes clusters and infrastructure as code.
In the development tools category it represents supply chain security shifted left: vulnerability, configuration and secret checks live in CI and cluster runtime rather than waiting for a security team after release.
Key Strengths
- Broad targets: 5 scan surfaces from images to IaC
- Complete risk classes: vulnerabilities, misconfigurations and hard-coded secrets in one pass
- SBOM friendly: CycloneDX and SPDX output supports supply chain audits
- Continuous cluster scanning: Trivy Operator reports workload risk as custom resources
- Pipeline friendly: native integrations with GitHub Actions, GitLab CI, Harbor, Jenkins and more than 4 platforms
Product Ecosystem
Scanning capabilities
Image, filesystem, repository, Kubernetes and IaC scanning plus SBOM generation.
Integration shapes
CLI, GitHub Action, Kubernetes Operator, Harbor plugin and CI templates.
Typical scenarios
Pre-release image gates, runtime cluster inspection, open source dependency inventories and compliance audits.
Limitations
- Data source limits: aggregated upstream advisories trail commercial SCA in ecosystem depth
- Scan time: repository-wide scanning needs caching and incremental runs
- Visualisation gap: no unified console, so results land in reports or external platforms
- Fix judgement: upgrade advice still needs human review of business impact
Use Cases
- CI image gating (★★★★★): block critical vulnerabilities during builds
- Kubernetes runtime inspection (★★★★): the Operator scans workloads continuously
- SBOM and compliance audits (★★★★): standard formats ease deliverables
- Commercial SCA depth (★★★): combine with a dedicated SCA platform
Pricing
| Item | Price | Notes |
|---|---|---|
| Trivy CLI and Operator | $0 | Open source under Apache 2.0 |
| Vulnerability database | $0 | Public feeds are free to pull |
| Aqua commercial platform | Per node or contract | Adds dashboards, policy and runtime protection |
The scanner is free, while enterprise dashboards and policy governance come with the Aqua platform.
FAQ
- Can Trivy replace an SCA tool? It covers ordinary dependency vulnerabilities; licence compliance and reachability analysis need a dedicated SCA platform.
- Why is scanning slow? Use the local cache, scan only changed layers, and filter by severity in CI.
- Can it scan private registries? Yes, configure registry credentials and reference the image directly, or trigger it from the Harbor plugin on push.
Code Examples
Scanning an image for high severity only
trivy image --severity HIGH,CRITICAL \
--exit-code 1 \
ghcr.io/acme/api:1.4.2
--exit-code 1 fails the pipeline on high findings, and --severity filters the output level.
Scanning IaC and emitting an SBOM
trivy config ./infra
trivy fs --format cyclonedx --output sbom.json .
trivy config checks Terraform and similar misconfigurations, and --format cyclonedx writes a standard SBOM file.
Community & Resources
- Trivy: documentation, installation and scan examples
- GitHub Trivy topic: related tools and integrations
- GitHub Kubernetes topic: cluster security scenarios
- GitHub DevOps topic: pipeline integration practice
- GitHub Snyk topic: the comparable dependency security platform
Articles
- 01 GitLab CI/CD Best Practices: From Beginner to Production-Grade Pipelines 07-18
- 02 Prometheus Monitoring System Setup: From Metric Collection to Alert Notifications 07-18
- 03 Ansible Automation Ops Guide: From Configuration Management to Application Deployment 07-18
- 04 Docker Beginner Tutorial: From Installation to Containerized Web Deployment 07-18
- 05 Developer Tools Panorama: What Version Control, Package Managers, CI/CD and Containers Solve 08-12
- 06 Upgrading SVN to 1.8 on CentOS 7 04-02
- 07 Git for Beginners: Working Directory, Staging Area, Repository and Core Commands 08-12
- 08 GitHub Actions CI/CD Tutorial: Automated Build, Test, and Deployment 07-18
- 09 GitHub Copilot Code Review Is Now Generally Available 08-05
- 10 API Integration Guide: REST vs GraphQL Comparison and Selection 07-18