osv-db
A Rust library for downloading and querying the OSV (Open Source Vulnerabilities) database locally.
Overview
osv-db fetches vulnerability data from the OSV Google Cloud Storage and stores it on disk as JSON files. It supports scoping the database to a single ecosystem (e.g. crates.io, PyPI, npm) or working across all ecosystems at once.
Official OSV Documentation.
Features
- Full download — fetch the complete OSV archive for one or all ecosystems (
OsvDb::download_latest) - Incremental sync — download only records modified since the last sync (
OsvDb::sync) - Record lookup — retrieve a single vulnerability by ID (
OsvDb::get_record) - Stream iteration — async stream over all stored records (
OsvDb::records_stream) - Typed schema — strongly-typed
OsvRecordmatching the OSV schema spec
Usage
use ;
use TempDir;
use TryStreamExt;
async