Software Bill of Materials (SBOM)

An SBOM is a formal, structured list of all components, libraries, modules and dependencies (both open-source and proprietary) used to create a software application. It acts as a ‘list of ingredients’ for software and provides transparency across the entire software supply chain. A detailed SBOM contains information on component versions, suppliers, licence details and often also on known security vulnerabilities (CVEs – Common Vulnerabilities and Exposures).

This list can be used for rapid identification of vulnerabilities in components used and for verification of licence terms.

SBOMs are frequently created in standardised machine-readable formats such as SPDX or CycloneDX. They are becoming increasingly important due to regulatory requirements, such as the EU Cyber Resilience Act (CRA).

SBOM generation in the Ka-Ro BSPs

The Ka-Ro distros (karo-minimal, karo-wayland, karo-xwayland, karo-x11) of both BSPs (see Yocto Guide) already enable SBOM generation by default via their distro configuration (meta-karo-distro):

INHERIT:remove = "create-spdx"
INHERIT += "create-spdx-3.0"
SPDX_INCLUDE_VEX = "current"
INHERIT += "vex"

This means that every image built with a Ka-Ro distro automatically produces an SBOM in SPDX 3.0 (JSON-LD) format, with vulnerability metadata (VEX, OpenVEX) embedded — no changes to conf/local.conf are required. See CVE Management for details on the VEX/CVE integration and on scanning the SBOM with open-source tools such as VulnScout.

When building with a non-Ka-Ro distro (e.g. a plain Poky distro), enable SBOM generation manually:

  1. Add the following to conf/local.conf:

    INHERIT += "create-spdx-3.0"
    

    Note

    create-spdx (without suffix) selects SPDX 2.2, while create-spdx-3.0 selects SPDX 3.0.1 (JSON-LD), which is what the Ka-Ro distros use. Yocto only generates SBOMs in SPDX format; CycloneDX can be produced from the SPDX data with external tools (e.g. VulnScout).

  2. Compile the image.

Output locations

After a build, the generated SPDX documents can be found in the build directory:

Location

Content

tmp/deploy/spdx/3.0.1/

One SPDX document per built recipe/package (the individual “ingredients”).

tmp/deploy/images/<machine>/<image>-<machine>.spdx.json

The combined image SBOM (SPDX 3.0 JSON-LD), referencing the rootfs and all image files. Includes embedded VEX vulnerability metadata (SPDX_INCLUDE_VEX = "current").

SBOM detail level

You can control the level of detail in the SBOM using variables in your local.conf:

Variable

Description

SPDX_PRETTY = “1”

Formats the JSON files for readability (indentation), which increases the file size.

SPDX_INCLUDE_SOURCES = “1”

Adds descriptions of the source code files.

SPDX_ARCHIVE_SOURCES = “1”

Archives the actual source code together with the SBOM (useful for licence compliance).

SPDX_ARCHIVE_PACKAGED = “1”

Creates archives of the files that have ended up in the destination packages.

A detailed description of all the features of Yocto’s SBOM generation can be found on the website Creating a Software Bill of Materials.