Release hardening: signed checksums, isolated Mac builds, one-step release #22
Loading…
Reference in a new issue
No description provided.
Delete branch "board/957-4c39a3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 secretRELEASE_SIGNING_KEYand 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 thekey=line ofdocs/install(throughpackaging/verify.shin 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 … | shfail on every Mac without Homebrew.ssh-keygen -Y verifyships 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*orrust-toolchain*sits in any parent of it or in$HOME(packaging/check-build-dir.sh), installs Rust next to it, and builds withenv -iand a system-only PATH, so inheritedRUSTC_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, sotea release create --repo backmeupplz/plaintext --tag vX.Y.Z --title vX.Y.Zis 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(withtoolchain:inputs as before). Itsstablebranch is one generated commit rebuilt on top of master, which is why the oldb725edapin got orphaned.Review round (Opus). The Mac build sets
xcrun_nocache=1, because otherwiseccresolves 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--clobberand 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.shagrees. Same installer in ubuntu:24.04 with openssh-client installs and runs. Guard script trips on a planted.cargo/config.tomlandrust-toolchainin a parent. actionlint clean apart from the Forgejo-style action URLs.🤖 Generated with Claude Code