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

Guardrails / supply-chain

No component the team refuses is in the artifact

supply-chain/disallowed-components@v1

No component the bill of materials lists is one the team has decided it will not ship, whatever brought it in.

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

Inputs

InputDescriptionDefaultEnvironment variable
componentsComma separated component names or package URL fragments that are a violation, such as event-stream,pkg:npm/left-pad. Empty means the team has named none and the guardrail skips.``GUARDRAIL_INPUT_COMPONENTS

How to fix

Remove the components named in the violations. One that arrived transitively is removed by excluding it where it was pulled in, and by naming the replacement explicitly:

kotlin
implementation("com.acme:service") {
    exclude(group = "org.abandoned", module = "parser")
}
implementation("org.maintained:parser:2.1.0")

This guardrail is the list the team keeps of what it has already decided against: a package that was withdrawn, one that was taken over, one an incident was traced to. Without it the decision lives in the memory of whoever made it.

More in supply-chain

All 6 supply-chain guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412