Skip to content

Commit 450d136

Browse files
committed
fix(ci): inline step-security/harden-runner in all 14 workflows
Replace local composite action wrappers (./.github/actions/harden-runner/*) with direct calls to step-security/harden-runner@SHA in every job step. Root cause: GitHub composite actions do not propagate pre:/post: hooks to nested actions. harden-runner's eBPF network monitoring is set up in its pre: hook, which was silently skipped when called via a composite action wrapper. This caused: - Warning: pre execution is not supported for local action - Error: ENOENT /home/agent/post_event.json (post step crash) Each workflow now calls step-security/harden-runner directly with its inline egress profile. The four profiles and their endpoint sets are: minimal (8 files): api.github.com, github.com, *.githubusercontent.com, mise.run, *.mise.jdx.dev audit (2 files): minimal + ghcr.io, docker registries, osv/trivy/sigstore/scorecard scanners standard (3 files): minimal + OS pkg managers, npm/pypi/cargo/go/ maven/gems/terraform/gradle registries full (5 steps): standard + gcr/ecr/acr/quay registries, osv/trivy/sigstore scanners Files changed: 14 workflow files Signed-off-by: snowdream <snowdream@users.noreply.github.com>
1 parent 9ae20a3 commit 450d136

14 files changed

Lines changed: 509 additions & 108 deletions

.github/workflows/cache.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ jobs:
3737
contents: read # Required for repository metadata access
3838
timeout-minutes: 40 # 10m is more than enough for cache list/delete operations
3939
steps:
40-
- name: "📥 Bootstrap Local Actions"
41-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
42-
with:
43-
sparse-checkout: .github/actions
44-
persist-credentials: false
4540
- name: "🔒 Harden Runner (Minimal)"
46-
uses: ./.github/actions/harden-runner/minimal
41+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.10.2
42+
with:
43+
egress-policy: block
44+
allowed-endpoints: >
45+
api.github.com:443
46+
github.com:443
47+
*.githubusercontent.com:443
48+
mise.run:443
49+
*.mise.jdx.dev:443
4750
- name: "🧹 Prune Inactive GitHub Caches"
4851
shell: sh # POSIX compliant shell for better portability
4952
run: |

.github/workflows/cd.yml

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,62 @@ jobs:
4343
env:
4444
PYTHONUTF8: 1
4545
steps:
46-
- name: "📥 Bootstrap Local Actions"
47-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
48-
with:
49-
sparse-checkout: .github/actions
50-
persist-credentials: false
5146
- name: "🔒 Harden Runner (Full)"
52-
uses: ./.github/actions/harden-runner/full
47+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.10.2
48+
with:
49+
egress-policy: block
50+
allowed-endpoints: >
51+
api.github.com:443
52+
github.com:443
53+
*.githubusercontent.com:443
54+
mise.run:443
55+
*.mise.jdx.dev:443
56+
packages.microsoft.com:443
57+
*.ubuntu.com:80
58+
*.ubuntu.com:443
59+
*.debian.org:80
60+
*.debian.org:443
61+
*.rockylinux.org:443
62+
*.centos.org:443
63+
*.redhat.com:443
64+
dl-cdn.alpinelinux.org:443
65+
registry.npmjs.org:443
66+
registry.yarnpkg.com:443
67+
pypi.org:443
68+
files.pythonhosted.org:443
69+
proxy.golang.org:443
70+
sum.golang.org:443
71+
index.crates.io:443
72+
static.rust-lang.org:443
73+
packagist.org:443
74+
repo.maven.apache.org:443
75+
rubygems.org:443
76+
registry.terraform.io:443
77+
formulae.brew.sh:443
78+
repo.yarnpkg.com:443
79+
nodejs.org:443
80+
deno.land:443
81+
cdn.deno.land:443
82+
downloads.gradle.org:443
83+
services.gradle.org:443
84+
downloads.gradle-dn.com:443
85+
ghcr.io:443
86+
pkg-containers.githubusercontent.com:443
87+
public.ecr.aws:443
88+
production.cloudflare.docker.com:443
89+
registry-1.docker.io:443
90+
auth.docker.io:443
91+
index.docker.io:443
92+
*.gcr.io:443
93+
*.pkg.dev:443
94+
*.quay.io:443
95+
*.dkr.ecr.*.amazonaws.com:443
96+
*.azurecr.io:443
97+
osv-vulnerabilities.storage.googleapis.com:443
98+
api.osv.dev:443
99+
get.trivy.dev:443
100+
*.aquasecurity.github.io:443
101+
*.sigstore.dev:443
53102
- name: "📂 Checkout Repository Code"
54103
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55104
with:

.github/workflows/ci.yml

Lines changed: 220 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,62 @@ jobs:
3232
permissions:
3333
contents: read
3434
steps:
35-
- name: "📥 Bootstrap Local Actions"
36-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37-
with:
38-
sparse-checkout: .github/actions
39-
persist-credentials: false
4035
- name: "🔒 Harden Runner (Full)"
41-
uses: ./.github/actions/harden-runner/full
36+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.10.2
37+
with:
38+
egress-policy: block
39+
allowed-endpoints: >
40+
api.github.com:443
41+
github.com:443
42+
*.githubusercontent.com:443
43+
mise.run:443
44+
*.mise.jdx.dev:443
45+
packages.microsoft.com:443
46+
*.ubuntu.com:80
47+
*.ubuntu.com:443
48+
*.debian.org:80
49+
*.debian.org:443
50+
*.rockylinux.org:443
51+
*.centos.org:443
52+
*.redhat.com:443
53+
dl-cdn.alpinelinux.org:443
54+
registry.npmjs.org:443
55+
registry.yarnpkg.com:443
56+
pypi.org:443
57+
files.pythonhosted.org:443
58+
proxy.golang.org:443
59+
sum.golang.org:443
60+
index.crates.io:443
61+
static.rust-lang.org:443
62+
packagist.org:443
63+
repo.maven.apache.org:443
64+
rubygems.org:443
65+
registry.terraform.io:443
66+
formulae.brew.sh:443
67+
repo.yarnpkg.com:443
68+
nodejs.org:443
69+
deno.land:443
70+
cdn.deno.land:443
71+
downloads.gradle.org:443
72+
services.gradle.org:443
73+
downloads.gradle-dn.com:443
74+
ghcr.io:443
75+
pkg-containers.githubusercontent.com:443
76+
public.ecr.aws:443
77+
production.cloudflare.docker.com:443
78+
registry-1.docker.io:443
79+
auth.docker.io:443
80+
index.docker.io:443
81+
*.gcr.io:443
82+
*.pkg.dev:443
83+
*.quay.io:443
84+
*.dkr.ecr.*.amazonaws.com:443
85+
*.azurecr.io:443
86+
osv-vulnerabilities.storage.googleapis.com:443
87+
api.osv.dev:443
88+
get.trivy.dev:443
89+
*.aquasecurity.github.io:443
90+
*.sigstore.dev:443
4291
- name: "📂 Checkout Repository Code"
4392
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4493
with:
@@ -68,14 +117,63 @@ jobs:
68117
VENV: ".venv"
69118
PYTHONUTF8: 1
70119
steps:
71-
- name: "📥 Bootstrap Local Actions"
72-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
73-
with:
74-
sparse-checkout: .github/actions
75-
persist-credentials: false
76120
- name: "🔒 Harden Runner (Security Egress Audit)"
77121
if: matrix.os == 'ubuntu-latest'
78-
uses: ./.github/actions/harden-runner/full
122+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.10.2
123+
with:
124+
egress-policy: block
125+
allowed-endpoints: >
126+
api.github.com:443
127+
github.com:443
128+
*.githubusercontent.com:443
129+
mise.run:443
130+
*.mise.jdx.dev:443
131+
packages.microsoft.com:443
132+
*.ubuntu.com:80
133+
*.ubuntu.com:443
134+
*.debian.org:80
135+
*.debian.org:443
136+
*.rockylinux.org:443
137+
*.centos.org:443
138+
*.redhat.com:443
139+
dl-cdn.alpinelinux.org:443
140+
registry.npmjs.org:443
141+
registry.yarnpkg.com:443
142+
pypi.org:443
143+
files.pythonhosted.org:443
144+
proxy.golang.org:443
145+
sum.golang.org:443
146+
index.crates.io:443
147+
static.rust-lang.org:443
148+
packagist.org:443
149+
repo.maven.apache.org:443
150+
rubygems.org:443
151+
registry.terraform.io:443
152+
formulae.brew.sh:443
153+
repo.yarnpkg.com:443
154+
nodejs.org:443
155+
deno.land:443
156+
cdn.deno.land:443
157+
downloads.gradle.org:443
158+
services.gradle.org:443
159+
downloads.gradle-dn.com:443
160+
ghcr.io:443
161+
pkg-containers.githubusercontent.com:443
162+
public.ecr.aws:443
163+
production.cloudflare.docker.com:443
164+
registry-1.docker.io:443
165+
auth.docker.io:443
166+
index.docker.io:443
167+
*.gcr.io:443
168+
*.pkg.dev:443
169+
*.quay.io:443
170+
*.dkr.ecr.*.amazonaws.com:443
171+
*.azurecr.io:443
172+
osv-vulnerabilities.storage.googleapis.com:443
173+
api.osv.dev:443
174+
get.trivy.dev:443
175+
*.aquasecurity.github.io:443
176+
*.sigstore.dev:443
79177
- name: "📂 Checkout Repository Code"
80178
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
81179
with:
@@ -162,14 +260,63 @@ jobs:
162260
VENV: ".venv"
163261
PYTHONUTF8: 1
164262
steps:
165-
- name: "📥 Bootstrap Local Actions"
166-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
167-
with:
168-
sparse-checkout: .github/actions
169-
persist-credentials: false
170263
- name: "🔒 Harden Runner (Security Egress Audit)"
171264
if: matrix.os == 'ubuntu-latest'
172-
uses: ./.github/actions/harden-runner/full
265+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.10.2
266+
with:
267+
egress-policy: block
268+
allowed-endpoints: >
269+
api.github.com:443
270+
github.com:443
271+
*.githubusercontent.com:443
272+
mise.run:443
273+
*.mise.jdx.dev:443
274+
packages.microsoft.com:443
275+
*.ubuntu.com:80
276+
*.ubuntu.com:443
277+
*.debian.org:80
278+
*.debian.org:443
279+
*.rockylinux.org:443
280+
*.centos.org:443
281+
*.redhat.com:443
282+
dl-cdn.alpinelinux.org:443
283+
registry.npmjs.org:443
284+
registry.yarnpkg.com:443
285+
pypi.org:443
286+
files.pythonhosted.org:443
287+
proxy.golang.org:443
288+
sum.golang.org:443
289+
index.crates.io:443
290+
static.rust-lang.org:443
291+
packagist.org:443
292+
repo.maven.apache.org:443
293+
rubygems.org:443
294+
registry.terraform.io:443
295+
formulae.brew.sh:443
296+
repo.yarnpkg.com:443
297+
nodejs.org:443
298+
deno.land:443
299+
cdn.deno.land:443
300+
downloads.gradle.org:443
301+
services.gradle.org:443
302+
downloads.gradle-dn.com:443
303+
ghcr.io:443
304+
pkg-containers.githubusercontent.com:443
305+
public.ecr.aws:443
306+
production.cloudflare.docker.com:443
307+
registry-1.docker.io:443
308+
auth.docker.io:443
309+
index.docker.io:443
310+
*.gcr.io:443
311+
*.pkg.dev:443
312+
*.quay.io:443
313+
*.dkr.ecr.*.amazonaws.com:443
314+
*.azurecr.io:443
315+
osv-vulnerabilities.storage.googleapis.com:443
316+
api.osv.dev:443
317+
get.trivy.dev:443
318+
*.aquasecurity.github.io:443
319+
*.sigstore.dev:443
173320
- name: "📂 Checkout Repository Code"
174321
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
175322
with:
@@ -251,13 +398,62 @@ jobs:
251398
VENV: ".venv"
252399
PYTHONUTF8: 1
253400
steps:
254-
- name: "📥 Bootstrap Local Actions"
255-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
256-
with:
257-
sparse-checkout: .github/actions
258-
persist-credentials: false
259401
- name: "🔒 Harden Runner (Full)"
260-
uses: ./.github/actions/harden-runner/full
402+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.10.2
403+
with:
404+
egress-policy: block
405+
allowed-endpoints: >
406+
api.github.com:443
407+
github.com:443
408+
*.githubusercontent.com:443
409+
mise.run:443
410+
*.mise.jdx.dev:443
411+
packages.microsoft.com:443
412+
*.ubuntu.com:80
413+
*.ubuntu.com:443
414+
*.debian.org:80
415+
*.debian.org:443
416+
*.rockylinux.org:443
417+
*.centos.org:443
418+
*.redhat.com:443
419+
dl-cdn.alpinelinux.org:443
420+
registry.npmjs.org:443
421+
registry.yarnpkg.com:443
422+
pypi.org:443
423+
files.pythonhosted.org:443
424+
proxy.golang.org:443
425+
sum.golang.org:443
426+
index.crates.io:443
427+
static.rust-lang.org:443
428+
packagist.org:443
429+
repo.maven.apache.org:443
430+
rubygems.org:443
431+
registry.terraform.io:443
432+
formulae.brew.sh:443
433+
repo.yarnpkg.com:443
434+
nodejs.org:443
435+
deno.land:443
436+
cdn.deno.land:443
437+
downloads.gradle.org:443
438+
services.gradle.org:443
439+
downloads.gradle-dn.com:443
440+
ghcr.io:443
441+
pkg-containers.githubusercontent.com:443
442+
public.ecr.aws:443
443+
production.cloudflare.docker.com:443
444+
registry-1.docker.io:443
445+
auth.docker.io:443
446+
index.docker.io:443
447+
*.gcr.io:443
448+
*.pkg.dev:443
449+
*.quay.io:443
450+
*.dkr.ecr.*.amazonaws.com:443
451+
*.azurecr.io:443
452+
osv-vulnerabilities.storage.googleapis.com:443
453+
api.osv.dev:443
454+
get.trivy.dev:443
455+
*.aquasecurity.github.io:443
456+
*.sigstore.dev:443
261457
- name: "📂 Checkout Repository Code"
262458
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
263459
with:

0 commit comments

Comments
 (0)