Skip to content

Commit ee4f02d

Browse files
authored
fix: hardening workflows test (#1554)
2 parents 6340326 + 1501b3a commit ee4f02d

File tree

5 files changed

+118
-33
lines changed

5 files changed

+118
-33
lines changed

.github/workflows/certora-prover.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,20 @@ jobs:
3838
github.event_name == 'workflow_dispatch'
3939
runs-on: protocol-x64-16core
4040
steps:
41+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
42+
with:
43+
egress-policy: audit
44+
4145
# Checkout the repository with submodules
42-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
4347
with:
4448
submodules: recursive
4549
# Use dev branch for scheduled runs, otherwise use the branch that triggered the workflow
4650
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref }}
4751

4852
# Install the Foundry toolchain
4953
- name: Install Foundry
50-
uses: foundry-rs/foundry-toolchain@v1
54+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
5155
with:
5256
version: stable
5357

@@ -56,7 +60,7 @@ jobs:
5660
run: forge install
5761

5862
# Run Certora compilation step only
59-
- uses: Certora/certora-run-action@v1
63+
- uses: Certora/certora-run-action@56c6a98e84eee5cd3a135967a9a4bc06ef6d38cc
6064
with:
6165
# List of configuration files for different contracts to verify
6266
configurations: |-
@@ -94,16 +98,20 @@ jobs:
9498
github.event_name == 'schedule' ||
9599
github.event_name == 'workflow_dispatch'
96100
steps:
101+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
102+
with:
103+
egress-policy: audit
104+
97105
# Checkout the repository with submodules
98-
- uses: actions/checkout@v4
106+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
99107
with:
100108
submodules: recursive
101109
# Use dev branch for scheduled runs, otherwise use the branch that triggered the workflow
102110
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref }}
103111

104112
# Install the Foundry toolchain.
105113
- name: Install Foundry
106-
uses: foundry-rs/foundry-toolchain@v1
114+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
107115
with:
108116
version: stable
109117

@@ -112,7 +120,7 @@ jobs:
112120
run: forge install
113121

114122
# Run Certora verification with the same configurations
115-
- uses: Certora/certora-run-action@v1
123+
- uses: Certora/certora-run-action@56c6a98e84eee5cd3a135967a9a4bc06ef6d38cc
116124
with:
117125
# List of configuration files for different contracts to verify
118126
configurations: |-

.github/workflows/checks.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,49 @@ jobs:
1616
name: Typo Linting
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
20-
- uses: crate-ci/[email protected]
19+
- name: Harden Runner
20+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
21+
with:
22+
egress-policy: block
23+
allowed-endpoints: >
24+
github.com:443
25+
release-assets.githubusercontent.com:443
26+
objects.githubusercontent.com:443
27+
release-assets.githubusercontent.com:443
28+
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
30+
- uses: crate-ci/typos@717cd03663352cbd05e4d28c01366e571ff5f2ed
2131
with:
2232
config: .github/configs/typos-cli.toml
2333

2434
go-bindings:
2535
name: Bindings
2636
runs-on: ubuntu-latest
2737
steps:
28-
- uses: actions/checkout@v4
38+
- name: Harden Runner
39+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
40+
with:
41+
egress-policy: block
42+
allowed-endpoints: >
43+
archive.ubuntu.com:80
44+
auth.docker.io:443
45+
binaries.soliditylang.org:443
46+
foundry.paradigm.xyz:443
47+
gethstore.blob.core.windows.net:443
48+
github.com:443
49+
production.cloudflare.docker.com:443
50+
raw.githubusercontent.com:443
51+
registry-1.docker.io:443
52+
release-assets.githubusercontent.com:443
53+
security.ubuntu.com:80
54+
objects.githubusercontent.com:443
55+
56+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2957
with:
3058
fetch-depth: 0
3159
- name: Build and validate
3260
if: github.event_name == 'push'
3361
run: |
3462
make docker
3563
docker run -v `pwd`:/build -w /build --rm -i eigenlayer-contracts:latest bash -c "make gha"
36-
if [ ! -z "$(git status --porcelain)" ]; then git diff; git status; exit 1; fi
64+
if [ ! -z "$(git status --porcelain)" ]; then git diff; git status; exit 1; fi

.github/workflows/foundry-post-merge.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,24 @@ jobs:
3030
strategy:
3131
fail-fast: true
3232
steps:
33+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
34+
with:
35+
egress-policy: block
36+
allowed-endpoints: >
37+
binaries.soliditylang.org:443
38+
github.com:443
39+
release-assets.githubusercontent.com:443
40+
eth-mainnet.g.alchemy.com:443
41+
powerful-dimensional-season.ethereum-holesky.quiknode.pro:443
42+
3343
# Check out repository with all submodules for complete codebase access.
34-
- uses: actions/checkout@v4
44+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3545
with:
3646
submodules: recursive
3747

3848
# Restore Forge cache
3949
- name: Cache Forge Build
40-
uses: actions/cache@v3
50+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
4151
with:
4252
path: |
4353
cache/
@@ -48,7 +58,7 @@ jobs:
4858
4959
# Install the Foundry toolchain.
5060
- name: "Install Foundry"
51-
uses: foundry-rs/foundry-toolchain@v1
61+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
5262
with:
5363
version: stable
5464

.github/workflows/foundry.yml

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,25 @@ jobs:
2727
suite: [Unit, Integration, Fork]
2828

2929
steps:
30+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
31+
with:
32+
egress-policy: block
33+
allowed-endpoints: >
34+
binaries.soliditylang.org:443
35+
github.com:443
36+
release-assets.githubusercontent.com:443
37+
eth-mainnet.g.alchemy.com:443
38+
powerful-dimensional-season.ethereum-holesky.quiknode.pro:443
39+
objects.githubusercontent.com:443
40+
3041
# Check out repository with all submodules for complete codebase access.
31-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3243
with:
3344
submodules: recursive
3445

3546
# Restore Forge cache
3647
- name: Cache Forge Build
37-
uses: actions/cache@v3
48+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
3849
with:
3950
path: |
4051
cache/
@@ -45,7 +56,7 @@ jobs:
4556
4657
# Install the Foundry toolchain.
4758
- name: Install Foundry
48-
uses: foundry-rs/foundry-toolchain@v1
59+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
4960
with:
5061
version: stable
5162

@@ -83,14 +94,23 @@ jobs:
8394
name: Test (Storage)
8495
runs-on: protocol-x64-16core
8596
steps:
97+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
98+
with:
99+
egress-policy: block
100+
allowed-endpoints: >
101+
api.etherscan.io:443
102+
binaries.soliditylang.org:443
103+
eth-mainnet.g.alchemy.com:443
104+
github.com:443
105+
release-assets.githubusercontent.com:443
86106
# Check out repository with all submodules for complete codebase access.
87-
- uses: actions/checkout@v4
107+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
88108
with:
89109
submodules: recursive
90110

91111
# Restore Forge cache
92112
- name: Cache Forge Build
93-
uses: actions/cache@v3
113+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
94114
with:
95115
path: |
96116
cache/
@@ -101,7 +121,7 @@ jobs:
101121
102122
# Install the Foundry toolchain.
103123
- name: "Install Foundry"
104-
uses: foundry-rs/foundry-toolchain@v1
124+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
105125
with:
106126
version: stable
107127

@@ -119,14 +139,23 @@ jobs:
119139
name: Coverage
120140
runs-on: protocol-x64-16core
121141
steps:
142+
143+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
144+
with:
145+
egress-policy: block
146+
allowed-endpoints: >
147+
binaries.soliditylang.org:443
148+
github.com:443
149+
release-assets.githubusercontent.com:443
150+
122151
# Check out repository with all submodules for complete codebase access.
123-
- uses: actions/checkout@v4
152+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
124153
with:
125154
submodules: recursive
126155

127156
# Restore Foundry and Forge cache
128157
- name: Cache Foundry Dependencies
129-
uses: actions/cache@v3
158+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
130159
with:
131160
path: |
132161
~/.cargo
@@ -139,7 +168,7 @@ jobs:
139168
140169
# Install the Foundry toolchain.
141170
- name: "Install Foundry"
142-
uses: foundry-rs/foundry-toolchain@v1
171+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
143172
with:
144173
version: stable
145174

@@ -169,7 +198,7 @@ jobs:
169198
170199
# Upload coverage report as artifact before potential failure
171200
- name: Upload Coverage Report
172-
uses: actions/upload-artifact@v4
201+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
173202
with:
174203
name: code-coverage-report
175204
path: report/*
@@ -208,14 +237,24 @@ jobs:
208237
name: Size Diff
209238
runs-on: protocol-x64-16core
210239
steps:
240+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
241+
with:
242+
egress-policy: block
243+
allowed-endpoints: >
244+
*.blob.core.windows.net:443
245+
binaries.soliditylang.org:443
246+
github.com:443
247+
objects.githubusercontent.com:443
248+
release-assets.githubusercontent.com:443
249+
211250
# Check out repository with all submodules for complete codebase access.
212-
- uses: actions/checkout@v4
251+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
213252
with:
214253
submodules: recursive
215254

216255
# Install the Foundry toolchain.
217256
- name: "Install Foundry"
218-
uses: foundry-rs/foundry-toolchain@v1
257+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
219258
with:
220259
version: stable
221260

@@ -276,3 +315,4 @@ jobs:
276315
if [ "$has_differences" -eq 0 ]; then
277316
echo -e "\033[1;32m✨ No contract size changes detected ✨\033[0m"
278317
fi
318+

.github/workflows/validate-deployment-scripts.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,21 @@ jobs:
2121
env: [preprod, testnet, mainnet, testnet-sepolia, testnet-hoodi, testnet-base-sepolia]
2222

2323
steps:
24-
# Check out repository with all submodules for complete codebase access.
25-
- uses: actions/checkout@v4
24+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911
2625
with:
27-
submodules: recursive
26+
egress-policy: audit
2827

29-
- name: Setup Node.js
30-
uses: actions/setup-node@v3
28+
# Check out repository with all submodules for complete codebase access.
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3130
with:
32-
node-version: '18'
31+
submodules: recursive
3332

3433
- name: Install Zeus
3534
run: npm install -g @layr-labs/zeus
3635

3736
# Restore Forge cache
3837
- name: Cache Forge Build
39-
uses: actions/cache@v3
38+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
4039
with:
4140
path: |
4241
cache/
@@ -47,7 +46,7 @@ jobs:
4746
4847
# Install the Foundry toolchain.
4948
- name: Install Foundry
50-
uses: foundry-rs/foundry-toolchain@v1
49+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
5150
with:
5251
version: stable
5352

0 commit comments

Comments
 (0)