github.com/khulnasoft-lab/tunnel-db@v0.0.0-20231117205118-74e1113bd007/README.md (about) 1 # tunnel-db 2 3  4 [![GitHub Release][release-img]][release] 5 ![Downloads][download] 6 [![Go Report Card][report-card-img]][report-card] 7 [![Go Doc][go-doc-img]][go-doc] 8 [![License][license-img]][license] 9 10 [download]: https://img.shields.io/github/downloads/khulnasoft-lab/tunnel-db/total?logo=github 11 [release-img]: https://img.shields.io/github/release/khulnasoft-lab/tunnel-db.svg?logo=github 12 [release]: https://github.com/khulnasoft-lab/tunnel-db/releases 13 [report-card-img]: https://goreportcard.com/badge/github.com/khulnasoft-lab/tunnel-db 14 [report-card]: https://goreportcard.com/report/github.com/khulnasoft-lab/tunnel-db 15 [go-doc-img]: https://godoc.org/github.com/khulnasoft-lab/tunnel-db?status.svg 16 [go-doc]: https://godoc.org/github.com/khulnasoft-lab/tunnel-db 17 [code-cov]: https://codecov.io/gh/khulnasoft-lab/tunnel-db/branch/main/graph/badge.svg 18 [license-img]: https://img.shields.io/badge/License-Apache%202.0-blue.svg 19 [license]: https://github.com/khulnasoft-lab/tunnel-db/blob/main/LICENSE 20 21 ## Overview 22 `tunnel-db` is a CLI tool and a library to manipulate Tunnel DB. 23 24 ### Library 25 Tunnel uses `tunnel-db` internally to manipulate vulnerability DB. This DB has vulnerability information from NVD, Red Hat, Debian, etc. 26 27 ### CLI 28 The `tunnel-db` CLI tool builds vulnerability DBs. A [GitHub Actions workflow](.github/workflows/cron.yml) 29 periodically builds a fresh version of the vulnerability DB using `tunnel-db` and uploads it to the GitHub 30 Container Registry (see [Download the vulnerability database](#download-the-vulnerability-database) below). 31 32 ``` 33 NAME: 34 tunnel-db - Tunnel DB builder 35 36 USAGE: 37 main [global options] command [command options] image_name 38 39 VERSION: 40 0.0.1 41 42 COMMANDS: 43 build build a database file 44 help, h Shows a list of commands or help for one command 45 46 GLOBAL OPTIONS: 47 --help, -h show help 48 --version, -v print the version 49 ``` 50 51 ### Building the DB 52 You can utilize `make db-all` to build the database, the DB artifact is outputted to the assets folder. 53 54 Alternatively Docker is supported, you can run `docker build . -t tunnel-db`. 55 56 If you want to build a tunnel integration test DB, please run `make create-test-db` 57 58 ## Update interval 59 Every 6 hours 60 61 ## Download the vulnerability database 62 ### version 1 (deprecated) 63 Tunnel DB v1 reached the end of support on February 2023. Please upgrade Tunnel to v0.23.0 or later. 64 65 Read more about the Tunnel DB v1 deprecation in [the discussion](https://github.com/khulnasoft-lab/vul/discussions/1653). 66 67 ### version 2 68 Tunnel DB v2 is hosted on [GHCR](https://github.com/orgs/khulnasoft-lab/packages/container/package/tunnel-db). 69 Although GitHub displays the `docker pull` command by default, please note that it cannot be downloaded using `docker pull` as it is not a container image. 70 71 You can download the actual compiled database via [Tunnel](https://khulnasoft-lab.github.io/vul/) or [Oras CLI](https://oras.land/cli/). 72 73 Tunnel: 74 ```sh 75 TUNNEL_TEMP_DIR=$(mktemp -d) 76 tunnel --cache-dir $TUNNEL_TEMP_DIR image --download-db-only 77 tar -cf ./db.tar.gz -C $TUNNEL_TEMP_DIR/db metadata.json tunnel.db 78 rm -rf $TUNNEL_TEMP_DIR 79 ``` 80 oras >= v0.13.0: 81 ```sh 82 $ oras pull ghcr.io/khulnasoft-lab/tunnel-db:2 83 ``` 84 85 oras < v0.13.0: 86 ```sh 87 $ oras pull -a ghcr.io/khulnasoft-lab/tunnel-db:2 88 ``` 89 The database can be used for [Air-Gapped Environment](https://khulnasoft-lab.github.io/vul/latest/docs/advanced/air-gap/).