Skip to content

Commit f257537

Browse files
author
Kenneth Rosario
authored
chore: apply harden runner recommended egress policy (GoogleCloudPlatform#246)
1 parent 6420b67 commit f257537

File tree

6 files changed

+58
-13
lines changed

6 files changed

+58
-13
lines changed

.github/workflows/codeql.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,15 @@ jobs:
4141

4242
steps:
4343
- name: Harden Runner
44-
uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1
44+
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
4545
with:
46-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
46+
disable-sudo: true
47+
egress-policy: block
48+
allowed-endpoints: >
49+
api.github.com:443
50+
files.pythonhosted.org:443
51+
github.com:443
52+
pypi.org:443
4753
4854
- name: Checkout repository
4955
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

.github/workflows/conformance.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,18 @@ jobs:
1212
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
1313
steps:
1414
- name: Harden Runner
15-
uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1
15+
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
1616
with:
17-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
17+
disable-sudo: true
18+
egress-policy: block
19+
allowed-endpoints: >
20+
api.github.com:443
21+
files.pythonhosted.org:443
22+
github.com:443
23+
objects.githubusercontent.com:443
24+
proxy.golang.org:443
25+
pypi.org:443
26+
storage.googleapis.com:443
1827
1928
- name: Checkout code
2029
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

.github/workflows/dependency-review.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Harden Runner
20-
uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1
20+
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
2121
with:
22-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
23-
22+
disable-sudo: true
23+
egress-policy: block
24+
allowed-endpoints: >
25+
api.github.com:443
26+
github.com:443
2427
- name: 'Checkout Repository'
2528
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2629
- name: 'Dependency Review'

.github/workflows/lint.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Harden Runner
11-
uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1
11+
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
1212
with:
13-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
13+
disable-sudo: true
14+
egress-policy: block
15+
allowed-endpoints: >
16+
files.pythonhosted.org:443
17+
github.com:443
18+
pypi.org:443
1419
1520
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
1621
- name: Setup Python

.github/workflows/scorecard.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- cron: '0 */12 * * *'
1010
push:
1111
branches: [ "master" ]
12+
workflow_dispatch:
1213

1314
# Declare default permissions as read only.
1415
permissions: read-all
@@ -25,9 +26,22 @@ jobs:
2526

2627
steps:
2728
- name: Harden Runner
28-
uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1
29+
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
2930
with:
30-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
31+
disable-sudo: true
32+
egress-policy: block
33+
allowed-endpoints: >
34+
api.github.com:443
35+
api.osv.dev:443
36+
api.securityscorecards.dev:443
37+
auth.docker.io:443
38+
bestpractices.coreinfrastructure.org:443
39+
fulcio.sigstore.dev:443
40+
github.com:443
41+
index.docker.io:443
42+
oss-fuzz-build-logs.storage.googleapis.com:443
43+
sigstore-tuf-root.storage.googleapis.com:443
44+
rekor.sigstore.dev:443
3145
3246
- name: "Checkout code"
3347
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

.github/workflows/unit.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@ jobs:
1212
runs-on: ${{ matrix.platform }}
1313
steps:
1414
- name: Harden Runner
15-
uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1
15+
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
1616
with:
17-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
17+
disable-sudo: true
18+
egress-policy: block
19+
allowed-endpoints: >
20+
auth.docker.io:443
21+
files.pythonhosted.org:443
22+
github.com:443
23+
production.cloudflare.docker.com:443
24+
pypi.org:443
25+
registry-1.docker.io:443
1826
1927
- name: Checkout
2028
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

0 commit comments

Comments
 (0)