feat(tools/osv): query OSV.dev for vulnerability cross-references during security triage (#311) - #1297
Conversation
potiuk
left a comment
There was a problem hiding this comment.
Thanks — the adapter doc is clear and the confidentiality boundaries are exactly what this tool needs. Three things to fix before this lands, two nits, and one note.
Blocking
security_cross_ref.tool/.ecosystemare documented as<project-config>/project.mdkeys butprojects/_template/project.mddoes not define them (AGENTS.md § Placeholder convention: values are threaded through the project manifest). Please add them to the template, or drop the configuration section until a skill reads them.tool.md § Consuming skillsnames four skills; none of them referencestools/osvtoday, and the PR touches no skill or eval. Please reword as "intended consumers, not yet wired" — or wire one skill together with its eval suite in a follow-up, per AGENTS.md § Reusable skills.docs/adapters/registry.mdlists "NVD direct, GHSA direct" as open extension points without tracking issues; the registry defines an extension point as "a documented, labelled slot with a tracking issue". Open the issues, or leave the column as—.
Nits
- The PR description ticks "Python package (
tools/*/withpyproject.toml)"; this is a docs-only adapter. - Every other
tools/*/README.mdstarts with the SPDX comment before the doctoc block.
Note on the score: the vendor-neutrality block regenerates correctly — I re-ran vendor-neutrality-score against this branch and it is in sync — and the drop to 10/11 is the right reading of a one-vendor contract, not something to paper over.
This review was drafted by an AI-assisted tool and confirmed by an Apache Magpie maintainer. After you've addressed the points above and pushed an update, an Apache Magpie maintainer — a real person — will take the next look at the PR. The findings cite the project's review criteria; if you think one of them is mis-applied, please reply on the PR and a maintainer will weigh in.
More on how Apache Magpie handles maintainer review: CONTRIBUTING.md § Opening a pull request.
|
Thanks for the review, @potiuk! I've addressed all the feedback in the latest commit (added template config & vocabulary, reframed consuming skills as intended/not yet wired, cleaned registry extension points, fixed SPDX header, and updated the PR checklist). |
onlyarnav
left a comment
There was a problem hiding this comment.
Reviewed the current changes. The adapter registration, project-template configuration, and vendor-neutrality updates look consistent, and the earlier scope concerns appear to be addressed.
One small documentation point: the commit query uses OSV’s commit field, which establishes an association with a published vulnerability but doesn’t necessarily mean the commit is the fixing commit. I’d suggest wording this as “vulnerabilities associated with a public upstream commit hash” for precision.
Other than that, I don’t see any blocking issues in the current scope.
2271414 to
3560970
Compare
potiuk
left a comment
There was a problem hiding this comment.
Rebased onto current main and re-reviewed. One change requested — the curl recipes cannot run under the framework's own recommended permission baseline — plus three nits inline.
All three blocking items from the previous round are genuinely fixed. I checked each against the tree rather than the description:
security_cross_ref.tool/.ecosystemare now declared inprojects/_template/project.md, with the Tools-enabled row and the TOC entry to match.tool.md § Consuming skillsis reframed as an intended roadmap that is not yet wired, and all four skill links resolve — includingskills/dependency-audit/, which I confirmed exists.- The registry row no longer advertises untracked extension points.
Both nits are fixed too: the SPDX header now precedes the doctoc block, and the PR checklist no longer claims a Python package.
Verified rather than assumed. I ran the documented example against the live API: GHSA-7rjr-3q55-vv33 returns exactly the aliases and summary the doc prints, and looking the record up by its CVE alias also returns 200, so the "(or alias)" claim in get-vuln holds. The vendor-neutrality block regenerates correctly at 10/11, and a full prek run against the rebased branch is green, lychee included.
Two notes that are not requests.
- The new contract ships an implementation with no
tools/security-cross-ref/spec directory. That is not a rule violation — six of the eleven contracts have no directory either — so it is a maintainer call whether the NVD extension point wants something to implement against before a second backend arrives. - Related:
tool.md § When to replace this tool with anotherstill offers "NVD Direct" as an option, while the registry now tracks no extension point for it. Worth reconciling whichever way you prefer.
The branch has been rebased onto current main and force-pushed, so CI is re-running against the post-merge tree.
This review was drafted by an AI-assisted tool and confirmed by an Apache Magpie maintainer. After you've addressed the points above and pushed an update, an Apache Magpie maintainer — a real person — will take the next look at the PR. The findings cite the project's review criteria; if you think one of them is mis-applied, please reply on the PR and a maintainer will weigh in.
More on how Apache Magpie handles maintainer review: CONTRIBUTING.md § Opening a pull request.
|
Thanks for the detailed review! All inline comments have been addressed in commit 4b48520:
Regarding the |
…ing security triage (apache#311)
… and diff hygiene (apache#311)
…cision, and diff hygiene (apache#311) Register api.osv.dev with the egress gateway. The adapter egresses to api.osv.dev, but the gateway is default-deny and did not carry the host, so every recipe in tool.md would take a 403 before a socket opened for anyone running the recommended setup. ALLOW_EXACT already carries every other security-data host (cveawg.mitre.org, nvd.nist.gov, cve.org), and the container gateway hands the same allowlist to every container as its HTTP proxy. Adds the host, an osv row in the declared-surfaces table, and a case in test_allowlist.py beside cveawg.mitre.org. The osv.dev web UI is left out deliberately: a browser destination, not a tool egress. Generated-by: Claude Opus 5
…cision, and diff hygiene (apache#311) Keep the query index in the batch example. `.results[]` discards which query each result belongs to. OSV returns querybatch results in request order, so the index is the only thing tying a result back to its input; as written the example yields a list of counts with no way to tell which package each one is for. Uses to_entries so the position is carried through, and `// []` so a result object with no vulns key counts as zero rather than erroring. Generated-by: Claude Opus 5
4b48520 to
4f07268
Compare
potiuk
left a comment
There was a problem hiding this comment.
Approving. Everything from the previous two rounds is fixed, and I've taken the two remaining items myself as fixups on this branch rather than send you a fourth round for six lines.
Verified against the tree, not the description:
- Semantic line breaks — longest line in
tools/osv/README.mdis now 306 characters, down from 627, one sentence per line. - The unrelated reflow in
docs/vendor-neutrality.mdis restored to a two-line change. commit fix referencesis reworded to "vulnerabilities associated with a public upstream commit" in bothdocs/labels-and-capabilities.mdand the README lead — which also closes the precision pointonlyarnavraised.- "NVD Direct" is gone from When to replace this tool, reconciling with the registry.
I withdraw my own blocking finding from round two. I said the curl recipes couldn't run under the framework's recommended permission baseline. The Bash(curl *) deny is real, but tools/cve-org/tool.md — the precedent this adapter explicitly follows — ships the same bare curl … | jq recipes with no caveat, and no documented rule requires a tool doc to route HTTP elsewhere. That was me holding this PR to a bar the repository doesn't apply. The deny-versus-adapter-recipes inconsistency is real but repo-wide, and belongs in its own issue covering both adapters. My calibration in that thread was also wrong: I said 318 characters was the longest line in any tools/*/README.md; it's 2114.
Two fixups pushed, explained inline. I also rebased the branch onto current main and force-pushed, so CI re-runs against the post-merge tree — the same thing I did in round two.
Thanks for the patience through three rounds.
This review was drafted by an AI-assisted tool and confirmed by an Apache Magpie maintainer. The maintainer approving this PR has read the findings and signed off. If something feels off, please reply on the PR and a maintainer will follow up.
More on how Apache Magpie handles maintainer review: CONTRIBUTING.md § Opening a pull request.
Summary
tools/osv/(contract:security-cross-ref) as a read-only adapter bridging the Open Source Vulnerability (OSV.dev) database to Magpie.curl+jqoperations to resolve vulnerability aliases (CVE ↔ GHSA ↔ OSV IDs), query advisories by package/version, and verify commit fixes without leaking embargoed reports.contract:security-cross-refextension point across the registry, taxonomy docs, validator, and vendor-neutrality score.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
validate_tools(),validate_adapter_authoring(), andvalidate_capability_taxonomy_coverage()return[](0 errors)vendor-neutrality-scoredoc block indocs/vendor-neutrality.mdverified in sync (Docs in sync: True)git diff --checkpasses with zero whitespace/formatting defectsGET /v1/vulns/GHSA-7rjr-3q55-vv33→ resolves aliasCVE-2021-45046POST /v1/querywith{"package": {"name": "jinja2", "ecosystem": "PyPI"}, "version": "2.11.2"}→ returns 10 advisory recordsPOST /v1/querywith commit SHA → returns 0 vulns (valid empty result)POST /v1/querybatchwith 2 packages → returns batch results (10 + 63 vulns)RFC-AI-0004 compliance
api.osv.devandosv.dev); no credentials or privileged access required<project-config>/project.md(security_cross_ref.tool: osv)PRINCIPLES.md §3(private reproducer commits, draft CVE copy, and embargoed tracker numbers are forbidden from being sent to OSV.dev)Linked issues
Closes #311
Notes for reviewers (optional)
tools/cve-org/.tools/cve-org/(authoritative MITRE publication states) andtools/cve-tool-vulnogram/(ASF CNA record editing) by providing ecosystem advisory packages and alias resolution graphs duringsecurity-issue-triage,security-issue-deduplicate,security-cve-allocate, anddependency-audit.