The bill of materials names a licence for what it lists
supply-chain/components-licensed@v1
Enough of the components the bill of materials lists name a licence that the inventory can answer what the artifact may be distributed under.
| Id | supply-chain/components-licensed |
| Version | v1 |
| Category | supply-chain |
| Default severity | warning |
| Interpreter | python3 |
| Timeout | 30 seconds |
| Violations tolerated | 0 |
| Collects | sbom |
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.
| Collector | Gathers | Inputs it is given |
|---|---|---|
sbom | The 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
{
"guardrails": {
"failOn": "error",
"comment": true,
"checks": [
{
"use": "supply-chain/components-licensed@v1",
"severity": "warning",
"with": {
"minPercent": "95"
},
"exemptions": []
}
]
}
}Inputs
| Input | Description | Default | Environment variable |
|---|---|---|---|
minPercent | Share of components that must name at least one licence, as a percentage. | 95 | GUARDRAIL_INPUT_MINPERCENT |
How to fix
Generate the bill of materials from the resolved dependency graph rather than from the manifest, so the generator has the metadata to read a licence from:
syft dir:. -o cyclonedx-json=bom.jsonA component with no licence is not an unlicensed component: it is one nobody looked up. The distinction matters the first time somebody asks whether this artifact can ship to a customer, because the answer has to be given for every line and "unknown" is not one of the acceptable answers.
More in supply-chain
supply-chain/disallowed-components. No component the bill of materials lists is one the team has decided it will not ship, whatever brought it in.supply-chain/disallowed-licenses. No component the bill of materials lists is licensed under one of the licences the team has decided it will not ship.supply-chain/no-critical-vulnerabilities. No dependency the build takes on carries an open finding at or above the severity the team gates on.supply-chain/sbom-present. An SBOM was produced for this build, so the components that went into the artifact are recorded rather than reconstructed later.supply-chain/sbom-standard-format. The bill of materials is written in a format anything else can read, and it declares which version of that format it is.