fix(vuln): scanned_sboms reflects current snapshot, not all-time coverage #14
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Motstandskraft/spam!14
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/vuln-summary-snapshot-sboms"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
/api/vuln/summary'sscanned_sbomscounted every SBOM ever scanned (cumulative — no recency/branch/liveness scoping), inflating the headline number vs. what's actually deployed today.Redefined as the org's current snapshot in both
computeSummary(unrestricted) andcomputeSummaryScoped(narrow-grant):DISTINCT ON (repo_id) ORDER BY scanned_at DESCoversbom_scan_results) — superseded commits drop out.cluster_image_inventory+db.LiveClusterExistsSQL, reusing theSPAM_CLUSTER_LIVE_WINDOWwindow). Digests no longer running anywhere drop out.last_scanned_atstays an all-time MAX.Import-cycle note:
vulnmetricscan't importscam(cyclescam → … → jobs → vulnmetrics), so the live-window SQL helper lives in the leafdbpackage (ClusterLiveWindowInterval/LiveClusterExistsSQL), reading the sameSPAM_CLUSTER_LIVE_WINDOWenv + 24h default asscam.Scope: only the live
/api/vuln/summaryvalue changes./api/vuln/trendis severity-only and untouched; historicvuln_dashboard_snapshotsrows are not recomputed (new dailies use the new definition going forward).Base: stacked on
chore/remove-material-viewsbecause it depends on that branch's derived-tables work (cluster_image_inventory, the newcomputeSummary). Retarget tomainonce #12 merges.Verified:
go vet+gofmtclean; both queriesEXPLAINcleanly against the schema.🤖 Generated with Claude Code