Skip to content

Commit 94145f5

Browse files
authored
Merge pull request #624 from CodesWhat/ci/harden-runner-audit-on-ci-v2.3
ci(security): run harden-runner in audit mode outside release jobs (v2.3)
2 parents 031d277 + ba746b9 commit 94145f5

8 files changed

Lines changed: 188 additions & 221 deletions

‎.github/workflows/ci-verify.yml‎

Lines changed: 14 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,11 @@ jobs:
4545
outputs:
4646
docs_only: ${{ steps.filter.outputs.docs_only }}
4747
steps:
48-
# Stage 1 of the harden-runner egress rollout: `git fetch`/`git diff`
49-
# against the checked-out repo and no other tool download, so
50-
# github.com/actions endpoints are the entire footprint — identical to
51-
# the "Commit Message" job below, which already runs block mode with
52-
# this endpoint set for the same fetch-depth-0-then-read-history shape.
48+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
5349
- name: Harden Runner
5450
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
5551
with:
56-
egress-policy: block
57-
allowed-endpoints: >
58-
github.com:443
59-
*.actions.githubusercontent.com:443
52+
egress-policy: audit
6053
disable-sudo: true
6154

6255
- name: Checkout
@@ -156,49 +149,17 @@ jobs:
156149
lint-check-name: Go Lint
157150
test-check-name: Go Test
158151
run-workflow-security: true
159-
# Stage 1 of the harden-runner egress rollout (see quality-*/security-*
160-
# workflows for the rest of stage 1): zizmor only talks to ghcr.io for
161-
# its own container image plus github.com/pkg-containers for the pull —
162-
# same endpoint set drydock's own security-actions job (ci-verify.yml)
163-
# uses for this identical CodesWhat/.github go-ci.yml workflow-security
164-
# job, so this follows established org precedent rather than a guess.
165-
workflow-security-egress-policy: block
166-
workflow-security-allowed-endpoints: "ghcr.io:443 github.com:443 pkg-containers.githubusercontent.com:443"
152+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
153+
workflow-security-egress-policy: audit
167154
run-goreleaser: ${{ github.event_name != 'schedule' }}
168155
# Repository-run Qlty gate ("Go CI / Qlty Check"), which needs no Qlty
169156
# Cloud account. Distinct from the Qlty Cloud GitHub App's own statuses
170157
# (`qlty check`, `qlty coverage`, `qlty coverage diff`), which fail
171158
# org-wide on billing minutes and are never required contexts. Skipped on
172159
# the weekly schedule alongside GoReleaser, matching portwing.
173160
run-qlty: ${{ github.event_name != 'schedule' }}
174-
# Copied verbatim from portwing's proven allowlist rather than
175-
# re-derived: qlty downloads its own CLI and every plugin runtime it
176-
# resolves (node, python, go, java) on a cold runner, so a narrower list
177-
# fails on whichever plugin the default source adds next.
178-
qlty-egress-policy: block
179-
qlty-allowed-endpoints: >-
180-
api.github.com:443
181-
api.osv.dev:443
182-
api.segment.io:443
183-
api0.prismacloud.io:443
184-
dl.google.com:443
185-
files.pythonhosted.org:443
186-
github-proxy.qlty.sh:443
187-
github.com:443
188-
go.dev:443
189-
mirror.gcr.io:443
190-
nodejs.org:443
191-
objects.githubusercontent.com:443
192-
proxy.golang.org:443
193-
pypi.org:443
194-
qlty-releases.s3.amazonaws.com:443
195-
radarlint-releases.s3.amazonaws.com:443
196-
registry.npmjs.org:443
197-
release-assets.githubusercontent.com:443
198-
sum.golang.org:443
199-
tmaproduction.blob.core.windows.net:443
200-
tuf-repo-cdn.sigstore.dev:443
201-
tuf-repo.github.com:443
161+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
162+
qlty-egress-policy: audit
202163
# An empty list produces no matrix jobs at all: go-ci.yml's fuzz job
203164
# is gated on `fromJSON(inputs.fuzzers-json)[0] != null`. On a
204165
# docs-only PR that is 29 jobs and ~67 runner-minutes not spent
@@ -232,16 +193,11 @@ jobs:
232193
contents: read
233194

234195
steps:
235-
# Stage 1 of the harden-runner egress rollout: shellcheck is
236-
# runner-image-preinstalled (no tool download) and only checks out the
237-
# repo, so github.com/actions endpoints are the entire footprint.
196+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
238197
- name: Harden Runner
239198
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
240199
with:
241-
egress-policy: block
242-
allowed-endpoints: >
243-
github.com:443
244-
*.actions.githubusercontent.com:443
200+
egress-policy: audit
245201
disable-sudo: true
246202

247203
- name: Checkout
@@ -311,19 +267,11 @@ jobs:
311267
contents: read
312268

313269
steps:
314-
# Stage 1 of the harden-runner egress rollout: same job, same tool,
315-
# and the same endpoint set (including api.deps.dev for
316-
# dependency-review-action's changed-package metadata lookup) drydock
317-
# already runs in block mode for this identical job.
270+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
318271
- name: Harden Runner
319272
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
320273
with:
321-
egress-policy: block
322-
allowed-endpoints: >
323-
github.com:443
324-
api.github.com:443
325-
api.deps.dev:443
326-
*.actions.githubusercontent.com:443
274+
egress-policy: audit
327275
disable-sudo: true
328276

329277
- name: Checkout
@@ -351,19 +299,11 @@ jobs:
351299
GITLEAKS_LINUX_X64_SHA256: "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb"
352300

353301
steps:
354-
# Stage 1 of the harden-runner egress rollout: same "download a GitHub
355-
# release tarball, verify its checksum, run it" shape as drydock's own
356-
# "secrets" job, so this reuses drydock's exact block-mode endpoint set
357-
# for that pattern.
302+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
358303
- name: Harden Runner
359304
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
360305
with:
361-
egress-policy: block
362-
allowed-endpoints: >
363-
github.com:443
364-
objects.githubusercontent.com:443
365-
release-assets.githubusercontent.com:443
366-
*.actions.githubusercontent.com:443
306+
egress-policy: audit
367307
disable-sudo: true
368308

369309
- name: Checkout
@@ -416,16 +356,11 @@ jobs:
416356
timeout-minutes: 10
417357

418358
steps:
419-
# Stage 1 of the harden-runner egress rollout: pure `git log` against
420-
# the checked-out repo, no other tool download — github.com/actions
421-
# endpoints are the entire footprint.
359+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
422360
- name: Harden Runner
423361
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
424362
with:
425-
egress-policy: block
426-
allowed-endpoints: >
427-
github.com:443
428-
*.actions.githubusercontent.com:443
363+
egress-policy: audit
429364
disable-sudo: true
430365

431366
- name: Checkout

‎.github/workflows/quality-api-version-watch.yml‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,11 @@ jobs:
5454
timeout-minutes: 10
5555

5656
steps:
57-
# Stage 1 of the harden-runner egress rollout: the only external call
58-
# this job makes is curl against docs.docker.com — a single, stable
59-
# vendor host.
57+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
6058
- name: Harden Runner
6159
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
6260
with:
63-
egress-policy: block
64-
allowed-endpoints: >
65-
github.com:443
66-
docs.docker.com:443
67-
*.actions.githubusercontent.com:443
61+
egress-policy: audit
6862
disable-sudo: true
6963

7064
- name: Checkout

‎.github/workflows/quality-go-bench-monthly.yml‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,11 @@ jobs:
3333
# ~13m; this budget adds headroom for slower/shared CI hardware.
3434
timeout-minutes: 40
3535
steps:
36-
# Stage 1 of the harden-runner egress rollout: pure Go build/bench, no
37-
# Docker. Same endpoint set as quality-fuzz-nightly.yml — see that
38-
# file's comment for the reasoning on each host.
36+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
3937
- name: Harden Runner
4038
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
4139
with:
42-
egress-policy: block
43-
allowed-endpoints: >
44-
github.com:443
45-
raw.githubusercontent.com:443
46-
objects.githubusercontent.com:443
47-
release-assets.githubusercontent.com:443
48-
proxy.golang.org:443
49-
storage.googleapis.com:443
50-
sum.golang.org:443
51-
*.actions.githubusercontent.com:443
40+
egress-policy: audit
5241
disable-sudo: true
5342

5443
- name: Checkout

‎.github/workflows/quality-mutation-monthly.yml‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ jobs:
5050
- name: Harden Runner
5151
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
5252
with:
53-
egress-policy: block
54-
allowed-endpoints: >
55-
github.com:443
53+
egress-policy: audit
5654
disable-sudo: true
5755

5856
- name: Checkout
@@ -97,8 +95,7 @@ jobs:
9795
# leg ran 47 minutes green under audit on 2026-08-01 (run 30692172568),
9896
# quality-fuzz-monthly.yml already runs audit for its 61-minute legs,
9997
# and no job in this repo has survived past 16.5 minutes under block.
100-
# This job holds contents: read and no persisted credential; the
101-
# write-capable update-badge job stays on block.
98+
# This job holds contents: read and no persisted credential.
10299
- name: Harden Runner
103100
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
104101
with:
@@ -184,16 +181,11 @@ jobs:
184181
lived: ${{ steps.score.outputs.lived }}
185182
reports_found: ${{ steps.score.outputs.reports_found }}
186183
steps:
187-
# Stage 1 of the harden-runner egress rollout: only downloads
188-
# artifacts — all GitHub-internal traffic.
184+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
189185
- name: Harden Runner
190186
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
191187
with:
192-
egress-policy: block
193-
allowed-endpoints: >
194-
github.com:443
195-
api.github.com:443
196-
*.actions.githubusercontent.com:443
188+
egress-policy: audit
197189
disable-sudo: true
198190

199191
- name: Download all package reports
@@ -405,13 +397,11 @@ jobs:
405397
permissions:
406398
contents: write # commit the badge JSON back with GITHUB_TOKEN
407399
steps:
408-
# Pushes one commit back to origin — GitHub-internal traffic only.
400+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
409401
- name: Harden Runner
410402
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
411403
with:
412-
egress-policy: block
413-
allowed-endpoints: >
414-
github.com:443
404+
egress-policy: audit
415405
disable-sudo: true
416406

417407
- name: Checkout

‎.github/workflows/quality-tri-tool-conformance.yml‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,11 @@ jobs:
5858
runs-on: ubuntu-24.04
5959
timeout-minutes: 5
6060
steps:
61-
# Stage 1 of the harden-runner egress rollout: no Docker in this leg,
62-
# just the route-normalizer self-test against the checked-out repo.
61+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
6362
- name: Harden Runner
6463
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
6564
with:
66-
egress-policy: block
67-
allowed-endpoints: >
68-
github.com:443
69-
*.actions.githubusercontent.com:443
65+
egress-policy: audit
7066
disable-sudo: true
7167

7268
- name: Checkout
@@ -162,16 +158,11 @@ jobs:
162158
runs-on: ubuntu-24.04
163159
timeout-minutes: 10
164160
steps:
165-
# Stage 1 of the harden-runner egress rollout: only downloads
166-
# artifacts and aggregates JSON locally — all GitHub-internal traffic,
167-
# no checkout even needed.
161+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
168162
- name: Harden Runner
169163
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
170164
with:
171-
egress-policy: block
172-
allowed-endpoints: >
173-
github.com:443
174-
*.actions.githubusercontent.com:443
165+
egress-policy: audit
175166
disable-sudo: true
176167

177168
- name: Download all row artifacts

‎.github/workflows/security-grype.yml‎

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -105,29 +105,11 @@ jobs:
105105
runs-on: ubuntu-24.04
106106
timeout-minutes: 15
107107
steps:
108-
# Stage 1 of the harden-runner egress rollout: pure Go, no Docker.
109-
# Same base endpoints as quality-fuzz-nightly.yml plus vuln.go.dev for
110-
# govulncheck's own vulnerability database fetch.
108+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
111109
- name: Harden Runner
112110
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
113111
with:
114-
egress-policy: block
115-
allowed-endpoints: >
116-
github.com:443
117-
raw.githubusercontent.com:443
118-
objects.githubusercontent.com:443
119-
release-assets.githubusercontent.com:443
120-
proxy.golang.org:443
121-
storage.googleapis.com:443
122-
sum.golang.org:443
123-
vuln.go.dev:443
124-
# setup-go resolves go.mod's version against actions/go-versions
125-
# first, then falls back to go.dev/dl/?mode=json. Warm runners hit
126-
# the manifest and never touch go.dev, so leaving this out passes
127-
# until the day the toolchain isn't cached and the job dies with
128-
# no related change.
129-
go.dev:443
130-
*.actions.githubusercontent.com:443
112+
egress-policy: audit
131113
disable-sudo: true
132114

133115
- name: Checkout
@@ -250,23 +232,11 @@ jobs:
250232
contents: read
251233
security-events: write
252234
steps:
253-
# Stage 1 of the harden-runner egress rollout: static scan of the
254-
# checked-out repo, no Docker build. Same endpoint set drydock already
255-
# runs in block mode for its own (npm-only) grype-deps job — this
256-
# extends it to the identical Go+npm scan sockguard runs.
235+
# Audit mode: block mode intermittently refused allow-listed hosts on hosted runners (DEP-19). Release workflows keep block.
257236
- name: Harden Runner
258237
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
259238
with:
260-
egress-policy: block
261-
allowed-endpoints: >
262-
github.com:443
263-
api.github.com:443
264-
raw.githubusercontent.com:443
265-
objects.githubusercontent.com:443
266-
release-assets.githubusercontent.com:443
267-
get.anchore.io:443
268-
grype.anchore.io:443
269-
*.actions.githubusercontent.com:443
239+
egress-policy: audit
270240
disable-sudo: true
271241

272242
- name: Checkout
@@ -453,11 +423,7 @@ jobs:
453423
- name: Harden Runner
454424
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
455425
with:
456-
egress-policy: block
457-
allowed-endpoints: >
458-
github.com:443
459-
api.github.com:443
460-
*.actions.githubusercontent.com:443
426+
egress-policy: audit
461427

462428
- name: Resolve latest published, non-prerelease tag
463429
id: latest_release

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- CI, PR security scans and quality workflows run harden-runner in audit mode because block mode intermittently refused allow-listed hosts and left jobs hanging until their timeout; the release cut and publisher keep block mode with their curated allow lists.
13+
1014
## [2.3.0-rc.9] - 2026-10-25
1115

1216
### Security

0 commit comments

Comments
 (0)