Skip to content

[WIP] bazel/dependency: Add CycloneDX SBOM generation - #5638

Draft
phlax wants to merge 1 commit into
envoyproxy:mainfrom
phlax:sbom-cyclonedx
Draft

phlax wants to merge 1 commit into
envoyproxy:mainfrom
phlax:sbom-cyclonedx

Conversation

@phlax

@phlax phlax commented Nov 19, 2026

Copy link
Copy Markdown
Member

Adds SBOM generation from the dependency metadata we already keep, as a first step towards publishing an SBOM with Envoy releases (envoyproxy/envoy#49459).

  • cyclonedx_sbom in //dependency:sbom.bzl: writes a CycloneDX 1.5 JSON SBOM from the dependency JSON that cve_scan reads.
  • sbom/cyclonedx jq module: the pieces behind it (bom, component, purl, licenses, hashes, reachable).

Each dependency with a version becomes a component, with what its metadata gives:

  • a package URL: pkg:github/<owner>/<repo>@<version> for a GitHub download, else pkg:generic/<name>@<version> with the download URL;
  • cpe, unless N/A;
  • the license: a listed SPDX id (CycloneDX rejects any other as an id), an SPDX expression, or a named license;
  • a digest, from a hex sha256 or an SRI source.integrity;
  • name, description, website and download location.

Given a dependency_reachability map, only the dependencies reached in production from its roots are listed, so the SBOM describes what is built and not everything the workspace can fetch.

The output is deterministic: no serial number, and no timestamp.

Testing:

  • jq/tests/sbom/cyclonedx: 11 module tests, passing with jq/run-tests.sh.
  • //dependency/test:sbom_test and :sbom_all_test: the macro against fixtures. The expected files validate against the official CycloneDX 1.5 JSON schema. These two have not been built outside CI.

Not here: SPDX output, the dependency graph between components (they are listed flat under the subject), and anything about container images or distro packages.

phlax added a commit to phlax/envoy that referenced this pull request Nov 19, 2026
Test only: uses envoyproxy/toolshed#5638 from the fork.

Adds `//tools/dependency:sbom`, a CycloneDX SBOM of the dependencies built into
Envoy (those that `:dep-reachability` reaches in production), and prints a
summary of it in the `deps` CI job.

Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit to phlax/envoy that referenced this pull request Nov 19, 2026
Test only: uses envoyproxy/toolshed#5638 from the fork.

Adds `//tools/dependency:sbom`, a CycloneDX SBOM of the dependencies built into
Envoy (those that `:dep-reachability` reaches in production), and prints a
summary of it in the `deps` CI job.

Signed-off-by: Ryan Northey <ryan@synca.io>
Adds `cyclonedx_sbom` (`//dependency:sbom.bzl`), which writes a CycloneDX 1.5
JSON SBOM from the dependency JSON that `cve_scan` reads, and the
`sbom/cyclonedx` jq module behind it.

Each dependency with a version becomes a component, with what its metadata
gives of a package URL, CPE, license, digest and download location. Given a
`dependency_reachability` map, only the dependencies reached in production are
listed, so that the SBOM describes what is built and not everything that can be
fetched.

The output is deterministic (no serial number or timestamp).

Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit to phlax/envoy that referenced this pull request Nov 19, 2026
Test only: uses envoyproxy/toolshed#5638 from the fork.

Adds `//tools/dependency:sbom`, a CycloneDX SBOM of the dependencies built into
Envoy (those that `:dep-reachability` reaches in production), and prints a
summary of it in the `deps` CI job.

Signed-off-by: Ryan Northey <ryan@synca.io>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant