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

Guardrails / supply-chain

No component carries a licence the team refuses

supply-chain/disallowed-licenses@v1

No component the bill of materials lists is licensed under one of the licences the team has decided it will not ship.

Idsupply-chain/disallowed-licenses
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/disallowed-licenses@v1",
              "severity": "error",
              "with": {
                  "licenses": "AGPL-1.0,AGPL-3.0,SSPL-1.0,BUSL-1.1,CC-BY-NC,Commons-Clause,Elastic-2.0"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs

InputDescriptionDefaultEnvironment variable
licensesComma separated SPDX identifiers that are a violation. A component's licence matches when the identifier appears in it, so AGPL-3.0 covers AGPL-3.0-only and AGPL-3.0-or-later.AGPL-1.0,AGPL-3.0,SSPL-1.0,BUSL-1.1,CC-BY-NC,Commons-Clause,Elastic-2.0GUARDRAIL_INPUT_LICENSES

How to fix

Replace the components named in the violations, or record the exception deliberately by taking that licence off the list this guardrail is configured with.

A copyleft licence in a distributed artifact is a legal obligation rather than a preference: some require the source of the whole work to be offered to whoever receives the binary. Finding one at release is expensive; finding one in the pull request that added it is not.

More in supply-chain

All 6 supply-chain guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412