Skip to content
BETAGuardrails are in beta. The library, the configuration format and the CLI command can still change.

Guardrails / supply-chain

The bill of materials is in a standard format

supply-chain/sbom-standard-format@v1

The bill of materials is written in a format anything else can read, and it declares which version of that format it is.

Idsupply-chain/sbom-standard-format
Versionv1
Categorysupply-chain
Default severitywarning
Interpreterpython3
Timeout30 seconds
Violations tolerated0
Collectssbom

Collectors

This guardrail gathers nothing itself. It depends on the collectors below, which the CLI runs once per build before any check, and reads what they found out of GUARDRAIL_FACTS. A collector that collects nothing skips this guardrail rather than failing it.

CollectorGathersInputs it is given
sbomThe components a build says it ships, read from the bill of materials it already wrote, whether that is CycloneDX or SPDX, JSON, XML or tag-value, normalized into one list carrying the licence each component names.none

The inputs above are this guardrail's own, passed straight through. Configuring one in buildnote.json changes what is collected, and two guardrails configured the same way share the one collection.

Configuration

json
{
  "guardrails": {
      "failOn": "error",
      "comment": true,
      "checks": [
          {
              "use": "supply-chain/sbom-standard-format@v1",
              "severity": "warning",
              "with": {
                  "formats": "cyclonedx,spdx",
                  "requireSpecVersion": "true"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs

InputDescriptionDefaultEnvironment variable
formatsComma separated formats that are accepted.cyclonedx,spdxGUARDRAIL_INPUT_FORMATS
requireSpecVersionWhether the document must declare which version of that format it is written to.trueGUARDRAIL_INPUT_REQUIRESPECVERSION

How to fix

Write the bill of materials as CycloneDX or SPDX rather than as the scanner's own shape:

bash
syft dir:. -o cyclonedx-json=bom.json
trivy fs --format cyclonedx --output bom.json .

An inventory only has value if the thing that consumes it years from now can still read it, and that consumer is rarely the tool that wrote it. A format with no declared version is the same problem one step later: nothing can tell which fields it was allowed to leave out.

More in supply-chain

All 6 supply-chain guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412