docs/community/contribute/vulnerability-database/add-vulnerability-source.md
This guide walks through the process of adding a new vulnerability advisory source to Trivy.
!!! info For an overview of how Trivy's vulnerability database works, see the Overview page.
Before starting, ensure you have:
To add a new vulnerability advisory source, you'll need to make changes across three repositories. Below we'll use the Echo OS support as an example.
!!! note Skip this step if your advisory source is already managed in a Git repository (e.g., GitHub, GitLab).
Create a fetcher script in vuln-list-update to collect advisories from the upstream source.
Key tasks:
Example PR:
Create a parser in trivy-db to transform raw advisories into Trivy's database format.
Key tasks:
pkg/vulnsrc/Example PR:
Update trivy to support the new operating system or package ecosystem.
Key tasks:
pkg/fanal/analyzer/os/ to detect the OSExample PR:
The Echo OS support was added through three coordinated PRs:
https://advisory.echohq.com/data.json
First, fetch all existing advisories (required for building the database):
cd vuln-list-update
go run main.go -vuln-list-dir /path/to/vuln-list
Then, test your new data source by fetching only your target:
go run main.go -target your-source -vuln-list-dir /path/to/vuln-list
Verify that advisories are correctly saved in the vuln-list directory.
cd trivy-db
make db-build CACHE_DIR=/path/to/cache
Check that the database is built without errors and contains your advisories.
!!! note
The CACHE_DIR should point to the parent directory of your vuln-list directory. For example, if your vuln-list is at /tmp/test/vuln-list, set CACHE_DIR=/tmp/test.
You can inspect the built database using BoltDB viewer tools like boltwiz:
# Open the database
boltwiz out/trivy.db
This allows you to verify that your vulnerabilities are correctly stored in the database.
# Build Trivy with your changes
mage build
# Use your local database
./trivy image --skip-db-update --cache-dir /path/to/cache your-test-image
Verify that vulnerabilities from your new data source are detected correctly.
If you have questions or need help: