Publishing an SBOM with every XWiki release

Hi devs,

I’d like us to publish an SBOM (Software Bill of Materials) with every XWiki release. The full design is at https://design.xwiki.org/xwiki/bin/view/Proposal/SBOMPerRelease

Why

  • Let users answer “is XWiki X.Y affected by CVE-Z?” without reverse-engineering the WAR.
  • Help companies placing XWiki-based products on the EU market meet the CRA’s SBOM obligation (from Dec 2027). The CRA only asks manufacturers for an SBOM (top-level dependencies at least, any common machine-readable format, in the technical documentation, not necessarily public); details on the design page.
  • Fewer false scanner reports (with VEX, later).

Proposal in short

  • A CycloneDX JSON SBOM attached to every deployed Maven artifact (-cyclonedx.json classifier), generated by the cyclonedx-maven-plugin in the release profile of the Commons top level POM. So Commons, Rendering, Platform and contrib extensions all get it, with a property to skip it. Normal builds are not impacted, and the existing TestRelease CI job exercises it on every build.
  • provided dependencies are excluded (they’re the container’s), XARs installed by the flavor are kept (the WAR SBOM describes the running product), and the supplier is the XWiki project.
  • JavaScript: Maven doesn’t see the npm packages Vite bundles in our webjars, and third-party webjars only appear as pkg:maven/org.webjars/..., so scanners miss npm advisories (jQuery, Bootstrap…). Proposal:
    • our webjars embed the output of pnpm sbom --prod in their JAR;
    • a new mojo in a Commons tool plugin folds these embedded SBOMs (plus third-party webjars mapped to pkg:npm) into the Artifact SBOMs, all the way up to the WAR.
  • Link the WAR’s SBOM from the download page and the release notes.
  • Ready for VEX later: every component (npm ones included) gets a stable purl and a unique, deterministic bom-ref, and VEX documents will be published separately since released SBOMs are immutable.
  • Target: complete for 18.10.2 (the cycle LTS), developed on master and backported to stable-18.10.x.

Why not just scan the WAR? I ran Syft on an 18.9 WAR: 836 Maven components and 0 npm ones, no XARs and no dependency graph. Scanners can’t see inside Vite bundles either, so they don’t remove the need for the embedded SBOMs. It’s still useful as a cross-check later.

Not proposed for now (follow-ups): SBOM in the Docker images, VEX, an instance SBOM exported by the Extension Manager (distribution + installed extensions), and SPDX. I know SPDX has been requested at least once, so it’s parked, not rejected. The CRA doesn’t mandate a format, and BSI TR-03183-2 accepts CycloneDX or SPDX.

WDYT?

Thanks

PS: This post was co-written with Claude Code.

Looks good to me, +1. Once we have that, I think we should move our CVE scanning on CI to be based on that SBOM to also cover the front-end side (or use the same metadata there, no idea).

+1

+1 as well, thanks

+1

Thanks,
Marius

Thanks all, the proposal is accepted (4 +1s, no objections).

The work is tracked by:

  • Loading... Generate a CycloneDX SBOM for every released Maven artifact
  • Loading... Fold bundled npm packages and third-party webjars into the artifact SBOMs
  • Loading... Embed an SBOM of the bundled npm packages in XWiki webjars
  • Loading... Publish an SBOM of the XWiki WAR with each release

@MichaelHamann I’ve added your suggestion (basing our CVE scanning on CI on the SBOM, to also cover the front-end) to the follow-ups on the design page: https://design.xwiki.org/xwiki/bin/view/Proposal/SBOMPerRelease

Thanks

PS: This post was co-written with Claude Code.