From f193c3d4adbed7d22b9f3542607ec36bf6849074 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 17 Nov 2026 22:41:32 +0000 Subject: [PATCH 1/2] ci: attest release installers Stores a build provenance attestation for each published installer. --- .github/workflows/release-sign.yml | 24 ++++++++++++++++++++++++ .github/workflows/release.yml | 1 + RELEASING.md | 18 ++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/.github/workflows/release-sign.yml b/.github/workflows/release-sign.yml index f7bc4c17..94d1704d 100644 --- a/.github/workflows/release-sign.yml +++ b/.github/workflows/release-sign.yml @@ -16,6 +16,7 @@ name: release-sign # package macOS. Builds the installer. # sign-installer Linux. Signs the installer with the Developer ID # Installer key and notarizes it. +# attest Linux. Records which commit and run built the installer. # sign-sparkle macOS. Signs the installer for Sparkle. # publish macOS. Publishes the installer. # @@ -566,6 +567,29 @@ jobs: if: always() run: rm -f /tmp/{installer_cert.pem,apple_apikey.p8,apple_apikey.json,kmsp11_config.yaml} + # Stores a build provenance attestation for the installer: a signed, public record of the + # commit and workflow run that produced it. "gh attestation verify" checks an installer + # against it. The installer is named by the checksum sign-installer recorded, so nothing is + # downloaded here. The job holds no secrets and no other job waits for it. + attest: + name: Attest the installer + needs: sign-installer + runs-on: ubuntu-22.04 + if: >- + ${{ !cancelled() && github.repository_owner == 'coder' && !inputs.dryrun && + needs.sign-installer.result == 'success' }} + permissions: + # To sign the attestation as this workflow run + id-token: write + # To store it + attestations: write + steps: + - name: Attest + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 + with: + subject-name: Coder-Desktop.pkg + subject-digest: sha256:${{ needs.sign-installer.outputs.sha256 }} + # Sparkle, the app's updater, only accepts an installer whose Ed25519 signature verifies # against the public key built into the app. The signature covers the file as it is after # notarization, and Sparkle's signing tool only runs on macOS. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c28b55b..9c9d81b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,3 +37,4 @@ jobs: permissions: contents: write # upload the release assets id-token: write # authenticate to Google Cloud + attestations: write # record which run built the installer diff --git a/RELEASING.md b/RELEASING.md index 5cdde12b..cee0696a 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -48,6 +48,7 @@ alternate between the two: | `sign-app` | Linux | Signs the app with the Developer ID Application key, notarizes it | | `package` | macOS | Builds the installer | | `sign-installer` | Linux | Signs the installer with the Developer ID Installer key, notarizes it | +| `attest` | Linux | Records which commit and run built the installer | | `sign-sparkle` | macOS | Signs the installer for Sparkle | | `publish` | macOS | Publishes the installer and updates the appcast | @@ -64,6 +65,18 @@ Cloud KMS. The `sign-sparkle` job signs the finished installer with it, using Sparkle's own tool, which only runs on macOS. The job does nothing else, so that the key is never next to the tools `publish` downloads. +### Provenance + +The `attest` job stores a build provenance attestation for each published +installer: a signed, public record of the commit and workflow run that +produced it. To check an installer against it: + +```bash +gh attestation verify Coder-Desktop.pkg --repo coder/coder-desktop-macos +``` + +Dry runs are not attested. + ### Secrets `sign-app`, `sign-installer` and `sign-sparkle` run in the `signing` @@ -123,6 +136,11 @@ it, and it cannot leave out the `approve` job. The first job stops the run if that commit is not on `main`. The jobs come from the newest `main`, while the scripts they run come from the tagged commit. +`release.yml` has to grant every permission those jobs ask for, and a release +tag uses its own copy of `release.yml`. If a job on `main` has gained a +permission since the tagged commit, the run fails before any job starts. Tag a +newer commit instead. + The approval is a job in `release-sign.yml`, so a change to that file on `main` could sign without it. What protects against that is the review of changes to `main`. From 4bc5742546d4025b8661c80ee3d79adca25cd739 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 17 Nov 2026 23:10:03 +0000 Subject: [PATCH 2/2] docs: name the signing workflow in the attestation check --- RELEASING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index cee0696a..268d8ee9 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -72,10 +72,12 @@ installer: a signed, public record of the commit and workflow run that produced it. To check an installer against it: ```bash -gh attestation verify Coder-Desktop.pkg --repo coder/coder-desktop-macos +gh attestation verify Coder-Desktop.pkg --repo coder/coder-desktop-macos \ + --cert-identity https://github.com/coder/coder-desktop-macos/.github/workflows/release-sign.yml@refs/heads/main ``` -Dry runs are not attested. +`--cert-identity` only accepts an attestation made by `release-sign.yml` on +`main`. Dry runs are not attested. ### Secrets