Skip to content

Commit f06975f

Browse files
committed
Block outbound calls from ci runners to unallowed endpoints
1 parent a03adea commit f06975f

10 files changed

Lines changed: 186 additions & 27 deletions

File tree

.github/workflows/build.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,21 @@ jobs:
2222
security-events: write
2323

2424
steps:
25-
- name: Harden the runner (Audit all outbound calls)
25+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
2626
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2727
with:
28-
egress-policy: audit
28+
egress-policy: block
29+
allowed-endpoints: >+
30+
github.com:443
31+
api.github.com:443
32+
release-assets.githubusercontent.com:443
33+
pypi.org:443
34+
files.pythonhosted.org:443
35+
packages.microsoft.com:443
36+
azure.archive.ubuntu.com:80
37+
esm.ubuntu.com:443
38+
index.rubygems.org:443
39+
rubygems.org:443
2940
3041
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3142
with:
@@ -207,10 +218,17 @@ jobs:
207218
runs-on: ubuntu-latest
208219

209220
steps:
210-
- name: Harden the runner (Audit all outbound calls)
221+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
211222
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
212223
with:
213-
egress-policy: audit
224+
egress-policy: block
225+
allowed-endpoints: >+
226+
github.com:443
227+
api.github.com:443
228+
release-assets.githubusercontent.com:443
229+
pypi.org:443
230+
files.pythonhosted.org:443
231+
214232
215233
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
216234
with:

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ jobs:
3434
runs-on: ubuntu-latest
3535

3636
steps:
37-
- name: Harden the runner (Audit all outbound calls)
37+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
3838
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
3939
with:
40-
egress-policy: audit
40+
egress-policy: block
41+
allowed-endpoints: >+
42+
github.com:443
43+
api.github.com:443
44+
release-assets.githubusercontent.com:443
4145
4246
- name: Checkout repository
4347
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/dependency-review.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ jobs:
1616
dependency-review:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Harden the runner (Audit all outbound calls)
19+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
2020
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2121
with:
22-
egress-policy: audit
22+
egress-policy: block
23+
allowed-endpoints: >+
24+
api.github.com:443
25+
github.com:443
2326
2427
- name: 'Checkout Repository'
2528
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/devcontainer.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,21 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- name: Harden the runner (Audit all outbound calls)
18+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
1919
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2020
with:
21-
egress-policy: audit
21+
egress-policy: block
22+
allowed-endpoints: >+
23+
github.com:443
24+
registry-1.docker.io:443
25+
auth.docker.io:443
26+
production.cloudflare.docker.com:443
27+
registry.npmjs.org:443
28+
containers.dev:443
29+
mcr.microsoft.com:443
30+
*.data.mcr.microsoft.com:443
31+
_http._tcp.deb.debian.org:443
32+
deb.debian.org:443
2233
2334
- name: Checkout repository
2435
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/docs.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@ jobs:
1616
name: Documentation
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Harden the runner (Audit all outbound calls)
19+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
2020
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2121
with:
22-
egress-policy: audit
22+
egress-policy: block
23+
allowed-endpoints: >+
24+
github.com:443
25+
pypi.org:443
26+
files.pythonhosted.org:443
27+
plantuml.com:80
28+
plantuml.com:443
29+
www.plantuml.com:80
2330
2431
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2532
with:
@@ -41,10 +48,17 @@ jobs:
4148
name: Landing page
4249
runs-on: ubuntu-latest
4350
steps:
44-
- name: Harden the runner (Audit all outbound calls)
51+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
4552
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
4653
with:
47-
egress-policy: audit
54+
egress-policy: block
55+
allowed-endpoints: >+
56+
github.com:443
57+
pypi.org:443
58+
files.pythonhosted.org:443
59+
plantuml.com:80
60+
plantuml.com:443
61+
www.plantuml.com:80
4862
4963
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5064

@@ -75,10 +89,24 @@ jobs:
7589
permissions:
7690
contents: write
7791
steps:
78-
- name: Harden the runner (Audit all outbound calls)
92+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
7993
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
8094
with:
81-
egress-policy: audit
95+
egress-policy: block
96+
allowed-endpoints: >+
97+
_http._tcp.azure.archive.ubuntu.com:443
98+
_https._tcp.archive.ubuntu.com:443
99+
_https._tcp.security.ubuntu.com:443
100+
archive.ubuntu.com:443
101+
azure.archive.ubuntu.com:443
102+
azure.archive.ubuntu.com:80
103+
files.pythonhosted.org:443
104+
github.com:443
105+
plantuml.com:443
106+
plantuml.com:80
107+
pypi.org:443
108+
security.ubuntu.com:443
109+
www.plantuml.com:80
82110
83111
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
84112
with:

.github/workflows/python-publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- name: Harden the runner (Audit all outbound calls)
23+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
2424
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2525
with:
26-
egress-policy: audit
26+
egress-policy: block
27+
allowed-endpoints: >+
28+
github.com:443
29+
api.github.com:443
30+
release-assets.githubusercontent.com:443
31+
pypi.org:443
32+
files.pythonhosted.org:443
2733
2834
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2935
with:

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ jobs:
2323
steps:
2424
- uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2525
with:
26-
egress-policy: audit
26+
egress-policy: block
27+
allowed-endpoints: >+
28+
github.com:443
29+
api.github.com:443
30+
release-assets.githubusercontent.com:443
31+
pypi.org:443
32+
files.pythonhosted.org:443
2733
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2834
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2935
with:

.github/workflows/run.yml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ jobs:
1515
security-events: write
1616

1717
steps:
18-
- name: Harden the runner (Audit all outbound calls)
18+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
1919
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2020
with:
21-
egress-policy: audit
21+
egress-policy: block
22+
allowed-endpoints: >+
23+
github.com:443
24+
api.github.com:443
25+
release-assets.githubusercontent.com:443
26+
pypi.org:443
27+
files.pythonhosted.org:443
2228
2329
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2430

@@ -73,10 +79,58 @@ jobs:
7379
security-events: write
7480

7581
steps:
76-
- name: Harden the runner (Audit all outbound calls)
82+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
7783
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
7884
with:
79-
egress-policy: audit
85+
egress-policy: block
86+
allowed-endpoints: >+
87+
_http._tcp.azure.archive.ubuntu.com:443
88+
_https._tcp.archive.ubuntu.com:443
89+
_https._tcp.dl.google.com:443
90+
_https._tcp.esm.ubuntu.com:443
91+
_https._tcp.motd.ubuntu.com:443
92+
_https._tcp.packages.microsoft.com:443
93+
_https._tcp.security.ubuntu.com:443
94+
0.pool.ntp.org:443
95+
api.apple-cloudkit.com:443
96+
api.github.com:443
97+
archive.ubuntu.com:443
98+
azure.archive.ubuntu.com:443
99+
azure.archive.ubuntu.com:80
100+
cfhcable.dl.sourceforge.net:443
101+
community.chocolatey.org:443
102+
community.chocolatey.org:80
103+
cytranet-dal.dl.sourceforge.net:443
104+
dc.services.visualstudio.com:443
105+
dl.google.com:443
106+
downloads.sourceforge.net:443
107+
esm.ubuntu.com:443
108+
fe2cr.update.microsoft.com:443
109+
files.pythonhosted.org:443
110+
formulae.brew.sh:443
111+
gdmf.apple.com:443
112+
ghcr.io:443
113+
gigenet.dl.sourceforge.net:443
114+
github.com:443
115+
init.itunes.apple.com:443
116+
mask.icloud.com:443
117+
mesu.apple.com:443
118+
mirrors.ctan.org:443
119+
mobile.events.data.microsoft.com:443
120+
motd.ubuntu.com:443
121+
netactuate.dl.sourceforge.net:443
122+
ocsp.sectigo.com:80
123+
ocsp2.apple.com:443
124+
packages.chocolatey.org:443
125+
packages.microsoft.com:443
126+
pilotfiber.dl.sourceforge.net:443
127+
pkg-containers.githubusercontent.com:443
128+
psychz.dl.sourceforge.net:443
129+
pypi.org:443
130+
release-assets.githubusercontent.com:443
131+
security.ubuntu.com:443
132+
sourceforge.net:443
133+
ziglang.org:443
80134
81135
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
82136

.github/workflows/scorecard.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ jobs:
2626
id-token: write
2727

2828
steps:
29-
- name: Harden the runner (Audit all outbound calls)
29+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
3030
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
3131
with:
32-
egress-policy: audit
32+
egress-policy: block
33+
allowed-endpoints: >+
3334
3435
- name: "Checkout code"
3536
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/test.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,38 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Harden the runner (Audit all outbound calls)
13+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
1414
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
1515
with:
16-
egress-policy: audit
16+
egress-policy: block
17+
allowed-endpoints: >+
18+
dl.google.com:443
19+
packages.microsoft.com:443
20+
azure.archive.ubuntu.com:80
21+
esm.ubuntu.com:443
22+
pypi.org:443
23+
files.pythonhosted.org:443
24+
github.com:443
25+
github.com:22
26+
svn.code.sf.net:3690
27+
svn.code.sf.net:443
28+
release-assets.githubusercontent.com:443
29+
coverage.codacy.com:443
30+
artifacts.codacy.com:443
31+
api.codacy.com:443
32+
_https._tcp.packages.microsoft.com:443
33+
_https._tcp.dl.google.com:443
34+
_http._tcp.azure.archive.ubuntu.com:443
35+
azure.archive.ubuntu.com:443
36+
_https._tcp.motd.ubuntu.com:443
37+
motd.ubuntu.com:443
38+
_https._tcp.esm.ubuntu.com:443
39+
_https._tcp.archive.ubuntu.com:443
40+
archive.ubuntu.com:443
41+
_https._tcp.security.ubuntu.com:443
42+
security.ubuntu.com:443
43+
dfetch.invalid:443
44+
giiiiiidhub.com:443
1745
1846
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1947

0 commit comments

Comments
 (0)