Skip to content

Commit afd0ab7

Browse files
[StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 9a0ffc4 commit afd0ab7

File tree

8 files changed

+75
-0
lines changed

8 files changed

+75
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ jobs:
3535
# For pushes to main, compare against the previous commit
3636
BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
3737
steps:
38+
- name: Harden the runner (Audit all outbound calls)
39+
uses: step-security/harden-runner@v2
40+
with:
41+
egress-policy: audit
42+
3843
- uses: actions/checkout@v4
3944
with:
4045
fetch-depth: 10 # Fetch current commit and its parent

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030
continue-on-error: ${{ matrix.rust == 'beta' }}
3131
steps:
32+
- name: Harden the runner (Audit all outbound calls)
33+
uses: step-security/harden-runner@v2
34+
with:
35+
egress-policy: audit
36+
3237
- name: Free disk space
3338
if: ${{ matrix.os == 'ubuntu-latest'}}
3439
run: |
@@ -53,6 +58,11 @@ jobs:
5358
lint:
5459
runs-on: ubuntu-latest
5560
steps:
61+
- name: Harden the runner (Audit all outbound calls)
62+
uses: step-security/harden-runner@v2
63+
with:
64+
egress-policy: audit
65+
5666
- uses: actions/checkout@v4
5767
with:
5868
submodules: true
@@ -75,6 +85,11 @@ jobs:
7585
example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
7686
runs-on: ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
7787
steps:
88+
- name: Harden the runner (Audit all outbound calls)
89+
uses: step-security/harden-runner@v2
90+
with:
91+
egress-policy: audit
92+
7893
- uses: actions/checkout@v4
7994
- uses: dtolnay/rust-toolchain@nightly
8095
with:
@@ -93,6 +108,11 @@ jobs:
93108
runs-on: ${{ matrix.os }}
94109
continue-on-error: true
95110
steps:
111+
- name: Harden the runner (Audit all outbound calls)
112+
uses: step-security/harden-runner@v2
113+
with:
114+
egress-policy: audit
115+
96116
- uses: actions/checkout@v4
97117
with:
98118
submodules: true
@@ -108,6 +128,11 @@ jobs:
108128
runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
109129
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
110130
steps:
131+
- name: Harden the runner (Audit all outbound calls)
132+
uses: step-security/harden-runner@v2
133+
with:
134+
egress-policy: audit
135+
111136
- uses: actions/checkout@v4
112137
- uses: EmbarkStudios/cargo-deny-action@v2
113138
with:
@@ -116,6 +141,11 @@ jobs:
116141
continue-on-error: true
117142
runs-on: ubuntu-latest
118143
steps:
144+
- name: Harden the runner (Audit all outbound calls)
145+
uses: step-security/harden-runner@v2
146+
with:
147+
egress-policy: audit
148+
119149
- uses: actions/checkout@v4
120150
- uses: dtolnay/rust-toolchain@stable
121151
with:
@@ -133,6 +163,11 @@ jobs:
133163
runs-on: ubuntu-latest
134164
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }}
135165
steps:
166+
- name: Harden the runner (Audit all outbound calls)
167+
uses: step-security/harden-runner@v2
168+
with:
169+
egress-policy: audit
170+
136171
- uses: actions/checkout@v4
137172
with:
138173
submodules: true
@@ -160,6 +195,11 @@ jobs:
160195
continue-on-error: true
161196
runs-on: ubuntu-latest
162197
steps:
198+
- name: Harden the runner (Audit all outbound calls)
199+
uses: step-security/harden-runner@v2
200+
with:
201+
egress-policy: audit
202+
163203
- uses: actions/checkout@v4
164204
with:
165205
submodules: true

.github/workflows/fossa.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ jobs:
1212
fossa:
1313
runs-on: ubuntu-latest
1414
steps:
15+
- name: Harden the runner (Audit all outbound calls)
16+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
17+
with:
18+
egress-policy: audit
19+
1520
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1621

1722
- uses: fossas/fossa-action@c0a7d013f84c8ee5e910593186598625513cc1e4 # v1.6.0

.github/workflows/integration_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ jobs:
1010
runs-on: ubuntu-latest
1111
timeout-minutes: 10
1212
steps:
13+
- name: Harden the runner (Audit all outbound calls)
14+
uses: step-security/harden-runner@v2
15+
with:
16+
egress-policy: audit
17+
1318
- name: Free disk space
1419
run: |
1520
df -h

.github/workflows/markdown-link-check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
markdown-link-check:
1616
runs-on: ubuntu-latest
1717
steps:
18+
- name: Harden the runner (Audit all outbound calls)
19+
uses: step-security/harden-runner@v2
20+
with:
21+
egress-policy: audit
22+
1823
- uses: actions/checkout@v4
1924

2025
- name: Install markdown-link-check

.github/workflows/ossf-scorecard.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
# Needed for GitHub OIDC token if publish_results is true
2020
id-token: write
2121
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
24+
with:
25+
egress-policy: audit
26+
2227
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2328
with:
2429
persist-credentials: false

.github/workflows/pr_naming.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ jobs:
88
validate-pr-title:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Harden the runner (Audit all outbound calls)
12+
uses: step-security/harden-runner@v2
13+
with:
14+
egress-policy: audit
15+
1116
- name: PR Conventional Commit Validation
1217
uses: ytanikin/[email protected]
1318
with:

.github/workflows/semver.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ jobs:
1010
timeout-minutes: 10
1111
if: ${{ github.event.label.name == 'semver-check' || contains(github.event.pull_request.labels.*.name, 'semver-check') }}
1212
steps:
13+
- name: Harden the runner (Audit all outbound calls)
14+
uses: step-security/harden-runner@v2
15+
with:
16+
egress-policy: audit
17+
1318
- uses: actions/checkout@v4
1419
with:
1520
submodules: true

0 commit comments

Comments
 (0)