Skip to content

Guardrails / supply-chain

The bill of materials is in a standard format ​

supply-chain/sbom-standard-format@v1

The bill of materials uses a standard format other tools can read, and declares which version of that format it follows.

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

Collectors ​

This guardrail doesn't gather anything itself. It relies on the collectors below, which the CLI runs once per build before any check, and reads what they found from GUARDRAIL_FACTS. If a collector collects nothing, this guardrail is skipped, not failed.

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

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

Configuration ​

json
{
  "guardrails": {
      "failOn": "error",
      "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 the format it follows.trueGUARDRAIL_INPUT_REQUIRESPECVERSION

How to fix ​

Write the bill of materials as CycloneDX or SPDX, not in the scanner's own format:

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

An inventory is only useful if whatever consumes it, possibly years later, can still read it, and that consumer is rarely the tool that wrote it. A format with no declared version causes 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