RFC - SBOMs
What is an SBOM?
A Software Bill Of Materials is a list of all software components and dependencies inside a software product. It helps with security, vulnerability tracking, licensing, and software supply-chain management.
Main SBOM standards
- CycloneDX — an open standard for SBOMs and broader software/supply-chain transparency, with strong support for component inventories, dependencies, vulnerabilities, and vulnerability exploitability. Current spec: 1.7.
- SPDX — an ISO standard (ISO/IEC 5962) format for describing software components, licenses, and relationships. Current spec: 3.0.
Where the conda ecosystem stands
conda-sboms — generates sboms from
condaenvironments. It usescyclonedx-python-liband for now, focuses on the CycloneDX format (1.7). SPDX output is deliberately gated behind demonstrated consumer demand (see https://github.com/conda-incubator/conda-sboms/issues/13).rattler-build (experimental) — uses
cyclonedx-bom(caps at spec 1.5), and emits package level SBOMs at build time underinfo/sboms/, and passes recipe provided fragments through opaquely — so packages can carry anSPDXdocument produced by some external tool, withoutrattler-buildgeneratingSPDXitself.
No C/C++ CycloneDX library - mamba case options
There is no official C/C++ CycloneDX model library, so the options could be:
- Assembling JSON manually (no added dependencies, get the newest spec immediately, and full control on output, but we own conformance, which is why a schema-validation test and a regular drift check against the official bom-1.7.schema.json would be a must).
- Bind to the
cyclonedx-bomRustlibrary (typed model and built-in validation), but requires aRusttoolchain in every build environment, CI, and feedstock, downgrades us tospec 1.5, and grows the binary. - Build a C++ library generated from the official JSON schema alongside the other official
CycloneDXlibraries (native and reusable long-term since noC/C++library exists anywhere official, but it's a months-scale project we'd have to maintain). Note1: This existed but is now archived. Note2: Even with an official library, the conda specific logic (PURL conventions, channel/namespace semantics) stays handwritten — bothconda-sbomsandrattler-buildhand-roll theirs.
Work steps
- Support environment
SBOMgeneration inmamba- first inCycloneDXformat, ideally using latest spec1.7. - Support
SPDXformat: either natively inmambaalongsideCycloneDXor convert from.cdxas converters exist and can be a cheap path: cyclonedx convert, cdx-convert, cdx2spdx. Note: Converters can be lossy but nativeSPDXemission would be a second model to maintain. - Consume package embedded SBOMs from
rattler-build— when builds shipinfo/sboms/fragments, aggregate them into the completemambaenvironment SBOM. xref: https://github.com/baszalmstra/rattler-build/pull/4, https://github.com/conda-incubator/conda-sboms/issues/9, and https://github.com/conda-incubator/conda-sboms/issues/10 - Complete
SBOMincluding hidden dependencies —condametadata only describes the packages declared dependencies; it is not a complete software component inventory. It does not, by itself, tell us about statically linked libraries, vendored third-party code, or all libraries that binaries may load dynamically at runtime. To capture these, the scan could happen once, at build time — where the dependency info is known and cheap to compute — and the result shipped inside the package (info/sboms/). This is what thiscepsissue suggests, whererattler-buildcould run syft - for example - over the package directory during the build. Note: Until that is supported, we can think of having recipes runsyftthemselves and ship the output viarattler-buildopaque passthrough, once https://github.com/baszalmstra/rattler-build/pull/4 lands.
More references
- CEP 49: PURLs for conda packages
Source: mamba-org/mamba