Skip to content

ci: pin every action to a commit SHA, and BuildKit to a digest - #152

Merged
X4Applegate merged 4 commits into
mainfrom
ci/pin-actions
Oct 26, 2026
Merged

X4Applegate merged 4 commits into
mainfrom
ci/pin-actions

Conversation

@X4Applegate

@X4Applegate X4Applegate commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Draft: needs Richard's go-ahead before merge.

What

The release-docker build jobs log in with the read/write DOCKERHUB_TOKEN, so anyone who could move a floating @v4/@v7 tag could run code holding that token. This PR pins everything those jobs name:

  • Actions: every uses: in .github/workflows/*.yml (26 lines, 7 files) now names a full commit SHA with a trailing # vX.Y.Z. This is the same form as the existing docker/setup-qemu-action pin.
  • BuildKit: setup-buildx-action pins its image with driver-opts: image=moby/buildkit:v0.33.1@sha256:cec9f139….
  • SBOM scanner: sbom: true used to run docker/buildkit-syft-scanner:stable-1, a moving tag, inside the release BuildKit. It is now sbom: generator=docker.io/docker/buildkit-syft-scanner:1.12.0@sha256:ae4f3b55….
  • QEMU: setup-qemu-action gets cache-image: false, so the privileged binfmt image always comes from its digest pin and never from the Actions cache fallback.
Action Pin Release
actions/checkout 3d3c42e5… v7.0.1
actions/setup-go b7ad1dad… v7.0.0
actions/upload-artifact cf430e03… v7.0.2
docker/setup-buildx-action f87e5991… v4.4.1
docker/login-action 81c6f93d… v4.7.0
docker/build-push-action c3c9e263… v7.4.0
docker/setup-qemu-action 99012661… (already pinned) v4.4.0
softprops/action-gh-release efb35369… (annotated tag, dereferenced) v3.0.3
github/codeql-action (init, analyze) 9b325408… (annotated tag, dereferenced) v4.39.1
anthropics/claude-code-action 925afb53… (annotated tag, dereferenced) v1.0.262

Each pinned SHA is the commit the major tag pointed at today, and each pinned image digest is what the moving tag resolves to today (buildx-stable-1, stable-1). So the code that runs is the same as before.

Every SHA is on the upstream default branch, not a fork-only commit, and is signed. BuildKit v0.33.1 contains the 2026-09-30 advisory fixes.

Dependabot

The existing github-actions entry now has a 7-day cooldown. Security updates are not delayed by it. It also has two groups: release-actions (docker/* and actions/checkout, the actions that run in the jobs holding the Hub token) gets its own PR, and everything else is batched into a second PR.

Dependabot rewrites the SHA and its # vX.Y.Z comment together. It does not touch the three image digests; the release-docker.yml header explains how to bump those by hand.

Verification

  • zizmor --offline: unpinned-uses went from 25 findings to 0. actionlint: no new findings; one info-level SC2035 in release-binaries.yml was already there.
  • Build-only "Release Docker images" (push=false, caddy=true): 40223037957 for 4e2aed8 and 40224529506 for 72b5987. 3b9b597 changes only comments in the workflow and the Dependabot groups. The logs show the pinned SHAs being downloaded and the pinned BuildKit digest being pulled.
  • Build-only "Release binaries": 40223215315.
  • CI, MariaDB and CodeQL pass on this PR.
  • Reviews: one independent code review and two security reviews, then a round-2 review of the fix commit.

Rollback

git revert the three commits. Nothing outside .github/ changes.

X4Applegate and others added 4 commits October 25, 2026 20:01
The release-docker build jobs log in with the read/write DOCKERHUB_TOKEN,
yet ran actions by floating major tag (@v4, @v7), so whoever could move a
tag could run code holding that token. Every `uses:` in every workflow now
names a full commit SHA with its release as a trailing comment, matching
the setup-qemu-action pin. Each SHA is the commit the major tag pointed at
when pinned, resolved with `gh api .../git/ref/tags/<tag>` and with the
annotated tags (action-gh-release, codeql-action, claude-code-action)
dereferenced, so the code that runs today is unchanged.

setup-buildx-action also pins its BuildKit image to
moby/buildkit:v0.33.1@sha256:cec9f139..., the release buildx-stable-1
(the action's default) points at now; it carries the 2026-09-30 BuildKit
advisory fixes.

Dependabot's existing github-actions entry keeps the SHA pins and their
comments moving. It now groups them into one PR and waits a week after a
release (cooldown) before proposing it. The BuildKit and binfmt digests
are outside Dependabot's reach and are noted as manual bumps.
…roup for docker/*

`sbom: true` made BuildKit run docker/buildkit-syft-scanner:stable-1, a
moving Docker Hub tag, inside both release builds. The generator is now
named by digest (1.12.0, which is what stable-1 resolves to today), so the
SBOM attestation published with applegater/* comes from a fixed scanner.

setup-qemu-action restored the privileged binfmt image from the Actions
cache and fell back to that copy when a pull failed; cache-image: false
makes the digest pin the only source.

The header no longer claims nothing in these jobs can change: the runner's
own docker/buildx and the Dockerfiles' base images are outside the pins.
It also says how to hand-bump the three image digests and check that each
vX.Y.Z tag matches its digest. Dependabot gives the docker/* actions, which
run with the Docker Hub token, a PR of their own.
…bot group; per-image bump table

actions/checkout runs first in both token-holding jobs, before login, so its bumps now come in the same PR as the docker/* actions. The hand-bump note lists each image's moving tag next to the versioned tag to write, since binfmt (qemu-vX.Y.Z) and the SBOM scanner (X.Y.Z, no v) do not follow moby/buildkit's vX.Y.Z.
GITHUB_REF_NAME is the tag on a release (v2.68.6, unchanged) but the
branch name on a manual workflow_dispatch run. A branch like
ci/pin-actions put a / in the archive name, so mkdir created a nested
directory and the following tar -C dist could not find it. Replace / with
- in the version used for file names only.
@X4Applegate
X4Applegate marked this pull request as ready for review October 26, 2026 03:02
@X4Applegate
X4Applegate merged commit 8d4b96d into main Oct 26, 2026
7 checks passed
@X4Applegate
X4Applegate deleted the ci/pin-actions branch October 26, 2026 03:04
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