From 5c41dc6f090cd1d570f9b96f234573fe0fff8af2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 17:35:50 +0000 Subject: [PATCH] ci(instant-sync): block egress except the GitHub API (Hypatia RE002) The dispatch job holds FARM_DISPATCH_TOKEN and ran harden-runner in egress-policy: audit. Audit mode records traffic but never blocks it, so on this push-to-main trigger it was not containment. Hypatia RE002 rates that high, and it fails the blocking Hypatia gate on every PR. The job now runs egress-policy: block with one allowed endpoint, api.github.com:443. peter-evans/repository-dispatch (pinned 28959ce) makes a single call, POST /repos/{owner}/{repo}/dispatches, to GITHUB_API_URL, which defaults to https://api.github.com. The action is downloaded during job set-up, before harden-runner starts. #107 planned to derive the allowlist from an audit run on main. No such run exists: every instant-sync run since June ended in startup_failure. So the allowlist comes from the action's source, not from observed traffic. Action pins are unchanged, so actions.lock is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDgHt5BLAJ1gNWrw1wz --- .github/workflows/instant-sync.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/instant-sync.yml b/.github/workflows/instant-sync.yml index 01efebf..157eec5 100644 --- a/.github/workflows/instant-sync.yml +++ b/.github/workflows/instant-sync.yml @@ -18,14 +18,18 @@ jobs: env: HAS_DISPATCH_TOKEN: ${{ secrets.FARM_DISPATCH_TOKEN != '' }} steps: - # This job holds FARM_DISPATCH_TOKEN; monitor its outbound egress - # (Hypatia RE001). Audit mode first: record every endpoint without - # risking the dispatch; tighten to block+allowlist once a main run - # shows the observed set. - - name: Harden runner (egress audit) + # This job holds FARM_DISPATCH_TOKEN, so its egress is contained, not + # only monitored (Hypatia RE001/RE002). The one network call after this + # step is repository-dispatch POSTing to the GitHub REST API; the action + # itself is fetched at job set-up, before harden-runner starts. Any other + # outbound host is blocked. If a dispatch fails with a blocked-egress + # annotation, add exactly the host it names. + - name: Harden runner (egress block) uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block + allowed-endpoints: > + api.github.com:443 - name: Trigger Propagation if: env.HAS_DISPATCH_TOKEN == 'true' uses: peter-evans/repository-dispatch@v4.0.1