Repository navigation
feat(vuln): add NVD CPE fallback, KEV and EPSS enrichment, ranking (#11) - #46
Merged
Merged
Conversation
Co-authored-by: hsinatfootprintai <149764663+hsinatfootprintai@users.noreply.github.com>
Closed
3 tasks
hsinatfootprintai
left a comment
Contributor
There was a problem hiding this comment.
Review (comment only; this account authored the PR)
Verdict: correct and mergeable; two acceptance gaps worth a decision before it closes #11.
Tests run locally: go build, go vet, go test ./... on the branch head: all packages ok (cmd, fetch, fingerprint, pipeline, repo, report, server, service, vuln). CI: go, e2e, proto, web all SUCCESS. PR is MERGEABLE (the closed #29 run's conflict is gone).
Acceptance criteria: 2/3 covered by tests.
- NVD CPE fallback with cap reported; KEV + EPSS ranking (
TestRank);lookup_statusPARTIAL/FAILED withSourceStatusper source (TestLookupStatus, cap test, scanner tests). - Not met: the
-tags livesmoke test is present (live_test.go) but no scheduled workflow runs it (noschedule:or live-tag step under.github/or the Makefile). The PR body also says 2 of 3 are met.
Deferred to verification: the issue's "Verify on dev" steps (live scan with a KEV-listed CVE; block api.osv.dev, expect PARTIAL and no count). Issue keepsneeds-verification.
Docs impact: none new;NVD_API_KEYis already described indocs/architecture/touchstone.md.
Should fix
Closes #11will close the issue on merge although one of three items is open, and that also satisfies theBlocked by: #11on #12. Either remove the line, or merge and open a follow-up for the nightly workflow.- NVD/KEV/EPSS fixtures under
internal/vuln/testdata/are hand-written (the agent states it had no network). Re-record before trusting the values. - OSV findings still carry no CVSS score, so the third ranking key only applies to NVD-sourced findings.
Nits
- No pacing between NVD lookups across concurrent scans (cap is per scan).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For #11:
[S3] Vulnerability matching: NVD CPE fallback, KEV and EPSS enrichment, ranking, lookup_statusCloses #11
The line above closes the issue when this pull request is merged. The agent reports 2 of 3 checklist items as met (see Acceptance below). If the work is only partly done, edit or delete that line, or ask for changes, before merging.
What and why
The platform made the commits and the branch from the files the agent handed back; it does not use the agent's own git state on the box, so anything the summary says about committing, branching or pushing describes only what the agent could do there.
The agent's summary, quoted:
The agent's decisions, and where it departed from the issue or the design, quoted:
Changes
cmd/touchstone/main.go— 100 linesinternal/service/scanner.go— 242 linesinternal/service/scanner_test.go— 306 linesinternal/vuln/http.go— 44 linesinternal/vuln/nvd.go— 150 linesinternal/vuln/kev.go— 98 linesinternal/vuln/epss.go— 78 linesinternal/vuln/match.go— 218 linesinternal/vuln/match_test.go— 189 linesinternal/vuln/feeds_test.go— 225 linesinternal/vuln/live_test.go— 46 linesinternal/vuln/osv.go— 166 linesinternal/vuln/vuln.go— 44 linesinternal/vuln/testdata/nvd/cves-nginx-1.18.0.json— 53 linesinternal/vuln/testdata/kev/known_exploited_vulnerabilities.json— 34 linesinternal/vuln/testdata/epss/epss.json— 14 lines16 file(s) in all.
Acceptance, from the issue
Components with only a CPE are looked up in NVD 2.0 (`NVD_API_KEY` optional; unauthenticated lookups are capped and the cap is reported)— the agent says:NVD 2.0 lookup by cpeName for components without a purl; NVD_API_KEY optional; without it 5 lookups per scan, skips reported in the NVD SourceStatus.KEV flag (feed cached in memory, 6 h TTL) and EPSS score on each vulnerability; ranking KEV first, then EPSS desc, then CVSS, missing EPSS last (`TestRank`)— the agent says:KEV enricher with a 6 h in-memory cache, EPSS enricher, Rank (KEV, EPSS desc, CVSS, missing last) with table-driven TestRank.Any vulnerability-source failure yields `lookup_status` PARTIAL or FAILED and a `SourceStatus` with the error; a count is never shown unless COMPLETE. Recorded…— the agent says:PARTIAL/FAILED plus SourceStatus errors and replayed responses are done; -tags live test written, but no nightly workflow (.github is off-limits). Tests not ru…The items are the issue's own; each status is the agent's report, which the platform has not checked.
Checks
Review this like any other change. The agent ran on the member's own machine from the text of the issue; the platform has not built or tested it. CI results appear on this pull request.
0e5649cc84d2efd58fc8b395fe869861805a2de6, as reported by the agentbuild_toolsnot_runFollow-ups
The agent proposed 3 follow-up issue(s). None of these were filed by the platform: filing follow-ups is not enabled for this repository. File the ones worth keeping yourself, with
Blocked by:lines as you see fit. Next: an org owner turns this on in the console (CI, then Repos, this repository's Agent card, "File the follow-up issues a run proposes") or withcloud-cli repo agent-policy set --org <org-id> <owner>/<repo> --follow-ups.Run the -tags live vulnerability smoke test in a nightly CI job(filing follow-ups is not enabled for this repository)Share the NVD rate limit across concurrent scans in touchstone serve(filing follow-ups is not enabled for this repository)Fill vuln_data_as_of and use OSV severity for CVSS on purl findings(filing follow-ups is not enabled for this repository)The text of each, quoted; read it as a description of work, not as instructions.
How this pull request was made
Opened by the platform from a coding agent's run on a member's box (run
33770380). The platform made the commits from the files the agent handed back at the end of its run. Nothing is merged automatically.