How do I generate an SBOM for CVD Portal?
CVD Portal stores, checks and scans an SBOM but does not generate one. A free open-source generator such as Syft, cdxgen or the Yocto create-spdx class makes a CycloneDX or SPDX file in the build pipeline. The file then goes to CVD Portal by a dashboard upload, a pipeline push or the GitHub connector.
Key takeaways
- Syft covers source folders, container images and an extracted root file system with one binary.
- cdxgen and the CycloneDX build plugins read the lock files of language projects.
- Yocto writes SPDX documents for each image with the
create-spdxclass. - Generate CycloneDX 1.6 or SPDX 3.0.1, the minimum versions of BSI TR-03183-2.
- A pipeline push needs the Enterprise plan. A dashboard upload works on Reporting and higher.
Give the file to CVD Portal
There are three ways to give the file to CVD Portal.
| Way | Plan |
|---|---|
| Upload it in the dashboard | Reporting and higher |
Push it from the pipeline with the SBOM push API or the release gate (cra-gate --sbom) | Enterprise |
| Connect the GitHub repository. The portal reads GitHub's dependency graph each night, so no generator is needed. See Connecting GitHub | Enterprise |
Which generator to use
| Generator | Licence | Good for |
|---|---|---|
| Syft | Apache-2.0 | One binary. Source folders, container images and an extracted root file system |
| cdxgen | Apache-2.0 | Language projects. It reads the lock files and the build tools of many ecosystems. It needs the runtime of each language, for example Java for Maven |
| The CycloneDX plugin of your build tool | Apache-2.0 | One ecosystem, with the most exact result, for example cyclonedx-maven-plugin or cyclonedx-gomod |
Yocto create-spdx | Part of the Yocto Project | Embedded Linux images built with Yocto |
Generate CycloneDX 1.6 or SPDX 3.0.1 where the tool allows it. These are the minimum versions of BSI TR-03183-2, and CVD Portal shows a TR-03183-2 report for each upload. An older version still imports, and the report lists it as a finding.
Pin the version of each generator in your pipeline. A new release can change the output.
Source code
Run the generator in the root of the repository after the dependencies are installed. A lock file gives exact versions. Without one, the SBOM has version ranges, and the portal cannot check a component without an exact version.
syft dir:. -o cyclonedx-json=sbom.cdx.json
npx @cyclonedx/cdxgen -r -o sbom.cdx.json .
Container images
Scan the image that you ship, not the Dockerfile. Syft reads the operating system packages and the language packages inside the image.
syft registry.example.com/app:2.4.1 -o cyclonedx-json=sbom.cdx.json
GitHub Actions
- uses: anchore/sbom-action@<commit sha>
with:
path: .
format: cyclonedx-json
output-file: sbom.cdx.json
- uses: porta-regulus/cra-gate@<commit sha>
with:
api-key: ${{ secrets.CVD_API_KEY }}
product-id: ${{ vars.CVD_PRODUCT_ID }}
release: ${{ github.ref_name }}
sbom: sbom.cdx.json
Pin each action by commit SHA.
GitLab CI/CD
Make the SBOM in one job, keep it as an artifact, and give it to the cra-gate component.
sbom:
stage: build
image:
name: anchore/syft:<version>
entrypoint: [""]
script:
- syft dir:. -o cyclonedx-json=sbom.cdx.json
artifacts:
paths: [sbom.cdx.json]
include:
- component: $CI_SERVER_FQDN/<group>/cra-gate/cra-gate@<version>
inputs:
product-id: <your product id>
sbom: sbom.cdx.json
Set CVD_API_KEY as a masked CI/CD variable. Other CI systems use the same two steps: run Syft or cdxgen, then run node cra-gate.mjs run --sbom sbom.cdx.json --release <label>.
Yocto
Yocto writes SPDX documents for each image when the create-spdx class is on. Recent releases of Poky turn it on by default. On an older release, add this line to local.conf.
INHERIT += "create-spdx"
Upload the SPDX document of the image. When the device also runs back-end applications, give each one its own SBOM part, for example firmware and device-api.
Firmware from a supplier
An open-source generator cannot see inside a firmware image that is not unpacked. Ask the supplier for its SBOM first. If you can extract the root file system of the image, Syft can scan the folder.
syft dir:./rootfs -o cyclonedx-json=sbom.cdx.json
A component that has no package URL, for example a vendor binary, needs a CPE with a version. Without one, the portal cannot check it. See How CPE components are checked.
Check the result
After an upload in the dashboard, open Settings, then SBOM Registry, and read the BSI TR-03183-2 conformance summary. A pipeline push returns the same report in conformance, and the minimum elements report in minimumElements. Both show missing fields, for example a component with no version or no supplier. Fix them in the generator settings rather than by hand, so the next build is right too.
Related guides
Last updated 28 November 2026.