Repository navigation
fix(security): default non-Vulnogram CVE tools to the recipe path (#1799) - #2077
Conversation
cve-tool exits 20 (no cve_authority.tool declared), 21 (no adapter for the configured tool) and 22 (the adapter does not implement the operation). Step 0 item 5 fell through to "unexpected server-check exit N" for those or routed them through the allocate-stage fallback, while api-allocation.md documents them as the recipe path. Take that path with a reason naming the missing key, for both the server check and the allocate check.
The allocation URL may deliver the CVE ID outside the Vulnogram form (a form result, or an ID by email from MITRE), so name those channels instead of presenting Vulnogram's Allocate button as the only outcome.
Step 0 item 5 never said what an adopter whose cve_authority.tool is not vulnogram does; it now states that the API pre-flight is skipped and Step 3 takes the recipe path, making the print-the-link-and-take-the-ID flow plus a plain CVE JSON 5 record the documented default for projects allocating through another CNA. api-allocation.md carries the same scope line.
Kaap10
left a comment
There was a problem hiding this comment.
Thanks @Anurag-S1ngh.
The logic to route exits 20, 21, and 22 to the recipe path and the test additions in test_cve_allocate.py are correct.
However, CI is currently failing on the prek job (check-family-plugins).
Issue:
tools/security-management/ is a substrate tool whose runtime files are mirrored into plugins/magpie-security-tools/tools/security-management/. Because gate.py and recipe.py were edited in tools/security-management/, the copy under plugins/magpie-security-tools/ is now out of sync.
Fix:
Please run the framework helper to sync the substrate copy, amend, and force-push:
python tools/dev/check-family-plugins.py --fix
git add plugins/magpie-security-tools/
git commit --amend --no-edit
git push origin <your-branch> --force-with-leaseOnce synced, prek will pass green.
…ve-allocate pre-flight change
Kaap10
left a comment
There was a problem hiding this comment.
Thanks @Anurag-S1ngh!
The substrate mirror under plugins/magpie-security-tools/ is now properly synced with tools/security-management/, and all CI checks (including prek) are passing green.
The routing of exit codes 20, 21, and 22 to the recipe path in gate.py, the updated recipe instructions, and the unit tests in test_cve_allocate.py look solid.
LGTM!
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 guide.
Summary
cve-toolexits20(nocve_authority.tooldeclared anywhere),21(the configured tool has no adapter) and22(the adapter does not implement the check). Step 0 item 5 routed these torecipeonly by accident, through the allocate-stage fallthrough with anunexpected server-check exit Nreason, whileapi-allocation.mddocuments them as the recipe path. Both checks now take the recipe path with a reason that names the missing key.recipepath. The print-the-link-and-take-the-ID flow plus a plain CVE JSON 5 record is the documented default for projects allocating through another CNA (for example the GitHub CNA or MITRE directly).Type of change
skills/<name>/SKILL.md) - no eval fixtures exist forcve-allocate;measured_tokensre-stamped (7250)tools/security-management/)docs/,README.md,CONTRIBUTING.md)Test plan
prek run --all-files --skip workspace-pytest- passes; hooks that require Python >= 3.11 (run-workspace-check.shfor ruff/mypy/pytest,check-family-plugins,render-preflight-fixtures,skill-script-tests) fail on this machine's Python 3.9.6 identically on pristineupstream/main; the touched package passes its ownruff check,ruff format --checkandmypy.uv run --project tools/security-management --group dev pytest tools/security-management/tests- 967 passed (7 new parametrized/added preflight assertions over exits 20/21/22, including one case pinning that exit 20's reason namescve_authority.tool)check-placeholders.shOK;skill-token-count --checkcleanRFC-AI-0004 compliance
Linked issues
Closes #1799
Notes for reviewers
tools/cve-toolcontract, thecve_authority.toolselection,#1905(ASF defaults out of non-ASF drafts) and theindependentorganization manifest (tool: mitre-form,cve_tool_url: https://www.cve.org, cve.orgrecord_url_template). What remained is the cve-allocate pre-flight telling non-Vulnogram adopters nothing, with a code/doc mismatch on the20/21/22exits.[cna].org_idincve-json-config.toml(enforced bygenerate-cve-json, unchanged).tools/cve-tool-vulnogram/(the directory name, thegenerate-cve-jsondocstrings) was left out as out of scope for this issue.