SBOM
Automated generation of a Software Bill of Materials in CycloneDX format for supply chain transparency and compliance.
Reference
Section titled “Reference”| Field | Value |
|---|---|
| Workflow | .github/workflows/release.yml (job sbom) |
| Tool | anchore/sbom-action |
| Format | CycloneDX JSON |
| Triggers | Version tags, workflow_dispatch dry-run |
What an SBOM is
Section titled “What an SBOM is”A machine-readable inventory of:
- All dependencies (direct and transitive)
- License information
- Package versions
- Supplier information
Common uses: supply chain security (EO 14028 compliance), vulnerability tracking, license compliance, and dependency auditing.
CI pipeline stages
Section titled “CI pipeline stages”During a release the sbom job in release.yml:
- Downloads the built platform binaries.
- Generates a CycloneDX JSON SBOM with
anchore/sbom-action(output${bin}-${version}-sbom.cdx.json). - Attests the SBOM with
actions/attest-sbom, binding every binary to the SBOM. - Uploads it as a build artifact and attaches it to the GitHub release.
SBOM contents
Section titled “SBOM contents”{ "bomFormat": "CycloneDX", "specVersion": "1.5", "metadata": { "component": { "type": "application", "name": "rust_template", "version": "0.1.0" } }, "components": [ { "type": "library", "name": "serde", "version": "1.0.0", "licenses": [{ "license": { "id": "MIT" } }], "purl": "pkg:cargo/serde@1.0.0" } ]}Compliance coverage
Section titled “Compliance coverage”- Executive Order 14028 — machine-readable format (CycloneDX; SPDX also acceptable to regulators), dependency enumeration, license identification, supplier information.
- NIST SP 800-161r1 — supply chain risk management.
How-to
Section titled “How-to”Generate an SBOM locally
Section titled “Generate an SBOM locally”The CI job uses anchore/sbom-action, which wraps Syft. The local equivalent is syft directly (or cargo cyclonedx for a Cargo-native CycloneDX document):
# Install syft (the engine behind anchore/sbom-action)curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
# Generate a CycloneDX JSON SBOMsyft dir:. -o cyclonedx-json > sbom.cdx.json
# View SBOMcat sbom.cdx.json | jq '.components[] | {name, version, licenses}'Alternatively, a Cargo-native CycloneDX generator:
cargo install cargo-cyclonedxcargo cyclonedx --format jsonVerify: sbom.cdx.json parses as JSON and lists component entries.
Download an SBOM from a release
Section titled “Download an SBOM from a release”# Download from a GitHub releasewget https://github.com/zircote/rust-template/releases/download/v0.1.0/rust_template-0.1.0-sbom.cdx.json
# Validate with a CycloneDX-aware toolcyclonedx validate --input-file rust_template-0.1.0-sbom.cdx.jsonVerify: the validator reports the document as valid.
Customize generation
Section titled “Customize generation”# SPDX JSON output (also accepted by regulators)syft dir:. -o spdx-json
# Restrict to a single artifactsyft dir:. -o cyclonedx-json --select-catalogers cargoVerify: the output header reflects the requested format.
Troubleshooting
Section titled “Troubleshooting”Missing dependencies — refresh the lockfile first:
cargo updatesyft dir:. -o cyclonedx-jsonLicense issues — unknown licenses appear blank or as NOASSERTION; declare your crate’s license in Cargo.toml:
[package]license = "MIT"Format errors — validate the document:
cyclonedx validate --input-file sbom.cdx.jsonVerify: validation completes without errors.
Why this matters
Section titled “Why this matters”An SBOM turns “trust us, the dependencies are fine” into a verifiable artifact. When a new CVE lands against a transitive dependency, the inventory answers “are we affected?” in seconds instead of a manual cargo tree audit, and the same document satisfies the machine-readable enumeration that EO 14028 and NIST SP 800-161r1 require. Generating it at release time and attesting it over the shipped binaries binds the bill of materials to exactly the versions that shipped, so the record reflects the released artifact rather than a drifting development tree.