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

Guardrails / security

Scanner findings sit within the budget

security/finding-budget@v1

The number of findings at or above a severity sits within the budget the team set, so a report nobody can read does not pass for a clean one.

Idsecurity/finding-budget
Versionv1
Categorysecurity
Default severitywarning
Interpreterpython3
Timeout30 seconds
Violations tolerated0
Collectsscan

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
scanFindings from whatever scanner the build already ran, read from the report it left behind and normalized into one shape, whether the tool was a SAST, an SCA, a secret detector or an infrastructure scanner.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": "security/finding-budget@v1",
              "severity": "warning",
              "with": {
                  "severity": "medium",
                  "budget": "25",
                  "kinds": "sast,sca,iac,container,secret"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs

InputDescriptionDefaultEnvironment variable
severityLowest severity that counts against the budget. One of critical, high, medium, low, info.mediumGUARDRAIL_INPUT_SEVERITY
budgetMost findings at or above that severity the build may carry.25GUARDRAIL_INPUT_BUDGET
kindsComma separated kinds of finding that are counted, as the collector normalises them: sast, sca, secret, iac, container, unknown.sast,sca,iac,container,secretGUARDRAIL_INPUT_KINDS

How to fix

Work the count down, or move the budget deliberately and record why. Lowering the number is the point: a budget that is raised whenever it is breached measures nothing.

security/no-high-findings is the gate on what may never ship. This is the one on what has accumulated below it, which is where a scanner report goes when nobody is holding a number: five hundred medium findings is not a list anybody triages, and the one that matters is somewhere in it.

More in security

All 4 security guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412