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

Guardrails / supply-chain

The build produced a software bill of materials

supply-chain/sbom-present@v1

An SBOM was produced for this build, so the components that went into the artifact are recorded rather than reconstructed later.

Idsupply-chain/sbom-present
Versionv1
Categorysupply-chain
Default severityerror
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-present@v1",
              "severity": "error",
              "with": {
                  "minComponents": "1"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs

InputDescriptionDefaultEnvironment variable
minComponentsFewest components an SBOM must name to count. A document naming nothing is a file, not an inventory.1GUARDRAIL_INPUT_MINCOMPONENTS

How to fix

Generate an SBOM in the pipeline and leave it in the workspace before buildnote guardrails runs:

bash
syft dir:. -o cyclonedx-json=bom.json

Gradle and Maven have plugins that write one from the resolved graph, which is more accurate than scanning the tree. An absent SBOM is the violation: the question this answers is "which releases contain package X at version Y", and it is asked on the day the next Log4Shell lands, when reconstructing it is far too slow.

More in supply-chain

All 6 supply-chain guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412