tunnel-db
is a CLI tool and library for managing Tunnel DB, a database containing vulnerability information from sources such as NVD, Red Hat, Debian, and others.
Tunnel internally uses tunnel-db
to manage its vulnerability database efficiently.
The tunnel-db
CLI allows users to build, compact, and compress vulnerability databases. It integrates with GitHub Actions to periodically update the database and push it to the GitHub Container Registry.
NAME:
tunnel-db - Tunnel DB builder
USAGE:
tunnel-db [global options] command [command options] image_name
VERSION:
0.0.1
COMMANDS:
build Build a database file
help, h Show help for commands
GLOBAL OPTIONS:
--help, -h Show help
--version, -v Print the version
To build tunnel-db
locally, follow these steps:
make db-fetch-langs db-fetch-vuln-list # Download advisories and required files
make build # Compile `tunnel-db` binary
make db-build # Build the database
make db-compact # Compact the database
make db-compress # Compress database into `db.tar.gz`
To build and push a tunnel-db
image to GitHub Container Registry using Oras CLI:
oras push --artifact-type application/vnd.khulnasoft.tunnel.config.v1+json \
"ghcr.io/khulnasoft-lab/tunnel-db:2" \
db.tar.gz:application/vnd.khulnasoft.tunnel.db.layer.v1.tar+gzip
- Tunnel DB is rebuilt every 6 hours.
- The default update interval in the metadata file is 24 hours.
- For more frequent updates, you can manually upload a new database.
Tunnel DB v1 support ended in February 2023. Upgrade to Tunnel v0.23.0 or later. More details in this discussion.
Tunnel DB v2 is hosted on GitHub Container Registry (GHCR).
TUNNEL_TEMP_DIR=$(mktemp -d)
tunnel --cache-dir $TUNNEL_TEMP_DIR image --download-db-only
tar -cf ./db.tar.gz -C $TUNNEL_TEMP_DIR/db metadata.json tunnel.db
rm -rf $TUNNEL_TEMP_DIR
For Oras v0.13.0+:
oras pull ghcr.io/khulnasoft-lab/tunnel-db:2
For Oras < v0.13.0:
oras pull -a ghcr.io/khulnasoft-lab/tunnel-db:2
The database can be used in air-gapped environments where internet access is restricted.
🚀 Stay Updated – Check out the official documentation for more details and updates.