Skip to content

Release images are signed keyless by the release workflow, and the release check verifies the signatures - #407

Merged
zlareb1 merged 31 commits into
mainfrom
feat/release-image-signing
Nov 8, 2026
Merged

zlareb1 merged 31 commits into
mainfrom
feat/release-image-signing

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Both release images, ghcr.io/clickhouse/loom and ghcr.io/clickhouse/loom-extractor, carry a keyless cosign signature from the release workflow, so cosign verify with the release workflow's identity proves an image came from that release's tag.

Why

A user pulling a release image has nothing to check it against except the registry's word. A keyless signature made by the release run ties each image's digest to release.yml on that tag, through GitHub's OIDC identity and the public transparency log, with no key to keep or rotate.

Scope and risk

  • Signing. docker-tag outputs the index digest it made for each image, and a new sign job (the only image job with id-token: write; the registry jobs keep theirs) signs exactly those digests in the run that tagged them. A run on a tag whose images are already out (the registry dispatch, a re-run of all jobs) signs nothing.
  • Verifying. Every run, the tagging run included, then verifies each image's X.Y.Z tag against the release workflow's identity with scripts/release/verify_signatures.sh, so a wrong identity, an unreadable signature or an image tag moved since fails before the GitHub Release, PyPI, npm and the MCP Registry, which wait for sign. The images are tagged before sign, so they are out unsigned between the two jobs, or until a re-run with Sigstore down.
  • Recovery and retention. A failed tag or signature is recovered by re-running the failed jobs of the run that tagged, within 30 days; the scanned-* and release-files artifacts are kept 30 days to match (a dry run's one day), unless the repository's artifact retention limit is shorter, which the release process names. The hand-tagging recovery for a half-tagged version is gone: a hand-tagged image could never carry the release workflow's signature. The image list is one IMAGES per workflow, kept equal by a unit test.
  • scripts/release/verify_signatures.sh VERSION IMAGE... runs cosign verify on each image's X.Y.Z tag with the certificate identity https://github.com/ClickHouse/loom/.github/workflows/release.yml@refs/tags/vX.Y.Z and GitHub's OIDC issuer. sign calls it, and so does a new signatures job in .github/workflows/release-check.yml.
  • docs/operations/deployment.md's container images section carries the verify command. docs/development/release-process.md says what sign signs and how release-check verifies it, with the command a user can run (cosign 3 or later, as the pinned installer's cosign v3.0.6 stores the signature that way); a release published before the workflow signed carries none, so a check of it fails its signatures job.
  • A dry run never reaches sign or release-check, so nothing here runs before the first real tag push. The release process's prerequisites list artifact retention of at least 30 days, and say to make the next tag a release candidate until a release has been signed: a candidate never moves :latest, so a fault in the first signing run costs a candidate number.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: reverting stops signing; signatures already in the registry stay beside their digests.

Tests

  • tests/unit/test_release_preflight.py: test_the_workflow_images_are_the_docker_matrix_images (the workflow's IMAGES); test_only_sign_and_the_registries_get_an_oidc_token (the jobs with id-token: write are sign, pypi, npm and mcp-registry); test_the_tag_run_signs_the_digests_it_made_and_every_run_verifies_them (sign signs $DIGESTS from docker-tag's outputs only when docker-tag succeeded; the verify step runs unconditionally and calls verify_signatures.sh).
  • tests/unit/test_release_preflight.py: test_each_image_is_verified_against_the_release_workflows_identity runs verify_signatures.sh against a stub cosign and reads the exact arguments; test_an_image_that_does_not_verify_fails_with_the_recovery (and stops at the first image); test_a_missing_version_or_image_is_a_usage_error; test_release_check_verifies_every_image_the_release_signs_with_the_same_script (the script, inputs.version, and the release's IMAGES).
  • tests/unit/test_release_job_paths.py: sign runs on a tag push, a dispatch and a re-run on a tag whose images are out, not in a dry run; a failed sign publishes nothing, on a new tag or a published one, for a tag push and a dispatch alike.
  • tests/unit/test_release_preflight.py::test_the_sign_step_signs_each_digest runs the sign step under bash -e with a stub cosign: each digest is signed once, and it stops at the first failure. test_only_sign_and_the_registries_get_an_oidc_token also checks there is no workflow-level id-token.
  • tests/unit/test_docker_quickstart_smoke.py::test_docker_tag_tags_both_scanned_images_and_refuses_one runs the tagging step against a stub docker and checks it writes digests=<image>@<index digest> … to GITHUB_OUTPUT, and nothing when an inspect fails.
  • make format lint pass. The full unit suite passed locally at 42233a4 (30462 passed); the later commits change tests, docs and one step id, and CI's unit jobs run the suite at the head. sigstore/cosign-installer@6f9f1778… is the commit tag v4.1.2 names, and its action.yml defaults to cosign v3.0.6.
  • Never run yet: the signing step and the signatures job; their first run is the first real tag push.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand: none are affected.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships bumps both plugin manifests' version: none.
  • The frontend builds, if frontend/ changed: unchanged.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers.
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

zlareb1 and others added 30 commits November 8, 2026 03:06
…lease check verifies the signatures

docker-tag signs each joined index digest with cosign, using the run's
GitHub OIDC identity, so the certificate names release.yml and the tag.
release-check verifies both images against that identity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ned image is signed by the next run

sign runs after docker-tag succeeds or when the images are already out, signs
the index each version tag names, and github-release needs it. Its image list
and release-check's are pinned to the preflight's; the release-process page
says releases before 1.2.0 carry no signature.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…dry-run list, and the verify command names cosign 3

IMAGES moves to release.yml's env, which the preflight and sign read;
github-release needs only what it reads. A test pins which jobs get an OIDC
token, the release-check test owns its image list, and a failed sign on a
published tag publishes nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…g publishes unsigned, and the tests pin the full certificate identity

deployment.md's container images section links the verify command. The OIDC
permission check is a test of its own, and the release-check signature test
sits with the file's other release-check test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…age list has its own test, and the sign step's VERSION is pinned

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…d the docs name both images' signatures and where the verify command is

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ged before they are signed, and which publishes wait for the signature

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… tag verifies them instead of signing what the tag names

docker-tag outputs each image's index digest, and sign signs exactly those. On
a published tag, sign verifies the release workflow's signature, so a tag moved
since, or a run that tagged without signing, fails before the GitHub Release
and the registries; re-running the tag run's failed jobs signs what it tagged.
The operator page carries the verify command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…he same attempt signs, and the path tests' docstrings say a published tag is verified

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…un's failed jobs within 30 days, and the hand-tagging recovery is gone

A hand-tagged image can never carry the release workflow's signature, so the
procedure is deleted, and past that window the page says to release a new
version. The deployment page says older releases carry no signature, the sign
steps have ids the test reads, and the header is one paragraph.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…warns against re-running one that did not tag

The verify step's test pins the full identity and issuer, the error quotes both
button labels, and the header wraps at one width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ing run included, against release-check's identity

The verify step runs after signing too, so a wrong identity or an unreadable
signature fails before the GitHub Release. Step 6 links one recovery section,
which names the run never to re-run and gives the :latest command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…unverifiable signature is not reported as a missing one

The verify error and published_images.sh's half-tagged error name the run that
tagged, the 30 days and the recovery section. Step 9 links the deployment page
for the verify command, the job is named for both steps, and a test pins the
line that writes docker-tag's digests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… and both errors name the problem and link the recovery

The header says every run verifies both version tags, and the guard for an
empty digest list, which the verify step already covers, is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…e release's files are kept 30 days too

scripts/release/verify_signatures.sh owns the identity and issuer; the sign job
and release-check call it, and its tests run it against a stub cosign. The
release-files artifact a re-run also needs gets the same retention as the
scanned images. The header and the recovery list read cleanly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…tep has one test, and failure paths are checked on a tag push too

The script's header no longer claims the tagging run verifies signed out, the
unquoted image and digest lists carry the same shellcheck note as preflight's,
and a failed verify stops at the first image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…cks its signature, and verify_signatures.sh has one usage error

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…check for a release from before signing; the header wraps at one width

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…lainly, and the test docstring names verify_signatures.sh

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…est, the dry run's one-day artifacts are documented, and the sign steps lose their comments

The recovery names the repository's artifact retention limit; the test checks
that docker-tag outputs each image as image@digest, the form cosign sign takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… and makes the first tag a candidate, the first run to sign

The :latest recovery chains its verify onto the digest check, so a mismatch is
the last thing printed; the recovery bullet is reflowed, release-check loses a
comment its step name repeats, and the digest test says why it reads the shell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…e, the retention row names where to set it, and the candidate advice holds until a release is signed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…igests it outputs, and the job test follows github-release's needs through sign

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ks a failed inspect writes no digests, and leaves the job graph to the path tests

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…st and the signature as two steps

A test keeps the sign job's login on the same condition as its signing step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ack at, step 8 moves :X.Y too, and the sign step runs under test

The OIDC test also checks the workflow-level permissions, and the retention row
says where it is set in the prerequisite column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…tag, step 8 moves :X.Y only for a final, and the cosign stub is one helper

The recovery bullets lead with their conditions, the sign job's login has an
id the test reads, and the sign step test is parametrized.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…verifies, the never-move rule names the X.Y.Z tag, and step 8 says github-release waits for verified signatures

published_images.sh's half-tagged error names the common recovery; the sign
step test states the exit code it expects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…t check fails on an empty digest, and the half-tagged error reads as one instruction

Step 8 and the clean-up paragraph are rewrapped, and the clean-up no longer
calls the build unsigned, since step 8's downgrade case also reaches it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…index, which is what to verify and pin

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ify and pin

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 12b907b into main Nov 8, 2026
32 of 33 checks passed
@zlareb1
zlareb1 deleted the feat/release-image-signing branch November 8, 2026 06:41
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