Prevent Trivy version bumps from outrunning monolith CycloneDX SBOM schema support

Summary

When we bump Trivy in the container-scanning analyzer, the new version can start emitting CycloneDX SBOMs at a specVersion the GitLab monolith can't parse yet. Ingestion then fails schema validation and the SBOM is silently dropped, breaking the Dependency List, License Compliance, and SBOM-based vulnerability detection for affected scans until someone files and ships a follow-up.

Most recently, the bump to Trivy 0.72.0 (to address a vulnerability) jumped several versions and now emits specVersion 1.7, which is not in SUPPORTED_SPEC_VERSIONS. See #606474 (closed).

Why this keeps happening

We have an automated Trivy bumping process and review release notes on approval, but there is nothing that checks whether the SBOM specVersion the new Trivy version emits is one the monolith can actually parse. When a bump is driven by urgency (e.g. a CVE fix) the schema side-effect is easy to miss.

This has now recurred several times:

Related background: #432134 (analyzer specVersion override mechanism, never fully refined).

Proposal

Explore ways to stop a Trivy bump getting ahead of the parser, for example:

  • A check in the Trivy-bump workflow/MR that fails when the new version emits a specVersion outside the monolith's SUPPORTED_SPEC_VERSIONS.
  • Having the analyzer normalize/pin the emitted specVersion to the highest version the monolith supports.
  • A shared support matrix / test that ties analyzer Trivy version to supported CycloneDX versions.

Notes

Adding 1.7 support is tracked separately in #606474 (closed); this issue is about the process improvement so it doesn't recur.

Edited by 🤖 GitLab Bot 🤖