What was wrong (A4 re-test on stage): #532 stores the purl when an alert is created, and refreshes it when a scan reports the alert again. On the log4shell target, gson went 2.8.8 → 2.8.9. Alert GHSA-4jrv-ppp4-jm57 was open at deploy time, and the first scan after the deploy already resolved it without reporting it again. It stayed purl: None, and vex.openvex.json, csaf-vex.json and vex.cdx.json showed pkg:generic/gson@2.8.8. On prod this would hit every alert open at the 0.4.6 deploy, including all of K-00001's, once it is fixed.
Fix:vex_lifecycle::backfill_purls gives each open alert without a purl the purl of its component in the stored SBOM: the same name (ignoring case) and version, matched as the exports match. It runs:
once per tenant at agent start, logged as CVE alerts got their component's purl, before any scan can resolve the alert;
at the start of every target scan, before the scan replaces the SBOM, so an alert resolved by that scan still finds its old component.
Not fixable: alerts already resolved whose component has left the SBOM, such as the stage gson alert, keep pkg:generic.
Tests:
tests/vex_lifecycle.rs against mongo:7: an alert stored without a purl gets it from the SBOM entry (name in a different case). A second run changes nothing. The component is then removed and the alert resolved. OpenVEX, CycloneDX VEX and CSAF all name pkg:maven/com.google.code.gson/gson@2.8.8, never pkg:generic/gson. An alert that was already resolved is left alone.
clippy with the CI flags (agent); fmt.
Stage re-test:
After the deploy, the agent log shows CVE alerts got their component's purl with the number of open alerts.
Take a target with an open alert: in Mongo, cve_alerts has purl set. Update the component and rescan; the alert shows Behoben.
OpenVEX, CycloneDX VEX, CSAF and the Nachweispaket name pkg:maven/… (or the matching ecosystem) for it.
**What was wrong** (A4 re-test on stage): #532 stores the purl when an alert is created, and refreshes it when a scan reports the alert again. On the log4shell target, gson went 2.8.8 → 2.8.9. Alert GHSA-4jrv-ppp4-jm57 was open at deploy time, and the first scan after the deploy already resolved it without reporting it again. It stayed `purl: None`, and `vex.openvex.json`, `csaf-vex.json` and `vex.cdx.json` showed `pkg:generic/gson@2.8.8`. On prod this would hit every alert open at the 0.4.6 deploy, including all of K-00001's, once it is fixed.
**Fix:** `vex_lifecycle::backfill_purls` gives each open alert without a purl the purl of its component in the **stored** SBOM: the same name (ignoring case) and version, matched as the exports match. It runs:
- once per tenant at agent start, logged as `CVE alerts got their component's purl`, before any scan can resolve the alert;
- at the start of every target scan, before the scan replaces the SBOM, so an alert resolved by that scan still finds its old component.
**Not fixable:** alerts already resolved whose component has left the SBOM, such as the stage gson alert, keep `pkg:generic`.
**Tests:**
- `tests/vex_lifecycle.rs` against mongo:7: an alert stored without a purl gets it from the SBOM entry (name in a different case). A second run changes nothing. The component is then removed and the alert resolved. OpenVEX, CycloneDX VEX and CSAF all name `pkg:maven/com.google.code.gson/gson@2.8.8`, never `pkg:generic/gson`. An alert that was already resolved is left alone.
- clippy with the CI flags (agent); fmt.
**Stage re-test:**
1. After the deploy, the agent log shows `CVE alerts got their component's purl` with the number of open alerts.
2. Take a target with an open alert: in Mongo, `cve_alerts` has `purl` set. Update the component and rescan; the alert shows **Behoben**.
3. OpenVEX, CycloneDX VEX, CSAF and the Nachweispaket name `pkg:maven/…` (or the matching ecosystem) for it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
#532 stored the purl on new alerts and refreshed it when a scan reported
an alert again. An alert open at the deploy whose component the first
scan after it removed (stage: gson 2.8.8 -> 2.8.9) was resolved without
ever being reported again, and its VEX/CSAF/CDX exports fell back to
pkg:generic.
vex_lifecycle::backfill_purls gives open alerts without a purl the purl
of their component in the stored SBOM (same name, case aside, and
version, as the exports match it). It runs once per tenant at agent start
and before every target scan, while the SBOM still lists the component.
Alerts already resolved with their component gone cannot be backfilled.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit ac4064daed into main2026-10-08 22:55:23 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What was wrong (A4 re-test on stage): #532 stores the purl when an alert is created, and refreshes it when a scan reports the alert again. On the log4shell target, gson went 2.8.8 → 2.8.9. Alert GHSA-4jrv-ppp4-jm57 was open at deploy time, and the first scan after the deploy already resolved it without reporting it again. It stayed
purl: None, andvex.openvex.json,csaf-vex.jsonandvex.cdx.jsonshowedpkg:generic/gson@2.8.8. On prod this would hit every alert open at the 0.4.6 deploy, including all of K-00001's, once it is fixed.Fix:
vex_lifecycle::backfill_purlsgives each open alert without a purl the purl of its component in the stored SBOM: the same name (ignoring case) and version, matched as the exports match. It runs:CVE alerts got their component's purl, before any scan can resolve the alert;Not fixable: alerts already resolved whose component has left the SBOM, such as the stage gson alert, keep
pkg:generic.Tests:
tests/vex_lifecycle.rsagainst mongo:7: an alert stored without a purl gets it from the SBOM entry (name in a different case). A second run changes nothing. The component is then removed and the alert resolved. OpenVEX, CycloneDX VEX and CSAF all namepkg:maven/com.google.code.gson/gson@2.8.8, neverpkg:generic/gson. An alert that was already resolved is left alone.Stage re-test:
CVE alerts got their component's purlwith the number of open alerts.cve_alertshaspurlset. Update the component and rescan; the alert shows Behoben.pkg:maven/…(or the matching ecosystem) for it.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p