Repository navigation
test(supply-chain): exploitability survives scan to gate on both routes - #1574
Merged
Merged
Conversation
Contract test for the #1462/#1463 fields: a finding carrying inKev, epss, epssPercentile, and the KEV date/ransomware fields reaches vuln-gate intact via the pre-scanned findings path (scan-vulnerabilities output wired into the gate's findings input) and via the gate-scans-for-you path with an inline fake VulnScanner. Verified at the decision point through the suppression report, the warnings list, and VulnGateFailedError's blocking findings. Also pins the negative space: a scanner reporting no exploitability data (the real trivy capture) reaches the gate with all six fields undefined, explicitly not false and not 0; and applyVex passes unsuppressed findings through by reference, dropping nothing. Fixes the two stale doc comments in vuln-scan.ts that pointed at a nonexistent ./__tests__/mock-vuln-scanner.ts — the real pattern is an inline fake, which these tests use. Hermetic throughout: fixture stdout only, no live scanner, network, or vuln DB. Closes #1464
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.
Phase 1 of epic #1461, second half. Depends on #1462 (#1561) and #1463 (#1573), both merged. Proves the data gets there; gate behavior on it is #1465 — after this merges a KEV finding still changes no outcome, which is expected.
What
New
packages/core/src/components/verbs/exploitability-roundtrip.test.ts— six hermetic tests over the real captured fixtures from #1463 plus inline fake scanners:scan-vulnerabilitiesoutput wired intovuln-gate'sfindingsinput, with the KEV finding's fields verified at the decision point twice — once via the suppression report (VEX suppresses the criticals so the gate passes and reports them), once viaVulnGateFailedError.blockingwhen they block on severity as before.VulnScanner; asserts the reported finding is the same object reference, nothing rebuilt it.undefined— assertednot.toBe(false)andnot.toBe(0)explicitly, so the tri-state is pinned by tests.applyVexpasses unsuppressed findings through by reference and drops no keys.Also
Fixed the two stale doc comments in
vuln-scan.tspointing at./__tests__/mock-vuln-scanner.ts, a file that does not exist — they now describe the inline-fake pattern the tests actually use.No live scanner, network, or vuln DB in any test.
Closes #1464