Export a Software Bill of Materials¶
All packages in build outputs appear in a software bill of materials (SBOM). Gradient can export the SBOM as a CycloneDX 1.6 JSON file. Scanners use the file. License audits use the file.
Requirements:
- A build with the status
CompletedorSubstituted - A cache with the build outputs
1. Download the SBOM¶
- The menu entry stays grey until the build has outputs.
- Public projects need no token.
2. Read the Contents¶
| Field | Content |
|---|---|
metadata.component |
The derivation name of the build, with the evaluated commit as version |
components |
Every store path in the runtime closure of the build outputs |
name, version, purl |
Package name and version from the derivation, e.g. pkg:nix/hello@2.12.3 |
hashes |
The SHA-256 NAR hash |
licenses |
The meta.license of an entry point, as an SPDX id where Nix knows one |
properties |
nix:store_path, nix:nar_size and the nix:attribute of an entry point |
dependencies |
Runtime references between the store paths |
- Compilers don't land in the file. Neither do other build-time dependencies.
- Only entry points get a
meta.licensefrom Gradient. Dependencies show up with no license.
Incomplete SBOM
Gradient knows the references of a path only after the path reached the cache. A path missing from the cache appears without hashes and dependencies. The compositions entry then says incomplete and the property gradient:complete is false.
Verify Deployment¶
Browsers save <derivation name>-sbom.cdx.json. The CycloneDX CLI can validate that file against the schema.