Skip to content

fix(ci): verify cosign binary sha256 checksum in rebuild-rpms - #72

Closed
castrojo wants to merge 1 commit into
mainfrom
fix/rebuild-rpms-cosign-sha256
Closed

castrojo wants to merge 1 commit into
mainfrom
fix/rebuild-rpms-cosign-sha256

Conversation

@castrojo

Copy link
Copy Markdown
Contributor

Verify the downloaded cosign v2.4.1 binary against its release SHA-256 checksum prior to installation and keyless signing in .github/workflows/rebuild-rpms.yml.

echo '8b24b946dd5809c6bd93de08033bcf6bc0ed7d336b7785787c080f574b89249b  cosign' | sha256sum -c -

Closes #46
Closes #66
Closes #68

Verify the downloaded cosign v2.4.1 binary against its release SHA-256
checksum prior to installation and keyless signing.

Closes #46
Closes #66
Closes #68
@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] CI root cause identified: packit-srpm-pilot.yml pins a packit image digest pruned from quay.io — every srpm (*) job dies with manifest unknown (exit 125), on main as well as this branch. Fix (repin to live digest 8a178425…, verified via quay API) is ready as commit 3017fe3 but the hive App lacks the workflows permission to push workflow edits. Tracked in the issue filed on this repo; needs a human push, then rebase this branch.

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] CI red is systemic, two clusters: (1) all srpm jobs fail exit 125 — the pinned quay.io/packit/packit digest was pruned upstream, filed #84 (fix ground occupied by #70 which rewrites packit-srpm-pilot.yml); (2) rebuild* / build failures (samba/gpgme hummingbird dep mismatches, fish %check, firefox) are the cluster tracked by #30. No in-branch fix available without colliding with those PRs.

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] Root cause of the rebuild/srpm failures: RPM transaction conflict between ruby3.3/ruby3.4/ruby4.0 default-gems (file conflicts on /usr/share/gems/specifications/default/*). Unblocked by utah-packages#83 (exclude legacy ruby default-gems from Hummingbird repo) — after #83 merges, rebase this branch onto main and CI should clear.


scanner agent (ACMM L5 — hold-gated mode)

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.78

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the checksum against the real upstream release. It is correct, and this is ready as far as I can tell.

The hash matches sigstore's published checksums exactly. Fetched cosign_checksums.txt from the v2.4.1 release:

$ curl -sSL https://github.com/sigstore/cosign/releases/download/v2.4.1/cosign_checksums.txt | grep cosign-linux-amd64
8b24b946dd5809c6bd93de08033bcf6bc0ed7d336b7785787c080f574b89249b  cosign-linux-amd64

against the line this PR adds:

echo '8b24b946dd5809c6bd93de08033bcf6bc0ed7d336b7785787c080f574b89249b  cosign' | sha256sum -c -

Identical. And the placement is right — after the curl, before install -m 0755 cosign /usr/local/bin/cosign, so an unverified binary never becomes executable. Worth having: this binary is what signs repomd.xml for the published repo that projectbluefin/utah consumes, and it was being fetched over the network and run with no integrity check at all.

The CI failures on this PR are entirely pre-existing on main. Worth stating plainly, because the check list looks alarming for a one-line change. This PR's run (34616966239) failed these builds:

dracut, git, tailscale, fish, openssh, mozjs140, samba, webkitgtk,
gjs, firefox, evolution-data-server, pipewire-libs-extra,
gstreamer1-plugins-bad-free

The latest scheduled run of unmodified main at the same commit this PR branches from (run 34571911239 @ 54cc8d1) failed:

gcc, dracut, evolution-ews, fish, tailscale, git, openssh,
pipewire-libs-extra, samba, evolution-data-server,
gstreamer1-plugins-bad-free, webkitgtk, mozjs140, gjs, firefox

Same set. Nothing here caused any of them. Spot-checking the causes confirms they are unrelated to cosign: dracut and git both die on the Hummingbird ruby3.3/3.4/4.0-default-gems file conflict (job 103175696635 — file /usr/bin/erb conflicts between attempted installs of ruby4.0-default-gems-4.0.6-37.3.hum1 and ruby3.3-default-gems-3.3.10-23.6.hum1), which #83 and #58 both address. fish dies in %check on three root-sensitive tests (job 103175696704).

The one failure on this PR's run that is not on the main baseline is srpm (zsh), and that is the pruned Packit digest, also unrelated:

docker: Error response from daemon: manifest for quay.io/packit/packit@sha256:149e6e06... not found: manifest unknown
##[error]Process completed with exit code 125.

#85 fixes that one.

Local gates are clean, identical to the unmodified-main baseline:

PR#72 fc=0 val=0 pytest=0 | validated 193 source RPMs | 72 passed in 0.80s
PR#72 quoting=0 runtime_contract=0 unittest=0 | validated runtime contract: 72 packages

And it does not conflict with #80, which is the other open PR touching rebuild-rpms.yml. I merged both into main and the added line survives intact:

$ git merge pr/72 && git merge pr/80
4 files changed, 642 insertions(+), 77 deletions(-)
$ grep -n "sha256sum -c" .github/workflows/rebuild-rpms.yml
375:  echo '8b24b946...249b  cosign' | sha256sum -c -

Two small suggestions, neither blocking:

  1. The version and the hash are now two separate literals that must be kept in step. A COSIGN_VERSION variable used in both the URL and a comment above the hash would make the coupling visible, and would stop a future version bump from silently leaving a stale hash that then fails the build for a confusing reason.
  2. sigstore/cosign-installer does this (and signature verification of the release itself) as a pinned action, if you would rather not maintain the hash by hand. Given this repo already pins actions by SHA, that would fit. Not worth blocking on — the explicit check is perfectly good and arguably easier to audit.

The body closes #46, #66 and #68; I have not checked that all three are fully addressed by this one line, so worth a glance before closing them out.


Generated by Claude Code

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] CI root cause: both failure classes here are systemic, not from this PR.

  1. srpm jobs fail with docker: manifest unknown (exit 125) — the pinned quay.io/packit/packit@sha256:149e6e06... digest was garbage-collected upstream when latest was republished. Fix already open: ci: repin Packit image to live digest #87 (repins to the live digest 8a178425..., verified still current as of 2026-09-12).
  2. rebuild jobs fail on ruby3.3-default-gems / ruby3.4-default-gems / ruby4.0-default-gems file conflicts in the Hummingbird repo transaction. Fix already open: fix(buildroot): exclude legacy ruby default-gems from Hummingbird repo #83 (excludes the legacy default-gems from the Hummingbird repo).

Once #83 and #87 merge and this branch is rebased, CI should validate this PRs actual changes. Note: the hive App token currently lacks the workflows permission, so agent-authored pushes touching .github/workflows/ are rejected — the repin must land via a human-pushed PR (#87).


scanner agent (ACMM L5 — hold-gated mode)

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: 860e512

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.78

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Converting my earlier COMMENTED review to an approval now that this carries lgtm — nothing has changed on the branch since I verified it (still e813e37), so the verification in my review stands as-is:

  • the hash matches sigstore's published cosign_checksums.txt for v2.4.1 byte for byte;
  • the check sits after the curl and before install -m 0755, so an unverified binary never becomes executable;
  • every CI failure on this PR is also present on unmodified main at the same base commit (54cc8d1), and the one extra (srpm (zsh), pruned Packit digest) is #85's;
  • local gates are identical to the main baseline;
  • it does not conflict with #80, the other open PR touching rebuild-rpms.yml.

The two suggestions in that review (a COSIGN_VERSION variable to couple the version and the hash, or sigstore/cosign-installer pinned by SHA) were non-blocking then and are non-blocking now — worth a follow-up, not a reason to hold a one-line integrity fix on the binary that signs repomd.xml for the repo projectbluefin/utah consumes.

One thing to check before it lands: the body closes #46, #66 and #68. I have not verified that this single line fully addresses all three, so worth a glance rather than letting them auto-close.


Generated by Claude Code

castrojo added a commit that referenced this pull request Sep 13, 2026
…e import, and contract (#71, #72, #56, #57) (#92)

* test(quality): unit coverage for validate.py and recalculate_hummingbird_gaps.py

* fix(ci): verify cosign binary sha256 checksum in rebuild-rpms

Verify the downloaded cosign v2.4.1 binary against its release SHA-256
checksum prior to installation and keyless signing.

Closes #46
Closes #66
Closes #68

* fix(tools): validate package and branch inputs in import_rawhide (#56)

* fix(contract): exclude anaconda-live from runtime transaction (#57)

---------

Co-authored-by: castrojo <castrojo@users.noreply.github.com>
@castrojo castrojo closed this in #92 Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Approved by a Hive merger/owner for auto-merge on green CI

Projects

None yet

2 participants