Public: anyone can read this; the crew can change it.

EPSS scores on /advisories #17272

opened this

Merged 32h 51m ago, live in production

The hourly advisory refresh now scores each mirrored advisory that has a CVE id with its EPSS probability, and findings carry it. test/security-osv.test.ts passes (23 tests), tsc --noEmit is clean and the gate is green. I ran no other tests, so the check will run the rest on this push.

Notes

opened this

The hourly advisory refresh now scores each mirrored advisory that has a CVE id with its EPSS probability, and findings carry it. test/security-osv.test.ts passes (23 tests), tsc --noEmit is clean and the gate is green. I ran no other tests, so the check will run the rest on this push.

What changed

  • EPSS fetch: the refresh asks api.first.org/data/v1/epss for up to 300 CVEs a pass, 100 per request. A score is asked for again after a day. A CVE FIRST has no row for is stamped and retried the same way. The answer is bounded and every score is validated as 0..1.
  • Findings: a finding gets an optional epss field. Within one severity, the likelier-exploited finding sorts first.
  • Terminal: the Dependencies row reads like high, EPSS 4.30%.
  • Egress: api.first.org is added to forge.json egress. A gate refusal is reported in the gate's words, like the other feeds.
  • Tests and docs: a new test covers parsing, the daily cadence and the ordering. Two existing #17141 tests changed, because they assumed the refresh makes no other calls: one now expects the new scored field, the other counts only non-FIRST calls. docs/features/security-osv.md is updated.

Not done

  • There is no /advisories page, and docs/features/advisories.md doesn't exist; #17141 put the feeds into the dependency scan instead. EPSS therefore shows in the API and the terminal, not a new page.
  • No percentile is stored.
  • The CISA KEV flag is still not built.

Reuse: I reused answerOf, wordsOf, limited, cveOf, readDoc and writeWhole from feeds.ts. I did not run scripts/similar.ts.

Try it: open a repository, then Dependencies in the terminal palette. Rows show EPSS once an hourly refresh has run.

Closes #17142

commented

The hourly advisory refresh now scores each mirrored advisory that has a CVE id with its EPSS probability, and findings carry it. test/security-osv.test.ts passes (23 tests), tsc --noEmit is clean and the gate is green. I ran no other tests, so the check will run the rest on this push.

What changed

  • EPSS fetch: the refresh asks api.first.org/data/v1/epss for up to 300 CVEs a pass, 100 per request. A score is asked for again after a day. A CVE FIRST has no row for is stamped and retried the same way. The answer is bounded and every score is validated as 0..1.
  • Findings: a finding gets an optional epss field. Within one severity, the likelier-exploited finding sorts first.
  • Terminal: the Dependencies row reads like high, EPSS 4.30%.
  • Egress: api.first.org is added to forge.json egress. A gate refusal is reported in the gate's words, like the other feeds.
  • Tests and docs: a new test covers parsing, the daily cadence and the ordering. Two existing #17141 tests changed, because they assumed the refresh makes no other calls: one now expects the new scored field, the other counts only non-FIRST calls. docs/features/security-osv.md is updated.

Not done

  • There is no /advisories page, and docs/features/advisories.md doesn't exist; #17141 put the feeds into the dependency scan instead. EPSS therefore shows in the API and the terminal, not a new page.
  • No percentile is stored.
  • The CISA KEV flag is still not built.

Reuse: I reused answerOf, wordsOf, limited, cveOf, readDoc and writeWhole from feeds.ts. I did not run scripts/similar.ts.

Try it: open a repository, then Dependencies in the terminal palette. Rows show EPSS once an hourly refresh has run.

commented

Dependency findings now carry an EPSS score from api.first.org, fetched in batches during the OSV mirror refresh. I pushed a fix for the one failure this pull caused; the other three I did not fix.

The fix. test/deadends.test.ts ("every instruction names a script or a tool that exists") read the literal /data/v1/epss in src/security/feeds.ts as a dead repository path. The request URL now uses an EPSS_PATH constant, so the same URL is requested. After the change test/deadends.test.ts and test/security-osv.test.ts pass, and bun x tsc --noEmit is clean. The forge's check hasn't run on the new push yet.

The other three failures:

  • test/git-sweep-14780.test.ts: the check log says it is also red on main at dd5bb60, so it isn't counted against this pull.
  • test/boot-production.test.ts: it passed when I ran it here, so I treated that failure as flaky and made no change.
  • "Two landings during a running full check": I did not run or investigate it, because it isn't in a file this pull touches.

What changed.

  • src/security/feeds.ts fetches scores in batches, stamps a CVE FIRST has no row for, and asks again after a day.
  • src/security/osv.ts and the TUI dependencies screen show the score.
  • api.first.org is added to egress in forge.json.
  • docs/features/security-osv.md is updated.
  • Tests are in test/security-osv.test.ts.

Not done. No new dependencies, and the web page has no new component.

To try. Run bun test test/security-osv.test.ts test/deadends.test.ts.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs