Release hardening: signed checksums, isolated Mac builds, one-step release #22

Merged
backmeupplz merged 7 commits from board/957-4c39a3 into main 2026-11-28 00:51:36 +00:00
Owner

Pipeline hardening from the security audit (board #957), before the first release. Nothing here tags or publishes anything.

Signed checksums. The release job writes SHA256SUMS and signs it with the release key into SHA256SUMS.sig, an SSH signature (ssh-keygen -Y sign -n plaintext-release). The private key is the repo secret RELEASE_SIGNING_KEY and is only used in that job, which runs in a fresh container on hetzner-main, never on the shared Mac. docs/install, the Homebrew job and the Docker job all check the signature against the public key on the key= line of docs/install (through packaging/verify.sh in the jobs), and refuse files it didn't sign. The landing page shows the key with the commands to check a download by hand, and CI fails if the landing and the installer disagree on it.
Why SSH signatures rather than minisign: minisign isn't on a clean Mac, and macOS's LibreSSL can't verify Ed25519, so a minisign check would make curl … | sh fail on every Mac without Homebrew. ssh-keygen -Y verify ships with macOS and with openssh-client on Linux (OpenSSH 8.1+).

Isolated Mac builds. The build job no longer uses actions/checkout into the persistent workspace. It clones the exact commit into a new temp directory with git's global and system config switched off, stops if .cargo/config* or rust-toolchain* sits in any parent of it or in $HOME (packaging/check-build-dir.sh), installs Rust next to it, and builds with env -i and a system-only PATH, so inherited RUSTC_WRAPPER/RUSTFLAGS/RUSTUP_* and planted binaries on PATH don't apply. Archives go to a fresh directory, not the workspace, and their SHA-256 is printed in the build log. The remaining risk (tampering with the runner program, its node or other user-writable state outside /usr and /System) is written down at the top of the workflow.

One-step release. The workflow now runs on release: published, so tea release create --repo backmeupplz/plaintext --tag vX.Y.Z --title vX.Y.Z is the whole release. It attaches the files to that Forgejo release instead of creating a second one, waits for the push mirror to carry the tag before creating the GitHub release, and pre-releases skip Homebrew and Docker.

dtolnay/rust-toolchain is pinned to master df2a88e (with toolchain: inputs as before). Its stable branch is one generated commit rebuilt on top of master, which is why the old b725eda pin got orphaned.

Review round (Opus). The Mac build sets xcrun_nocache=1, because otherwise cc resolves the linker through Xcode's lookup cache in the runner user's temp directory, which an earlier job could rewrite. The clone also ignores git's attributes files. The publish step can be re-run: the GitHub release is created as a draft, its files are uploaded with --clobber and then it is published, and files the Forgejo release already has are skipped. The Mac temp directory (clone, toolchain, build) is removed after each job. The workflow header now spells out the risks that remain: repo secrets reach any branch pushed here, the installer accepts an older signed release served as latest, GH_MIRROR_TOKEN can push to the GitHub mirrors, and rustup isn't pinned by checksum.

Tests: installer under dash against a local fake release with a throwaway key: good signature installs; tampered SUMS, missing .sig, another key, wrong namespace, tampered tarball and no ssh-keygen all exit non-zero with nothing installed; packaging/verify.sh agrees. Same installer in ubuntu:24.04 with openssh-client installs and runs. Guard script trips on a planted .cargo/config.toml and rust-toolchain in a parent. actionlint clean apart from the Forgejo-style action URLs.

🤖 Generated with Claude Code

Pipeline hardening from the security audit (board #957), before the first release. Nothing here tags or publishes anything. **Signed checksums.** The release job writes SHA256SUMS and signs it with the release key into SHA256SUMS.sig, an SSH signature (`ssh-keygen -Y sign -n plaintext-release`). The private key is the repo secret `RELEASE_SIGNING_KEY` and is only used in that job, which runs in a fresh container on hetzner-main, never on the shared Mac. `docs/install`, the Homebrew job and the Docker job all check the signature against the public key on the `key=` line of `docs/install` (through `packaging/verify.sh` in the jobs), and refuse files it didn't sign. The landing page shows the key with the commands to check a download by hand, and CI fails if the landing and the installer disagree on it. Why SSH signatures rather than minisign: minisign isn't on a clean Mac, and macOS's LibreSSL can't verify Ed25519, so a minisign check would make `curl … | sh` fail on every Mac without Homebrew. `ssh-keygen -Y verify` ships with macOS and with openssh-client on Linux (OpenSSH 8.1+). **Isolated Mac builds.** The build job no longer uses actions/checkout into the persistent workspace. It clones the exact commit into a new temp directory with git's global and system config switched off, stops if `.cargo/config*` or `rust-toolchain*` sits in any parent of it or in `$HOME` (`packaging/check-build-dir.sh`), installs Rust next to it, and builds with `env -i` and a system-only PATH, so inherited `RUSTC_WRAPPER`/`RUSTFLAGS`/`RUSTUP_*` and planted binaries on PATH don't apply. Archives go to a fresh directory, not the workspace, and their SHA-256 is printed in the build log. The remaining risk (tampering with the runner program, its node or other user-writable state outside /usr and /System) is written down at the top of the workflow. **One-step release.** The workflow now runs on `release: published`, so `tea release create --repo backmeupplz/plaintext --tag vX.Y.Z --title vX.Y.Z` is the whole release. It attaches the files to that Forgejo release instead of creating a second one, waits for the push mirror to carry the tag before creating the GitHub release, and pre-releases skip Homebrew and Docker. **dtolnay/rust-toolchain** is pinned to master `df2a88e` (with `toolchain:` inputs as before). Its `stable` branch is one generated commit rebuilt on top of master, which is why the old `b725eda` pin got orphaned. **Review round (Opus).** The Mac build sets `xcrun_nocache=1`, because otherwise `cc` resolves the linker through Xcode's lookup cache in the runner user's temp directory, which an earlier job could rewrite. The clone also ignores git's attributes files. The publish step can be re-run: the GitHub release is created as a draft, its files are uploaded with `--clobber` and then it is published, and files the Forgejo release already has are skipped. The Mac temp directory (clone, toolchain, build) is removed after each job. The workflow header now spells out the risks that remain: repo secrets reach any branch pushed here, the installer accepts an older signed release served as latest, GH_MIRROR_TOKEN can push to the GitHub mirrors, and rustup isn't pinned by checksum. Tests: installer under dash against a local fake release with a throwaway key: good signature installs; tampered SUMS, missing .sig, another key, wrong namespace, tampered tarball and no ssh-keygen all exit non-zero with nothing installed; `packaging/verify.sh` agrees. Same installer in ubuntu:24.04 with openssh-client installs and runs. Guard script trips on a planted `.cargo/config.toml` and `rust-toolchain` in a parent. actionlint clean apart from the Forgejo-style action URLs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Release hardening: signed SHA256SUMS, fresh isolated Mac builds, release on tea release create, dtolnay pin on master
All checks were successful
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 2m52s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 3m7s
CI / wasm (pull_request) Successful in 2m59s
CI / check (pull_request) Successful in 3m44s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 7m59s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 9m42s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 9m10s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
e73fe1de85
- SHA256SUMS.sig is an SSH signature by the release key (secret RELEASE_SIGNING_KEY, used only in the
  containerised release job); docs/install, the Homebrew job and the Docker job refuse sums it didn't sign,
  and the landing shows the public key (CI checks it matches docs/install).
- The build job clones into a new temp dir without git config, stops on .cargo/config* or rust-toolchain*
  in any parent or $HOME, installs Rust next to it and builds with env -i and a system-only PATH.
- The workflow runs on release: published, so tea release create is the whole release step; pre-releases
  skip Homebrew and Docker.
- dtolnay/rust-toolchain pinned to a master commit: stable is rebuilt on top of master, orphaning its commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Homebrew and Docker jobs say they only run on a release
All checks were successful
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 1m29s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 1m35s
CI / wasm (pull_request) Successful in 2m37s
CI / check (pull_request) Successful in 3m40s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 7m1s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 7m17s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 8m0s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
0695713b36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Release: no xcrun cache or git attributes on the Mac build, re-runnable publish, temp dirs removed, limits written down
All checks were successful
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 4m56s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 5m22s
CI / check (pull_request) Successful in 2m40s
CI / wasm (pull_request) Successful in 2m11s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 6m31s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 8m7s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 7m36s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
130d379bdf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into pr22
Some checks failed
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 4m39s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 5m10s
CI / check (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Has been cancelled
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Has been cancelled
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Has been cancelled
release / release (pull_request) Has been cancelled
release / homebrew (pull_request) Has been cancelled
release / docker (pull_request) Has been cancelled
ad9f142518
Release re-runs replace assets with sums last, guard again before cargo, installer dir after checks
All checks were successful
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 5m22s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 5m22s
CI / check (pull_request) Successful in 5m4s
CI / wasm (pull_request) Successful in 2m9s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 7m39s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 8m18s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 8m18s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
6f8565623a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Release builds only on v* releases, clear mirror-race error, named downloads, OpenSSH package names, absolute git/curl
All checks were successful
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 5m1s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 5m9s
CI / check (pull_request) Successful in 3m33s
CI / wasm (pull_request) Successful in 3m18s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 8m43s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 9m57s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 6m19s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
a2cce1f2ce
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xcrun_nocache for the macOS git stub, token hint in the mirror error, Alpine note
All checks were successful
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 3m52s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 4m12s
CI / check (pull_request) Successful in 3m51s
CI / wasm (pull_request) Successful in 1m50s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 7m15s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 8m28s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 9m3s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
7723ce2537
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
backmeupplz deleted branch board/957-4c39a3 2026-11-28 00:51:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
backmeupplz/plaintext!22
No description provided.