Skip to content

Commit 4679f1e

Browse files
author
Kenneth Rosario
authored
chore: apply recommended harden runner egress policies (#199)
1 parent 1bef3bd commit 4679f1e

File tree

5 files changed

+48
-12
lines changed

5 files changed

+48
-12
lines changed

.github/workflows/codeql.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ jobs:
3030
- name: Harden Runner
3131
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
3232
with:
33-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
34-
33+
disable-sudo: true
34+
egress-policy: block
35+
allowed-endpoints: >
36+
api.github.com:443
37+
github.com:443
38+
objects.githubusercontent.com:443
39+
proxy.golang.org:443
40+
repo.maven.apache.org:443
41+
storage.googleapis.com:443
42+
3543
- name: Checkout repository
3644
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3745

.github/workflows/conformance.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ jobs:
2222
- name: Harden Runner
2323
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
2424
with:
25-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
25+
disable-sudo: true
26+
egress-policy: block
27+
allowed-endpoints: >
28+
api.github.com:443
29+
github.com:443
30+
objects.githubusercontent.com:443
31+
proxy.golang.org:443
32+
repo.maven.apache.org:443
33+
storage.googleapis.com:443
2634
2735
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2836

.github/workflows/lint.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ jobs:
1515
- name: Harden Runner
1616
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
1717
with:
18-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
19-
18+
disable-sudo: true
19+
egress-policy: block
20+
allowed-endpoints: >
21+
github.com:443
22+
repo.maven.apache.org:443
2023
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2124
- name: Set up JDK
2225
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0

.github/workflows/scorecard.yml

Lines changed: 19 additions & 5 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
@@ -24,11 +25,24 @@ jobs:
2425
id-token: write
2526

2627
steps:
27-
- name: Harden Runner
28-
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
29-
with:
30-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
31-
28+
- name: Harden Runner
29+
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
30+
with:
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
45+
3246
- name: "Checkout code"
3347
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3448
with:

.github/workflows/unit.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ jobs:
2020
- name: Harden Runner
2121
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
2222
with:
23-
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
24-
23+
disable-sudo: true
24+
egress-policy: block
25+
allowed-endpoints: >
26+
github.com:443
27+
repo.maven.apache.org:443
2528
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2629
- name: Set up JDK ${{ matrix.java }}
2730
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0

0 commit comments

Comments
 (0)