Skip to content

Commit e9dd9d6

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

10 files changed

Lines changed: 223 additions & 27 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,26 @@ 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+
uploads.github.com:443
34+
pypi.org:443
35+
files.pythonhosted.org:443
36+
packages.microsoft.com:443
37+
azure.archive.ubuntu.com:80
38+
esm.ubuntu.com:443
39+
index.rubygems.org:443
40+
rubygems.org:443
41+
community.chocolatey.org:443
42+
community.chocolatey.org:80
43+
packages.chocolatey.org:443
44+
api.nuget.org:443
2945
3046
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3147
with:
@@ -207,10 +223,17 @@ jobs:
207223
runs-on: ubuntu-latest
208224

209225
steps:
210-
- name: Harden the runner (Audit all outbound calls)
226+
- name: "Harden the runner (Block egress traffic: Only allow calls to allowed endpoints)"
211227
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
212228
with:
213-
egress-policy: audit
229+
egress-policy: block
230+
allowed-endpoints: >+
231+
github.com:443
232+
api.github.com:443
233+
release-assets.githubusercontent.com:443
234+
pypi.org:443
235+
files.pythonhosted.org:443
236+
214237
215238
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
216239
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: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,36 @@ 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+
_http._tcp.deb.debian.org:443
24+
*.data.mcr.microsoft.com:443
25+
api.github.com:443
26+
auth.docker.io:443
27+
containers.dev:443
28+
deb.debian.org:443
29+
deb.debian.org:80
30+
debian.map.fastlydns.net:443
31+
debian.map.fastlydns.net:80
32+
dl.google.com:443
33+
files.pythonhosted.org:443
34+
github.com:443
35+
go.dev:443
36+
index.rubygems.org:443
37+
mcr.microsoft.com:443
38+
nodejs.org:443
39+
plantuml.com:443
40+
plantuml.com:80
41+
production.cloudflare.docker.com:443
42+
proxy.golang.org:443
43+
pypi.org:443
44+
registry-1.docker.io:443
45+
registry.npmjs.org:443
46+
rubygems.org:443
47+
storage.googleapis.com:443
2248
2349
- name: Checkout repository
2450
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/docs.yml

Lines changed: 36 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,26 @@ 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+
api.github.com:443
106+
uploads.github.com:443
107+
plantuml.com:443
108+
plantuml.com:80
109+
pypi.org:443
110+
security.ubuntu.com:443
111+
www.plantuml.com:80
82112
83113
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
84114
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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ 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+
uploads.github.com:443
2732
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2833
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2934
with:

.github/workflows/run.yml

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@ 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
28+
community.chocolatey.org:443
29+
community.chocolatey.org:80
30+
packages.chocolatey.org:443
2231
2332
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2433

@@ -73,10 +82,58 @@ jobs:
7382
security-events: write
7483

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

.github/workflows/scorecard.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,21 @@ 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: >+
34+
github.com:443
35+
api.github.com:443
36+
raw.githubusercontent.com:443
37+
codeload.github.com:443
38+
uploads.github.com:443
39+
api.osv.dev:443
40+
www.bestpractices.dev:443
41+
api.securityscorecards.dev:443
42+
rekor.sigstore.dev:443
43+
fulcio.sigstore.dev:443
3344
3445
- name: "Checkout code"
3546
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/test.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,41 @@ 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+
# dfetch.invalid and giiiiiidhub.com are intentionally invalid test
18+
# domains used to verify network blocking/allowlist behaviour in the
19+
# feature tests; they are never reachable from the runner.
20+
allowed-endpoints: >+
21+
_http._tcp.azure.archive.ubuntu.com:443
22+
_https._tcp.archive.ubuntu.com:443
23+
_https._tcp.dl.google.com:443
24+
_https._tcp.esm.ubuntu.com:443
25+
_https._tcp.motd.ubuntu.com:443
26+
_https._tcp.packages.microsoft.com:443
27+
_https._tcp.security.ubuntu.com:443
28+
api.codacy.com:443
29+
archive.ubuntu.com:443
30+
artifacts.codacy.com:443
31+
azure.archive.ubuntu.com:443
32+
azure.archive.ubuntu.com:80
33+
coverage.codacy.com:443
34+
dfetch.invalid:443
35+
dl.google.com:443
36+
esm.ubuntu.com:443
37+
files.pythonhosted.org:443
38+
giiiiiidhub.com:443
39+
github.com:22
40+
github.com:443
41+
motd.ubuntu.com:443
42+
packages.microsoft.com:443
43+
pypi.org:443
44+
release-assets.githubusercontent.com:443
45+
security.ubuntu.com:443
46+
svn.code.sf.net:3690
47+
svn.code.sf.net:443
1748
1849
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1950

0 commit comments

Comments
 (0)