Skip to content

ci: move to GitHub-hosted runner with hardened workflow - #3

Merged
mkramarczyk merged 3 commits into
masterfrom
ci-hardening
May 13, 2026
Merged

mkramarczyk merged 3 commits into
masterfrom
ci-hardening

Conversation

@kulikov

@kulikov kulikov commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Switch CI from self-hosted to ubuntu-24.04 to 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)
  • All actions pinned by full commit SHA (actions/checkout, actions/setup-go)
  • step-security/harden-runner@v2.19.1 in audit mode (egress monitoring + telemetry disabled)
  • permissions: contents: read (least privilege)
  • persist-credentials: false on actions/checkout
  • timeout-minutes: 15
  • concurrency group (cancels redundant runs on rapid pushes)
  • Go version pulled from go.mod via actions/setup-go with module cache enabled
  • go.mod bumped from 1.24 to 1.26 (go get -u ./... + go mod tidy produced no other dep changes)

Why

A public repo with runs-on: self-hosted exposes 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

  • CI passes on this PR (workflow exercises itself on pull_request)
  • Inspect harden-runner audit output in the run summary to verify egress endpoints look sane
  • After merge, confirm next push to master triggers a green CI on the new workflow

kulikov added 3 commits May 13, 2026 12:21
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
mkramarczyk merged commit 3e1f286 into master May 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants