-
Notifications
You must be signed in to change notification settings - Fork 312
docs(vulnfeeds): Update/add some documentation/READMEs around cmd tools in vulnfeeds #4724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
213e742
Update docs for combine-tol-osv
jess-lowe 60dedd1
Added some readmes for tools in the vulnfeeds/cmd dir
jess-lowe 8dc109c
Add docs on CVElist conversion and update cpe repo gen docs
jess-lowe 87ed965
add who uses ids
jess-lowe a3f0e70
Update vulnfeeds/cmd/mirrors/cpe-repo-gen/README.md
jess-lowe ea2fe9c
Update vulnfeeds/cmd/converters/cve/cve5/README.md
jess-lowe e0c498e
Update nits
jess-lowe 93ca3c2
Update vulnfeeds/cmd/converters/alpine/README.md
jess-lowe b0c48fc
Update vulnfeeds/cmd/converters/debian/README.md
jess-lowe 6b75f77
Update vulnfeeds/cmd/combine-to-osv/README.md
jess-lowe 5977bcf
Update vulnfeeds/cmd/converters/debian/README.md
jess-lowe 6202754
Update vulnfeeds/cmd/converters/alpine/README.md
jess-lowe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Alpine Converter | ||
|
|
||
| This tool converts Alpine security database records to OSV format and uploads them to GCS. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| go run main.go [flags] | ||
| ``` | ||
|
|
||
| ### Flags | ||
|
|
||
| - `-output-path`: Path to output general alpine affected package information (default: "alpine") | ||
|
jess-lowe marked this conversation as resolved.
|
||
| - `-output-bucket`: The GCS bucket to write to (default: "osv-test-cve-osv-conversion") | ||
| - `-workers`: Number of workers to process records (default: 64) | ||
| - `-upload-to-gcs`: If true, do not write to GCS bucket and instead write to local disk (default: false) | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
| - `-sync-deletions`: If false, do not delete files in bucket that are not local (default: false) | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Description | ||
|
|
||
| The tool performs the following steps: | ||
| 1. Downloads the Alpine SecDB data from `https://secdb.alpinelinux.org/`. | ||
| 2. Loads existing NVD CVEs data to extract human readable information like details and severity. | ||
| 3. Generates OSV vulnerabilities by mapping Alpine security fixes to CVEs. | ||
| 4. Uploads the results to GCS or writes them to the local filesystem. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # CVE5 Converters | ||
|
|
||
| In this directory you will find two tools to convert CVEs from the CVEListV5 repository to OSV format. The bulk converter is designed to convert a large number of CVEs in parallel from the CVEListV5 repository, while the single converter is designed to convert a single CVE. | ||
|
|
||
| These converters are a continuation of the work described in the [Introducing broad C/C++ vulnerability management support](https://osv.dev/blog/posts/introducing-broad-c-c++-support/) | ||
|
|
||
| See [bulk-converter/run_cvelist-converter.sh](https://github.com/google/osv.dev/blob/master/vulnfeeds/cmd/converters/cve/cve5/bulk-converter/run_cvelist-converter.sh) for how this is invoked in Production. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Bulk Converter | ||
|
|
||
| ```bash | ||
| go run bulk-converter/main.go [flags] | ||
| ``` | ||
|
|
||
| #### Flags | ||
|
|
||
| - `-cve5-repo`: CVEListV5 directory path (default: "cvelistV5") | ||
| - `-out-dir`: Path to output results (default: "cvelist2osv") | ||
| - `-start-year`: The first in scope year to process (default: "2022") | ||
| - `-workers`: The number of concurrent workers to use for processing CVEs (default: 30) | ||
| - `-cnas-allowlist`: A comma-separated list of CNAs to process. If not provided, defaults to `cna_allowlist.txt`. | ||
|
|
||
| #### Description | ||
|
|
||
| The tool performs the following steps: | ||
| 1. Walks the specified CVEListV5 directory for JSON files starting from the `start-year`. | ||
| 2. Filters CVEs based on the CNA allowlist and state ("PUBLISHED"). | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
| 3. Converts valid CVEs to OSV format using `cvelist2osv`. | ||
| 4. Outputs the OSV records and metrics to the specified output directory. | ||
|
|
||
| ### Single Converter | ||
|
|
||
| ```bash | ||
| go run single-converter/main.go <path/to/cve.json> [flags] | ||
| ``` | ||
|
|
||
| #### Flags | ||
| - `-out-dir`: Path to output results (default: "cvelist2osv") | ||
|
|
||
| #### Description | ||
|
|
||
| The tool performs the following steps: | ||
| 1. Reads the specified CVE JSON file. | ||
| 2. Converts the CVE to OSV format using `cvelist2osv`. | ||
| 3. Outputs the OSV record to the specified output directory. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Debian Converter | ||
|
|
||
| This tool converts Debian Security Tracker information to OSV format. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| go run main.go [flags] | ||
| ``` | ||
|
|
||
| ### Flags | ||
|
|
||
| - `-output-path`: Path to output OSV files (default: "debian-cve-osv"). | ||
|
jess-lowe marked this conversation as resolved.
|
||
| - `-output-bucket`: The GCS bucket to write to (default: "debian-osv"). | ||
| - `-workers`: Number of workers to process records (default: 64). | ||
| - `-upload-to-gcs`: If true, do not write to GCS bucket and instead write to local disk (default: false). | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
| - `-sync-deletions`: If false, do not delete files in bucket that are not local (default: false). | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Description | ||
|
|
||
| The tool performs the following steps: | ||
| 1. Downloads the Debian Security Tracker data from `https://security-tracker.debian.org/tracker/data/json`. | ||
| 2. Downloads Debian Distro Info data to map release names to version numbers. | ||
| 3. Loads existing CVEs from `cve_jsons`. | ||
| 4. Generates OSV vulnerabilities by mapping Debian security tracker entries to CVEs. | ||
| 5. Uploads the results to GCS or writes them to the local filesystem. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # IDs Tool | ||
|
|
||
| This utility assigns IDs to OSV records in a directory. It ensures that IDs are unique and follow a specified prefix and year format. | ||
|
|
||
| It is predominately used by [PYSEC](https://github.com/pypa/advisory-database/blob/main/.github/workflows/automation.yaml) and [Malicious Packages](https://github.com/ossf/malicious-packages/blob/7b1ba332528dba6b0a2df23e9a43b384623c0251/.github/workflows/assign-osv-ids.yml#L35). | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| go run main.go [flags] | ||
| ``` | ||
|
|
||
| ### Flags | ||
|
|
||
| - `-prefix`: Vulnerability prefix (e.g., "PYSEC"). | ||
| - `-dir`: Path to vulnerabilities. | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
| - `-format`: Format of OSV reports in the repository. Must be "json" or "yaml" (default: "yaml"). | ||
|
|
||
| ## Description | ||
|
|
||
| The tool performs the following steps: | ||
| 1. Walks the specified directory to find unassigned vulnerabilities (files starting with `PREFIX-0000-`). | ||
| 2. Determines the maximum allocated ID for each year. | ||
| 3. Assigns new IDs to unassigned vulnerabilities, incrementing the counter for the respective year. | ||
| 4. Renames the files to match the new IDs. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Download CVEs | ||
|
|
||
| This tool downloads CVE data from the NVD 2.0 API data dumps. | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| go run main.go [flags] | ||
| ``` | ||
|
|
||
| ### Flags | ||
|
|
||
| - `-cve-path`: Where to download CVEs to (default: "cve_jsons"). | ||
|
|
||
| ## Description | ||
|
|
||
| The tool performs the following steps: | ||
| 1. Downloads CVE JSON files for each year from 2002 to the current year. | ||
| 2. Downloads "modified" and "recent" CVE feeds. | ||
|
jess-lowe marked this conversation as resolved.
Outdated
|
||
| 3. Saves the downloaded files to the specified directory. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.