GitHub Action
A scored, audited SBOM on every push. Three steps, and no tokens or secrets to create, store or rotate.
Set up in 3 steps
- Install the CLI.
- In your repository, run:
This picks your project, allows this repository's workflows to upload to it, and writessbombox login sbombox init.github/workflows/sbombox.yml. - Commit and push.
That is all. To allow another repository later, run sbombox ci trust in it; sbombox ci show lists the repositories that can upload.
What every run does
- Generates an SBOM for your code and scores its quality from 0 to 10.
- Uploads it to SBOMBox with the repository, commit, branch and workflow run attached, as verified by SBOMBox, not just reported by the job.
- Shows the score, grade and any compliance results in the job summary.
- Keeps a copy of the SBOM with the run for 90 days.
- Records the upload in your organization's audit log, before any score gate fails the job, so failing runs are on record too.
The workflow
sbombox init writes this for you. To add it by hand, copy it and put in your project ID:
name: SBOM
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
id-token: write # lets the job prove who it is - no secret needed
jobs:
sbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: sbombox/action@v1
with:
project: 0193c0de-... # your project ID (not a secret)
fail-under: "7" # optional: fail below this scoreInputs
Only project is required.
project(required) - Project ID to upload to. sbombox init fills this in.fail-under(default0) - Fail the job if the score (0-10) is below this. 0 turns the gate off.profiles(optional) - Compliance profiles to check, comma-separated, e.g. ntia-2021,cra-readiness.path(default.) - Directory to scan. Ignored when image is set.image(optional) - Container image to scan instead, e.g. ghcr.io/acme/api:1.4.0. Uses the image's BuildKit SBOM if it has one, else syft. For a private registry, run docker/login-action first.platform(optional) - With image: platform of a multi-platform image, e.g. linux/arm64. Default linux/amd64.format(defaultcyclonedx) - cyclonedx or spdx.upload(defaultauto) - auto uploads when the job can sign in and skips otherwise (e.g. pull requests from forks). true or false to force.artifact-name(defaultsbom) - Name of the run artifact holding the SBOM. Give each matrix job its own. Empty to skip.generators(defaultauto) - SBOM generators to install. auto installs syft, cyclonedx-py, and cyclonedx-npm only when Node.js has an npm older than 9.5; npm 9.5+, pnpm 11.1+ and uv 0.9.11+ make SBOMs themselves. Add cdxgen for Java and Gradle.generator(optional) - Force which generator runs, in order, e.g. npm-sbom or cyclonedx-npm,syft. Empty lets SBOMBox choose; see the CLI reference.token(optional) - Only if you prefer a stored API token to keyless sign-in.output(defaultsbom.json) - Where to write the SBOM.version(defaultcurrent) - Pin a CLI version, e.g. 0.2.0. By default SBOMBox chooses the current version, and refuses pins below its supported minimum.api-url(defaulthttps://api.sbombox.com) - API URL for self-hosted deployments.
Outputs
score- Quality score, 0-10.grade- Letter grade for the score.policy-status- pass or fail, from fail-under.uploaded- true when the SBOM was uploaded.sbom-id- ID of the uploaded SBOM in SBOMBox.provenance-level- P2 when uploaded keylessly: SBOMBox verified the repository, commit and run.sbom-path- Path of the generated SBOM.
Check before you commit
Catch a low score on your machine, before CI does. sbombox check builds an SBOM, scores it and fails if the score is below your minimum. It runs offline and uploads nothing.
With pre-commit: add this to .pre-commit-config.yaml, then run pre-commit install. The check only runs when a manifest or lockfile changes.
repos:
- repo: https://github.com/sbombox/sbombox-com
rev: cli-v0.2.0
hooks:
- id: sbombox-check
args: ["--fail-under", "7"]Without pre-commit: a plain git hook, run from the repository root. It checks every commit.
printf '#!/bin/sh\nexec sbombox check --fail-under 7\n' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commitA failing commit prints the score and the three weakest checks:
SBOM score 6.4/10 (grade C), 212 components
lowest: supplier_coverage 31/212 - Components with a named supplier.
lowest: hash_coverage 120/212 - Components with at least one hash.
Score 6.4 is below 7.0. Run `sbombox score <sbom> --format detailed` to see why.Both need the CLI installed. To skip the check once, run SKIP=sbombox-check git commit (pre-commit) or git commit --no-verify. CI still checks.
GitLab and other CI
On GitLab, sbombox init prints the two lines to add to .gitlab-ci.yml. Sign-in is keyless there too.
On Jenkins, CircleCI or anything else that runs a shell, set SBOMBOX_TOKEN and SBOMBOX_PROJECT as protected variables. The CLI picks up the branch and commit from the CI system by itself:
curl -fsSL https://sbombox.com/install.sh | SBOMBOX_NO_MODIFY_PATH=1 sh
export PATH="$HOME/.local/bin:$PATH"
sbombox generate
sbombox push sbom.json
sbombox score sbom.json --fail-under 7