Skip to content

Add CVE aliases to advisory labels - #5

Merged
wagoodman-anchore merged 4 commits into
mainfrom
advisory-cve-aliases
Oct 27, 2026
Merged

wagoodman-anchore merged 4 commits into
mainfrom
advisory-cve-aliases

Conversation

@wagoodman

Copy link
Copy Markdown
Collaborator

Advisory labels didn't pair under grype --by-cve because the port from vulnerability-match-labels dropped effective_cve. This carries it back as aliases (label format 1.0.1).

  • the port writes aliases on advisory labels going forward
  • scripts/advisory_aliases.py backfills the existing ones. Where possible it uses the CVE grype actually reports for the match (a --by-cve scan of the image's SBOM), falling back to the advisory's first CVE in the DB. grype doesn't always report the first one: a match merged from the binary and source rpm reports the lowest
  • 531 of 537 advisory labels backfilled. ALAS2-2021-1710 and two FEDORA advisories name no CVE, so those 6 are left as-is
  • publishes schema-1.0.1.json and amends P-11
  • pins yardstick to current main. main reads 1.0.1 and keeps aliases but doesn't act on them yet; that needs Pair advisory labels to the CVE grype reports them as yardstick#719 and another pin bump

- label format 1.0.1: an advisory label carries `aliases`, the CVE grype's `--by-cve` reports its match as, so it pairs that match too. The verdict stays on the advisory
- the port takes it from the first CVE the advisory's DB record names (grype's own order) and writes 1.0.1
- `scripts/advisory_aliases.py` backfills committed advisory labels, which the port's reconcile leaves alone. It reads the CVE off a `--by-cve` scan of the image's SBOM where one is fetched, since grype reports a match it merged from two records (binary rpm found directly and via its source rpm) under the lowest CVE instead, and falls back to the DB's first

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- 531 of 537 advisory labels get the CVE grype `--by-cve` reports them as (grype v0.120.1, DB built 2026-10-23): 381 read off a scan of the image's SBOM, 150 from the DB's first CVE where grype no longer reports the match
- ALAS2-2021-1710 and two FEDORA advisories name no CVE, so their 6 labels stay without
- lastUpdated is untouched: aliases say how grype reports the match, not what the call is

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- `schema/matches/schema-1.0.1.json` adds `aliases` on advisory labels
- P-11: an advisory label carries the CVE `--by-cve` reports it as, so it pairs that match too. It is still never moved to the CVEs the advisory names

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman
wagoodman marked this pull request as ready for review October 27, 2026 03:20
@wagoodman
wagoodman marked this pull request as ready for review October 27, 2026 03:20
@wagoodman-anchore
wagoodman-anchore merged commit 59c9b58 into main Oct 27, 2026
6 checks passed
@wagoodman-anchore
wagoodman-anchore deleted the advisory-cve-aliases branch October 27, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants