Skip to content

ci(build): Generate a CycloneDX SBOM for each release binary - #3502

Closed
Mattbusel wants to merge 1 commit into
getsentry:masterfrom
Mattbusel:use-sbom-attest
Closed

Mattbusel wants to merge 1 commit into
getsentry:masterfrom
Mattbusel:use-sbom-attest

Conversation

@Mattbusel

Copy link
Copy Markdown

Description

A sentry-cli release ships ten binaries, and their SHA-256 sums are in the release registry, but there is no SBOM for them. #1781 asked for "hashsums and sboms with signatures" next to the release artifacts; the registry covers the hash part, not the SBOM part. So someone scanning sentry-cli for advisories cannot tell from the release that the Linux and Windows binaries statically link libcurl 8.21.0, or that the Linux ones also statically link OpenSSL 3.6.3 (the static-curl / static-ssl features in Cargo.toml).

What this changes (.github/workflows/build.yml only, +48 / -1):

  • A new sbom job that runs after linux, sign-macos-binaries and windows. It installs sbom-attest 0.2.0 with cargo install --locked (about 50s), downloads the artifact-bin-* binaries and runs sbom-attest generate --target <triple> --binary <file> once for each of the nine thin binaries.
  • Each SBOM is CycloneDX 1.6: dependencies and features resolved for that binary's target (cargo metadata and cargo tree), crate SHA-256 from Cargo.lock, the system libraries, frameworks and DLLs the binary loads, and the SHA-256 of the binary as shipped. The job runs after macOS signing, so the macOS hashes are of the signed files.
  • The files are uploaded as artifact-sbom and named sentry-cli-<OS>-<arch>.cdx.json. merge now waits for the job and picks the artifact up through its artifact-* pattern. The names already match the includeNames of the github, gcs and registry targets, so .craft.yml does not change; the registry will list them the same way it lists the npm tarballs. node, python, npm-distributions and the snapshot release only download artifact-bin-*, so checksums.txt, the wheels and the npm packages are unchanged.
  • No SBOM for Darwin-universal. sbom-attest takes one target per run, and the two Darwin targets resolve different crates (apple-catalog-parsing only on arm64, openssl-src only on x86_64), so either single target would be wrong for the fat binary. Its two halves are covered. If you want a file for it too, I can add multi-target support to sbom-attest.
  • The job is not gated on is-snapshot, so the snapshot builds from master run it before a real release does.

How I tested it: build.yml does not run on PRs, so on Linux at 7214fdc I ran the Generate SBOMs block, extracted from the YAML as is, against the binaries from the 3.8.3-snapshot.20261116.7214fdc pre-release, which were built from that commit. All nine SBOMs were written (387 to 416 components each) in about 68s, and the SHA-256 recorded in each one matches the downloaded binary. sbom-attest check scores them 91.6 to 93.3 out of 100 against the CISA 2026 SBOM minimum elements; the main missing element is a signature. actionlint reports nothing new (only the existing macos-26 runner label it does not know yet).

sbom-attest is my crate (MIT OR Apache-2.0). I maintain it and will keep it current, and the version is pinned here so nothing changes under you without a PR. If you would rather not install a third-party tool in the release pipeline, I understand; happy to adjust the approach.

Issues

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Add an `sbom` job that runs after the Linux, signed macOS and Windows
builds. It installs sbom-attest 0.2.0 and writes one CycloneDX 1.6 SBOM
per shipped binary, with dependencies resolved for that binary's target,
crate hashes from Cargo.lock, and the SHA-256 of the binary as released.
The files are named sentry-cli-<OS>-<arch>.cdx.json, so the existing
craft includeNames publish them next to the binaries.
@Mattbusel
Mattbusel requested review from a team and szokeasaurusrex as code owners November 18, 2026 03:10
@szokeasaurusrex

Copy link
Copy Markdown
Member

Hi @Mattbusel, per the notice in our README, we are no longer actively developing this CLI, and we are only accepting PRs in exceptional circumstances.

This CLI is soon to be replaced by the new Sentry CLI. If you feel similar SBOMs would be helpful there, please feel free to contribute to the new CLI.

I will clarify our contributing guidelines to more clearly state our policy on this repository.

@Mattbusel

Copy link
Copy Markdown
Author

Makes sense, thanks for the pointer to the new CLI.

szokeasaurusrex added a commit that referenced this pull request Nov 18, 2026
### Description
External PRs keep arriving here (most recently #3502), despite the
notices in the README and the bug report template that this repo is no
longer under active development.

- `CONTRIBUTING.md` now states that the repo is no longer under active
development and that only bug fixes for two cases are accepted: a
serious regression from a recent release, or a fix needed because a
fundamental limitation in the new CLI prevents upgrading to it (after
first reporting the blocker to the new CLI). Contributors must open a
bug report and get maintainer confirmation first. All other PRs will be
closed. Maintenance work by maintainers is exempt. Security issues must
be reported through the security policy, not through issues or PRs.
- The previous `CONTRIBUTING.md` content (integration test docs) moves
unchanged to `tests/integration/README.md`.
- `AGENTS.md` gets a mandatory section: before making any change, agents
check whether the user is a maintainer (`getsentry` org membership and
commits to this repo). If not, they first confirm the user means this
legacy repo and not the new CLI in `getsentry/toolkit`, then explain the
policy and ask how the change meets it. If the user insists on a change
that does not meet it, the agent proceeds only after warning that the PR
will likely be closed.

Open decision: whether to drop the new-CLI blocker case and keep only
the regression case.

<!-- junior-request-attribution:start -->
via @szokeasaurusrex.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3Aaa55a7c5d1eb7fb82450b757 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3Aaa55a7c5d1eb7fb82450b757)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Aaa55a7c5d1eb7fb82450b757/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
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.

2 participants