Conversation
Adds docs/consuming.md, a quickstart for consuming this dataset: scanning a project with osv-scanner, querying osv.dev, using the raw reports offline, and wiring detection into CI and Renovate. Links it from the README's Get Involved section. Closes ossf#110. Signed-off-by: Devam Shah <devamshah91@gmail.com>
Re-checked every factual claim in docs/consuming.md against the repo and the upstream tools, and corrected what had drifted: - The denylist recipe needed `find -type f`. Some malicious packages are named `*.json` (npm: packages.json, packages-lock.json, pattern.json, ethers.json, ...), so their report directories match `-name '*.json'` and jq aborts with "Is a directory" mid-batch. On 6a50fc7 the old command yields 204715 names, the fixed one 219834. - CWE-506 is not on every record. In a 3000-file random sample only 406 (13.5%) carry affected[].database_specific.cwes, so the guide no longer tells consumers to key off it. - Documented ./osv/unmergable/ (records with an empty id) alongside ./osv/withdrawn/, and narrowed the offline advice to osv/malicious/. - Replaced the osv-scanner sample output with real v2.5.1 output, which now has CVSS and FIXED VERSION columns and a summary line. - Bumped osv-scanner-action v2.3.8 -> v2.5.1 and added `actions: read`, which the reusable workflow needs to upload SARIF. - Added osv-scanner's --offline-vulnerabilities/--local-db-path path as the simpler air-gapped option, and fixed the offline-mode doc URL. - Renovate section now states what actually happens on a malicious match (skipReason: malicious-update-proposed), plus the direct-dependencies and datasource limits and the experimental flag. - Added VS Code Marketplace / Open VSX to the ecosystem list. Signed-off-by: Devam Shah <devamshah91@gmail.com>
5016eb1 to
5a6ca8d
Compare
|
@calebbrown — rebased this onto current main ( What it is: I went through every factual claim in it against the repo and the upstream tools rather than just rebasing. Things had drifted, and one of them was a real bug in a command the doc teaches: The denylist recipe was silently wrong. It used 15,119 names missing. Fixed with CWE-506 is not on every record. The guide told consumers each report is tagged with CWE-506 under
osv-scanner sample output was from the old renderer. Replaced with what v2.5.1 actually prints, which I got by installing it and scanning a fixture lockfile pinned to Exit 1 on that, exit 0 on a clean lockfile — so the "gate on the exit code" advice holds. CVSS and FIXED VERSION are empty for CI example. Bumped Added osv-scanner's own offline mode to Option 3 as the simpler air-gapped path, ahead of the raw-JSON recipes. Verified end to end: Renovate section now says what actually happens on a hit (warns and refuses the update, Also added VS Code Marketplace / Open VSX to the ecosystem list, and a pointer to the stats page. Verification I ran, so you don't have to take my word for it: all 20 external links resolve (the two 405s are the POST-only osv.dev endpoints); all three osv.dev API calls in the doc return live results including What I did not change: no schema, data, or code, and I left the doc under Two things I'd rather you decide than guess at:
Happy to restructure however you want it. If the answer is that the project doesn't want to carry consumer docs, that's a fine answer too — just tell me and I'll close it. |
Summary
Adds
docs/consuming.md, a quickstart for consuming this dataset — scanning aproject with osv-scanner, querying osv.dev, using the raw reports offline, and
wiring detection into CI and Renovate — and links it from the README's "Get
Involved" section. Closes #110.
Problem / motivation
The repository is an excellent OSV-formatted database of malicious packages, but
the docs only cover how to contribute reports, not how to use them. #110
(open since 2023) asked for exactly this: guidance on consuming the data via
osv-scanner, osv.dev, and Renovate. Without it, a defender who finds this repo
has no documented path from "here is the dataset" to "my dependency tree is
checked against it," which limits the protective value of the data the project
works hard to curate.
Change
docs/consuming.mdcovering five consumption paths, each with copy-pastecommands:
and read a
MAL-hit in the output./v1/query,/v1/vulns/{id}, and/v1/querybatchexamples.
denylist with
jq, and check a single package, with an explicit note toexclude withdrawn reports under
./osv/withdrawn/.google/osv-scanner-actionreusable workflow.osvVulnerabilityAlerts/vulnerabilityAlertsconfig.(rotate secrets, treat the host as compromised), reusing the project's own
report language, and points back to the README's False Positives process.
the guide.
The doc follows the existing
docs/style (single-#section headings, nolicense header, as with
docs/schema_additions.mdanddocs/aws_s3_auth.md)and uses only relative links to in-repo files. No code, schema, or data changes.
Security rationale
Malicious packages map to CWE-506: Embedded Malicious
Code — the same classification
the reports already carry — and a confirmed dependency on one is, by this
project's own definition, a full host compromise requiring incident response
(MITRE ATT&CK T1195.002, Compromise Software Supply
Chain). Software supply chain
compromise is OWASP Top 10 2021 A06: Vulnerable and Outdated
Components
and A08: Software and Data Integrity
Failures.
A curated malware dataset only reduces risk if defenders can apply it; this guide
turns the database into an enforceable control at the two points that matter —
pre-merge in CI and continuously via Renovate — and the "Responding to a match"
section keeps remediation aligned with proper incident response rather than a
routine version bump.
Testing / validation
Documentation-only change; validated locally against a fresh clone:
paths (
CONTRIBUTING.md,osv/withdrawn/,osv/malicious/npm/,docs/consuming.md); the referenced README anchors (#false-positives,#scope) exist./v1/querybody, the/v1/querybatchbody, and the
renovate.json) parses cleanly underjq.jq/grepcommands the doc teaches were run against the realdataset: the per-ecosystem denylist command produces names, and the
single-package lookup returns
MAL-2022-6113forshubholic-test(positive)and nothing for a benign name (negative). That record carries CWE-506.
google/osv-scanner-actiontag (v2.3.8, the latest release) and itsosv-scanner-reusable.ymlpath were confirmed to exist.README.md(+8 lines) and a newdocs/consuming.md. The Go test/lint CI is unaffected (it ignoresosv/**and
docs/**).Fixes #110