ci: move to GitHub-hosted runner with hardened workflow - #3
Merged
Merged
Conversation
Switch from self-hosted to ubuntu-24.04 to remove the fork-PR attack surface on a public repo. Add SHA-pinned actions, step-security/harden-runner in audit mode, permissions: contents: read, persist-credentials: false, job timeout, and a concurrency group.
Signed-off-by: Dmitry Kulikov <kulikov.dm@gmail.com>
`go get -u ./...` and `go mod tidy` produced no other changes — direct and transitive dependencies are already at their latest stable versions. `go test ./...` still passes.
mkramarczyk
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switch CI from self-hosted to
ubuntu-24.04to remove the fork-PR attack surface on this public repository, and add standard supply-chain hardening to the workflow itself. Also bump to Go 1.26.What changed
runs-on: self-hosted→runs-on: ubuntu-24.04(immutable, pinned)actions/checkout,actions/setup-go)step-security/harden-runner@v2.19.1inauditmode (egress monitoring + telemetry disabled)permissions: contents: read(least privilege)persist-credentials: falseonactions/checkouttimeout-minutes: 15concurrencygroup (cancels redundant runs on rapid pushes)go.modviaactions/setup-gowith module cache enabledgo.modbumped from 1.24 to 1.26 (go get -u ./...+go mod tidyproduced no other dep changes)Why
A public repo with
runs-on: self-hostedexposes the maintainer's runner infrastructure to fork-PR code execution. The recent TanStack npm supply-chain incident demonstrated the chain: fork PR /pull_request_target→ cache poisoning → OIDC token extraction from the runner process. Moving the public CI to disposable GitHub-hosted runners eliminates that class of attack entirely. The hardening additions (SHA-pinning, harden-runner audit, persist-credentials: false) close the secondary risks that remain even on GitHub-hosted runners.Test plan
pull_request)harden-runneraudit output in the run summary to verify egress endpoints look sane