Skip to content

Guardrails / supply-chain

The bill of materials names a licence for what it lists ​

supply-chain/components-licensed@v1

Enough of the components in the bill of materials name a licence for the inventory to tell you what the artifact may be distributed under.

Idsupply-chain/components-licensed
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/components-licensed@v1",
              "severity": "warning",
              "with": {
                  "minPercent": "95"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs ​

InputDescriptionDefaultEnvironment variable
minPercentPercentage of components that must name at least one licence.95GUARDRAIL_INPUT_MINPERCENT

How to fix ​

Generate the bill of materials from the resolved dependency graph, not from the manifest, so the generator has the metadata it needs to read licences:

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

A component with no licence listed isn't unlicensed; nobody looked its licence up. This matters the first time someone asks whether the artifact can ship to a customer, because that question has to be answered for every component, and "unknown" isn't an acceptable answer.

More in supply-chain ​

All 6 supply-chain guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412