fix: attribute weekly CVEs to PR image diff
This commit is contained in:
@@ -39,6 +39,14 @@ keeps every weekly edition looking the same regardless of which model writes the
|
||||
- **Security analysis.** Scan the per-recipe `upgrade_notes_md` + the summary (and use your own
|
||||
knowledge of the version bumps) for upgrades that fix **CVEs / security issues**. For each recipe,
|
||||
**count the CVEs** the PR fixes — this drives both the table's `cve` column and the priority sort.
|
||||
Before crediting a CVE to an open PR, compare that PR's head `compose.yml` with its **merge-base
|
||||
commit on the target branch**. Run `advisory-scan.py <recipe> --compose-from <base-sha-raw-url>
|
||||
--compose-to <head-sha-raw-url>` when an upgrade log lacks that exact scan, or when its listed
|
||||
image windows disagree with the PR diff. Credit image CVEs only for image version changes in
|
||||
that diff. A previous release or warm canonical is not the PR baseline: it can include fixes
|
||||
already present in the target branch. For example, lasuite-docs PR #11 did not change Valkey,
|
||||
so its 8.1.11→9.1.3 CVE must not be credited to that PR. Record a security-relevant config
|
||||
fix separately with direct evidence. If the PR diff cannot be verified, use `?` and explain why.
|
||||
- **ADDITIONALLY, and never instead:** each per-recipe log carries an `### Advisory scan
|
||||
(deterministic pre-step)` block (from `cc-ci-plan/advisory-scan.py` — GitHub Security
|
||||
Advisories + vendor security pages + OSV, with severities and fixed-in versions). Treat its
|
||||
|
||||
@@ -159,26 +159,21 @@ On cc-ci's `~/.abra/recipes/<recipe>` (wrap every abra call per the pseudo-TTY b
|
||||
|
||||
### 2a. Advisory scan (deterministic; ADDITIVE — run it, never skip it)
|
||||
|
||||
Run the deterministic scanner for the exact upgrade window and **paste its markdown block verbatim
|
||||
into the per-recipe log**:
|
||||
Run the deterministic scanner against the **exact proposed PR diff** and paste its markdown block
|
||||
verbatim into the per-recipe log. Use the proposed head's `compose.yml` and the commit it branches
|
||||
from (the merge base with the target branch), both pinned by commit SHA:
|
||||
|
||||
```
|
||||
python3 /srv/cc-ci/cc-ci-plan/advisory-scan.py <recipe> --from <old-app-version> --to <new-app-version> \
|
||||
[--image <name>=<old>:<new>]...
|
||||
python3 /srv/cc-ci/cc-ci-plan/advisory-scan.py <recipe> \
|
||||
--compose-from <raw-compose-url-at-pr-base-sha> \
|
||||
--compose-to <raw-compose-url-at-pr-head-sha>
|
||||
```
|
||||
|
||||
**Pass an `--image` for EVERY sidecar you upgraded** (redis, postgres, nginx …), not just the app —
|
||||
each image is judged by its own versions, and an image you don't name is not counted at all. Repeat
|
||||
the flag for each one and pass them **all in a single call** (the count is a union across images).
|
||||
e.g. discourse moving app 3.5.3→2026.7.1 *and* redis 7.4→8.10:
|
||||
|
||||
```
|
||||
... --from 3.5.3 --to 2026.7.1 --image redis=7.4:8.10
|
||||
```
|
||||
|
||||
→ 140 CVEs (123 app + 17 redis), where the redis seventeen include a **critical** (CVE-2025-49844)
|
||||
that is invisible if the sidecar is left out. `<name>` is substring-matched against source repo names,
|
||||
so make it specific enough to hit exactly one.
|
||||
Do not substitute the previous published release, warm canonical, or a hand-typed image window for
|
||||
the PR base. Those answer a different question and can credit a PR for CVEs fixed before its branch
|
||||
was created. The compose diff includes every changed image, including sidecars. If the PR changes no
|
||||
image tags, record zero image-version CVEs for this PR; assess any security-relevant configuration
|
||||
change separately, with its own evidence.
|
||||
|
||||
**If the scan reports advisories it could NOT judge, re-run it with `--adjudicate`.** That is a second
|
||||
pass: it collects each open case's full evidence (advisory prose, references, affected ranges, every
|
||||
|
||||
Reference in New Issue
Block a user