Add CVE product status surface for never-shipped packages - #93
atomicturtle wants to merge 3 commits into
Conversation
rockythorn
left a comment
There was a problem hiding this comment.
Review: Conditional approve (pending #91, two non-blocking notes)
Tests pass, no merge conflicts with main (including recently merged #88 and #97). This is a well-scoped feature that fills the CVE visibility gap without touching updateinfo or creating empty-package RLSAs.
Architecture: solid
The three-status model (fixed / not_shipped / under_investigation) with the 14-day rematch window is well-reasoned. The priority system (fixed > under_investigation > not_shipped, never downgrade fixed) prevents status thrashing.
New DB table follows the migration convention (apollo/migrations/, -- migrate:up/down, CHECK constraint, indexes). Schema.sql updated to match.
API surface is clean:
/api/v3/cves/and/api/v3/cves/{cve_id}— straightforward status queries/api/v3/vex/cves/{cve_id}— OpenVEX document with correctnot_shipped → not_affectedmapping/api/v3/vex/products/{product_name}— product-scoped VEX summary- Updateinfo intentionally excluded (comment-only change) — correct, scanners shouldn't see status-only entries as package fixes
Workflow plumbing is complete:
CveStatusIndexWorkflowin cveindexer for standalone classificationRhRematchWorkflowchains: clear blocks → rematch → classifyclear_rh_blocks_for_productproperly decorated with@activity.defn- Both workers (
rpmworker,cveindexer) register the activities
Verified
bazel test //apollo/tests:test_cve_statuspasses- Migration SQL matches ORM model and schema.sql
- No merge conflicts with main (post #88 + #97 merges)
- Status priority constants are tested
- VEX mapping tested (not_shipped → not_affected, not "affected")
- Updateinfo exclusion tested (no /cves route on updateinfo router)
Non-blocking notes
1. Upsert loop performance (lines 210-233): The classifier does individual SELECT + UPDATE/INSERT for each CVE inside a transaction. With ~12k CVEs per product (mentioned in the PR description), this is ~24k queries per product. Works but could be 100x faster with a bulk INSERT ... ON CONFLICT via raw SQL. Fine for a background Temporal activity that runs infrequently — flag it as a follow-up if classification takes too long in practice.
2. shipped_package_names_for_product accesses _package_name directly (line 75): It then manually replicates _clean_package_name's module prefix stripping (lines 79-81). If the cleaning logic changes in AdvisoryPackage, this code would drift. Consider calling AdvisoryPackage._clean_package_name() instead of inlining the logic.
Dependency on #91
The PR description states "Does not include the EVR≥ matcher from #91" — the classifier itself doesn't need #91, but the RhRematchWorkflow is designed to be run after the EVR matcher lands. The classification logic and API surface can merge independently, but the rematch workflow is most useful once #91 is in.
Once #91's Python 3.9 compat fix lands, both can merge (in either order for the code, but run rematch after #91 in prod).
Materialize fixed/not_shipped/under_investigation via classifier, API, and OpenVEX export so resf#73 gaps are visible without empty updateinfo RLSAs.
Include the new activities and routes in library srcs, run test_cve_status in CI, and map not_shipped to OpenVEX not_affected so scanners are not told the CVE is fixed. Signed-off-by: Scott R. Shinn <scott@atomicorp.com>
Avoid drifting module. prefix stripping; note bulk upsert as a follow-up if classify gets slow.
|
Addressed the non-blocking review notes:
Also rebased onto current `main`. Ready once #91 lands. |
124937a to
dc4af24
Compare
Summary
fixed/not_shipped/under_investigationper supported product.GET /api/v3/cvesandGET /api/v3/vexexpose that. Updateinfo is unchanged (package-bearing RLSAs only).not_shipped→not_affectedso scanners are not told the CVE is fixed.Does not include the EVR≥ matcher from #91.
Test plan
bazel test //apollo/tests:test_cve_statusapollo/migrations/20260826180000_add_cve_product_statuses.sqland run classifyGET /api/v3/cves/{CVE}returns per-product statusesGET /api/v3/vex/cves/{CVE}has no package fix list fornot_shipped/under_investigationGET /api/v3/updateinfo/...is unchanged (no status-only RLSAs)