hex/.github/workflows/installers.yml
Dax f9ab7b5a9c
Security: sign Linux releases, lock the installers, vendor the release client, pin actions and download hosts (#370)
From the 2026-10-29 security review:
- H1: Release signs each Linux executable with Anomaly's ed25519 key (HEX_RELEASE_SIGNING_KEY, .github/release/sign-linux.sh, which refuses a key that does not match linux-signing.pub) and publishes the signature as the linux-<arch>-sig target. The updater (updater/linux.rs SIGNING_KEY) and install-linux.sh refuse an executable without a valid signature over its SHA-256, before downloading it. Installed builds that predate this ignore the extra target, so the transition needs nothing from them.
- H3: the installers move to the locked .github/release/ (CODEOWNERS @thdxr); the Installers workflow publishes them from a sparse checkout of that directory.
- M1: the release service client is vendored as .github/release/release-client.sh instead of piping anoma.ly/release/client.sh into bash.
- M2: check-windows.yml gets permissions: contents: read; every third-party action is pinned by SHA.
- M3: resolve_url accepts only URLs on the manifest's host.
2026-10-29 11:06:30 -04:00

68 lines
2.6 KiB
YAML

name: Installers
# Serves the current install scripts at the production URLs the README names,
# https://anoma.ly/hex/files/install-linux.sh and install-windows.ps1, from
# the hex-production-files bucket. Those keys held the 2.3.1 installers;
# nothing reads them but people following install instructions (the 2.3.1
# updaters read the feeds and appcast, which stay frozen). The installers read
# the release service, so they install the stable release, or the newest dev
# build until there is one.
#
# The installers live in the locked .github/release/ (CODEOWNERS: Dax), so a
# change to them needs Dax's review. check runs their tests without secrets;
# publish runs in the release environment, checks out only .github/release/
# at the same commit, and uploads the installers from there as data with
# .github/release/r2-put.sh.
on:
push:
branches: [dev]
paths:
- .github/release/install-linux.sh
- .github/release/install-windows.ps1
workflow_dispatch:
permissions:
contents: read
concurrency:
group: installers
cancel-in-progress: false
jobs:
check:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Test the installers
run: |
sh scripts/test-install-linux-release.sh
pwsh -NoProfile -Command "[void][ScriptBlock]::Create((Get-Content -Raw .github/release/install-windows.ps1))"
publish:
needs: check
runs-on: ubuntu-24.04
environment: release
env:
HEX_RELEASE_BUCKET: hex-production-files
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
sparse-checkout: /.github/release/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Upload them
env:
R2_ACCESS_KEY_ID: ${{ vars.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
run: |
in=.github/release
sh .github/release/r2-put.sh install-linux.sh "$in/install-linux.sh" text/x-shellscript "public, max-age=300"
sh .github/release/r2-put.sh install-windows.ps1 "$in/install-windows.ps1" "text/plain; charset=utf-8" "public, max-age=300"
for name in install-linux.sh install-windows.ps1; do
curl -fsS -H 'Cache-Control: no-cache' "https://anoma.ly/hex/files/$name?check=$GITHUB_RUN_ID" | cmp - "$in/$name"
echo "https://anoma.ly/hex/files/$name is the current installer." >> "$GITHUB_STEP_SUMMARY"
done