Generate an SBOM in CI/CD: Syft, Trivy, cdxgen
As of 5 min read
An SBOM maintained by hand is out of date after the next release. Generate it in the build instead – with proven free tools that exist for almost every environment, from web back ends to firmware. This guide shows which tool fits which project and how the SBOM is then checked automatically.
Why in the build
Annex I, Part II, point 1 requires manufacturers to identify and document vulnerabilities and components, including by drawing up an SBOM in a commonly used machine-readable format covering at the very least the top-level dependencies. This applies from 11 December 2027. The reporting obligation under Art. 14 has applied since 11 September 2026 – and a current SBOM per version is the fastest way to know which products are affected by an actively exploited vulnerability.
- The SBOM matches exactly what you ship, because it comes from the same build.
- Every version gets its own SBOM – important when older versions are still in use and within the support period.
- Nobody has to remember it: the build generates and hands it over with every release.
Source: Annex I, Part II, point 1 CRA · Art. 14 CRA · Art. 71(2) CRA
Which tool for what
- Syft (Anchore, Apache-2.0): reads directories, container images and archives and recognises, among others, Alpine, Debian and RPM packages as well as Go, Python, Java, JavaScript, Ruby, Rust, PHP and .NET. Outputs CycloneDX and SPDX. A good default for software and containers.
- Trivy (Aqua Security, Apache-2.0): primarily a security scanner, but it also generates SBOMs from directories and container images, as CycloneDX (JSON) and SPDX. Handy if Trivy already runs in your pipeline.
- cdxgen (CycloneDX project, Apache-2.0, npm package @cdxgen/cdxgen): many languages and package managers, for C and C++ with the bundled atom tool. Generates CycloneDX 1.7 by default.
- Zephyr: “west spdx” generates SPDX documents after the build (SPDX 2.3 by default) for the application, Zephyr, the build output and module dependencies. It requires CONFIG_BUILD_OUTPUT_META in the project.
- Yocto: the create-spdx class is active by default and writes an SPDX file per image to the deploy directory. Since Yocto 5.1 (Styhead) this is SPDX 3.0.
Nebrino reads CycloneDX 1.4 to 1.7 (JSON or XML), SPDX 2.2 and 2.3 (JSON or tag-value) and SPDX 3.0 in JSON-LD format – for example from Yocto 5.1 onwards. From SPDX 3.0, Nebrino takes packages with version, package URL, CPE and licence, as well as the dependency relationships.
Matching against vulnerability databases needs a package URL (purl) or a CPE with a version for every component. The tools above output package URLs for the packages they recognise. Add anything they do not recognise – such as libraries copied into firmware – by hand.
Dependency-Track (OWASP, open source) does not generate SBOMs itself: the platform takes in existing SBOMs, looks for vulnerabilities in them and enforces policies. So it is no alternative to the tools above, but comes after them.
Source: Syft (GitHub) · cdxgen (GitHub) · Zephyr: west spdx · Yocto: creating an SBOM · sbom-cve-check: SPDX 3.0 since Yocto 5.1 · Trivy: SBOM · Dependency-Track
Step 1: generate the SBOM
syft scan dir:. -o cyclonedx-json=sbom.cdx.jsontrivy fs --format cyclonedx --output sbom.cdx.json .cdxgen -o sbom.cdx.json .west build -d build
west spdx -d build
# Result: build/spdx/app.spdx, zephyr.spdx, build.spdx, modules-deps.spdxSource: Syft (GitHub) · cdxgen (GitHub) · Zephyr: west spdx
Step 2: upload and have it checked
Nebrino accepts the SBOM via the API, creates the version, matches the components against OSV, NVD, the CISA KEV catalogue and the European Vulnerability Database (EUVD) and reports the result straight back to the pipeline. The API token stays in your CI's secret store. The API is part of the Professional plan and included in the trial.
curl -sS --fail-with-body \
-H "Authorization: Bearer $NEBRINO_TOKEN" \
-F "sbom=@sbom.cdx.json" \
-F "product=$NEBRINO_PRODUCT_ID" \
-F "version=1.4.2" \
-F "fail_on=exploited" \
https://app.nebrino.de/api/v1/sbom \
| jq -e '.failed == false' # exit code 1 if the gate failsNebrino matches very large SBOMs in the background; the response then contains a status URL instead of the result. Ready-made templates for GitHub Actions, GitLab CI, Azure DevOps, Jenkins and a generic shell script – with waiting for background matching, retries on network errors, clear error messages and a summary in the build log – are available in Nebrino under Settings → API and CI/CD, prefilled with your product ID.
Already using Dependency-Track?
Then the pipeline does not need to generate anything twice: fetch a project's SBOM from Dependency-Track and upload it as in step 2. Dependency-Track remains your team's tool for policies and analysis; Nebrino takes care of deadlines, Art. 14 notifications and the evidence for the Cyber Resilience Act. Export the plain inventory (variant “inventory”) – Nebrino does the matching against OSV, NVD, CISA KEV and EUVD itself.
# Look up the project UUID by name and version
UUID=$(curl -sS --fail-with-body -H "X-Api-Key: $DT_API_KEY" \
"$DT_URL/api/v1/project/lookup?name=gateway-firmware&version=1.4.2" | jq -r .uuid)
# Export the SBOM as CycloneDX JSON (inventory, without vulnerabilities)
curl -sS --fail-with-body -H "X-Api-Key: $DT_API_KEY" \
"$DT_URL/api/v1/bom/cyclonedx/project/$UUID?format=json&variant=inventory" \
-o sbom.cdx.jsonBoth calls only need the VIEW_PORTFOLIO permission in Dependency-Track. From version 5.2, preferably create a dedicated service account with its own key instead of sharing a team key. Nebrino reads the export in CycloneDX 1.5 (Dependency-Track's default) directly; then follow the upload from step 2 with the same version number.
Source: Dependency-Track: REST-API v1 · Dependency-Track: file formats and export · Dependency-Track: access control and service accounts
Step 3: stop the release when it matters
With the fail_on parameter, the API response decides whether the build may continue:
- none – never stop, only upload and report;
- exploited – stop if an open vulnerability is actively exploited (CISA KEV or EUVD);
- critical – additionally stop on open critical vulnerabilities.
Open means: not yet assessed as “not affected” or “fixed” (VEX). If a component is vulnerable but the vulnerability cannot be exploited in the product, record this in Nebrino with a justification – the build passes again, and the justification is part of the documentation.
Annex I, Part I, point 2(a) requires products to be made available on the market without known exploitable vulnerabilities (from 11 December 2027). A gate in the build is a simple way to check this with every release.
Source: Annex I, Part I, point 2(a) CRA
SBOM quality: BSI TR-03183-2
The German Federal Office for Information Security (BSI) describes in its Technical Guideline TR-03183-2 (version 2.1.0) which information an SBOM should contain – including CycloneDX 1.6 or later or SPDX 3.0.1 or later, creator and timestamp, and per component the licence, a SHA-512 hash and information on executables, archives and structure. It is not binding, but a good reference.
Most tools do not meet it completely without further work. For every CycloneDX SBOM uploaded in JSON format or SPDX 3.0 SBOM (JSON-LD), Nebrino shows which required fields of the guideline are missing and for how many components.
Source: BSI TR-03183
Checklist
- Choose the tool that fits the project and pin its version in the build so the SBOM stays reproducible.
- Generate the SBOM for every release tag – and for container images from the finished image, not only from the source code.
- Take the version from the Git tag so the SBOM and the shipped version match.
- Start with fail_on=exploited; switch on critical once the open findings have been assessed.
- Add missing components (copied-in libraries, binaries from suppliers) and check in Nebrino which components can be matched.
Related guides
Terms in the Cyber Resilience Act glossary
Sources
- Regulation (EU) 2024/2847, Art. 14, 71, Annex I (EUR-Lex, Official Journal)
- Syft – SBOM generator by Anchore (GitHub)
- cdxgen – SBOM generator of the CycloneDX project (GitHub)
- Zephyr Project: west spdx
- Yocto Project: Creating a Software Bill of Materials
- BSI: Technical Guideline TR-03183
First published 23 Oct 2026, last updated 17 Nov 2026. This guide reflects the wording of the regulation and the Commission’s guidelines and does not constitute legal advice.