Skip to content

Commit 5c2025f

Browse files
Workflows security updates (#1057) (#1835)
Co-authored-by: Sourabh Mehta <[email protected]>
1 parent 2cd6fc0 commit 5c2025f

File tree

12 files changed

+201
-4
lines changed

12 files changed

+201
-4
lines changed

.github/workflows/buildmgr.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ jobs:
6262
fail-fast: true
6363
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
6464
steps:
65+
- name: Harden Runner
66+
if: ${{ !github.event.repository.private }}
67+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
68+
with:
69+
egress-policy: audit
70+
6571
- name: Checkout devtools
6672
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6773
with:
@@ -94,6 +100,12 @@ jobs:
94100
runs-on: ubuntu-22.04
95101
timeout-minutes: 5
96102
steps:
103+
- name: Harden Runner
104+
if: ${{ !github.event.repository.private }}
105+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
106+
with:
107+
egress-policy: audit
108+
97109
- name: Checkout devtools
98110
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99111
with:
@@ -107,7 +119,6 @@ jobs:
107119
wget -q http://security.ubuntu.com/ubuntu/pool/main//d/doxygen/doxygen_1.8.6-2_amd64.deb
108120
sudo dpkg -i doxygen_1.8.6-2_amd64.deb
109121
sudo pip install LinkChecker
110-
111122
- name: Create build folder
112123
run: mkdir build
113124

@@ -188,6 +199,12 @@ jobs:
188199
runs-on: ubuntu-20.04
189200
timeout-minutes: 15
190201
steps:
202+
- name: Harden Runner
203+
if: ${{ !github.event.repository.private }}
204+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
205+
with:
206+
egress-policy: audit
207+
191208
- name: Install deps
192209
run: |
193210
sudo apt-get update
@@ -315,6 +332,12 @@ jobs:
315332
#fail-fast: true
316333
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
317334
steps:
335+
- name: Harden Runner
336+
if: ${{ !github.event.repository.private }}
337+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
338+
with:
339+
egress-policy: audit
340+
318341
- name: Install macos deps
319342
if: ${{ startsWith(matrix.runs_on, 'macos') }}
320343
run: |
@@ -354,7 +377,6 @@ jobs:
354377
run: |
355378
test -f ${installer_name} || wget -q ${arm_gcc_install_base}/${installer_name}
356379
tar -xvf ${installer_name}
357-
358380
- name: Setup ARM GCC for Windows
359381
if: ${{ startsWith(matrix.runs_on, 'windows') }}
360382
env:
@@ -469,6 +491,11 @@ jobs:
469491
strategy:
470492
fail-fast: true
471493
steps:
494+
- name: Harden Runner
495+
if: ${{ !github.event.repository.private }}
496+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
497+
with:
498+
egress-policy: audit
472499
- name: Install dependencies
473500
run: |
474501
sudo apt-get update
@@ -590,6 +617,12 @@ jobs:
590617
fail-fast: true
591618
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
592619
steps:
620+
- name: Harden Runner
621+
if: ${{ !github.event.repository.private }}
622+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
623+
with:
624+
egress-policy: audit
625+
593626
- name: Download cbuild_install
594627
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
595628
with:
@@ -609,12 +642,10 @@ jobs:
609642
echo "$AC5_TOOLCHAIN_ROOT" >> config
610643
echo "$GCC_TOOLCHAIN_ROOT" >> config
611644
./cbuild_install.sh < config
612-
613645
- name: Test cbuildgen
614646
shell: bash
615647
run: |
616648
${{ github.workspace }}/cbuild/bin/cbuildgen | grep "(cbuildgen): Build Process Manager"
617-
618649
sanity-check-docker:
619650
needs: create_installer
620651
timeout-minutes: 15
@@ -631,6 +662,12 @@ jobs:
631662
matrix:
632663
image: [ "debian:buster" ]
633664
steps:
665+
- name: Harden Runner
666+
if: ${{ !github.event.repository.private }}
667+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
668+
with:
669+
egress-policy: audit
670+
634671
- name: Download cbuild_install
635672
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
636673
with:
@@ -660,6 +697,12 @@ jobs:
660697
needs: [ tests ]
661698
runs-on: ubuntu-22.04
662699
steps:
700+
- name: Harden Runner
701+
if: ${{ !github.event.repository.private }}
702+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
703+
with:
704+
egress-policy: audit
705+
663706
- name: Event File
664707
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
665708
with:

.github/workflows/cpp-linter.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,22 @@ concurrency:
2222
env:
2323
linter_report: "cppcheck_report.md"
2424

25+
permissions:
26+
contents: read
27+
2528
jobs:
2629

2730
lint:
2831
name: cppcheck
2932
runs-on: ubuntu-22.04
3033

3134
steps:
35+
- name: Harden Runner
36+
if: ${{ !github.event.repository.private }}
37+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
38+
with:
39+
egress-policy: audit
40+
3241
- name: Checkout devtools
3342
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3443

.github/workflows/global.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@ on:
33
pull_request:
44
release:
55
types: [ published ]
6+
permissions:
7+
contents: read
8+
69
jobs:
710
copyright:
811
runs-on: ubuntu-22.04
912
steps:
13+
- name: Harden Runner
14+
if: ${{ !github.event.repository.private }}
15+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
16+
with:
17+
egress-policy: audit
18+
1019
- name: Checkout devtools
1120
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1221

.github/workflows/markdown.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ jobs:
1111
name: Lint markdown files
1212
runs-on: ubuntu-22.04
1313
steps:
14+
- name: Harden Runner
15+
if: ${{ !github.event.repository.private }}
16+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
17+
with:
18+
egress-policy: audit
19+
1420
- name: Checkout devtools
1521
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1622

.github/workflows/nightly.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: nightly
23

34
on:
@@ -33,6 +34,12 @@ jobs:
3334
runs-on: ubuntu-22.04
3435
needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ]
3536
steps:
37+
- name: Harden Runner
38+
if: ${{ !github.event.repository.private }}
39+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
40+
with:
41+
egress-policy: audit
42+
3643
- name: Install dependencies
3744
run: |
3845
sudo apt-get update

.github/workflows/packchk.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ jobs:
6060
fail-fast: true
6161
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
6262
steps:
63+
- name: Harden Runner
64+
if: ${{ !github.event.repository.private }}
65+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
66+
with:
67+
egress-policy: audit
68+
6369
- name: Checkout devtools
6470
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6571
with:
@@ -100,6 +106,12 @@ jobs:
100106
fail-fast: false
101107
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
102108
steps:
109+
- name: Harden Runner
110+
if: ${{ !github.event.repository.private }}
111+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
112+
with:
113+
egress-policy: audit
114+
103115
- name: Checkout devtools
104116
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105117
with:
@@ -164,6 +176,12 @@ jobs:
164176
runs-on: ubuntu-22.04
165177
timeout-minutes: 15
166178
steps:
179+
- name: Harden Runner
180+
if: ${{ !github.event.repository.private }}
181+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
182+
with:
183+
egress-policy: audit
184+
167185
- name: Install dependencies
168186
run: |
169187
sudo apt-get update
@@ -302,6 +320,12 @@ jobs:
302320
needs: [ test ]
303321
runs-on: ubuntu-22.04
304322
steps:
323+
- name: Harden Runner
324+
if: ${{ !github.event.repository.private }}
325+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
326+
with:
327+
egress-policy: audit
328+
305329
- name: Event File
306330
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
307331
with:

.github/workflows/packgen.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
fail-fast: true
5656
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
5757
steps:
58+
- name: Harden Runner
59+
if: ${{ !github.event.repository.private }}
60+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
61+
with:
62+
egress-policy: audit
63+
5864
- name: Checkout devtools
5965
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6066
with:
@@ -154,6 +160,12 @@ jobs:
154160
fail-fast: true
155161
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
156162
steps:
163+
- name: Harden Runner
164+
if: ${{ !github.event.repository.private }}
165+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
166+
with:
167+
egress-policy: audit
168+
157169
- name: Checkout devtools
158170
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
159171
with:
@@ -195,6 +207,12 @@ jobs:
195207
runs-on: ubuntu-22.04
196208
timeout-minutes: 15
197209
steps:
210+
- name: Harden Runner
211+
if: ${{ !github.event.repository.private }}
212+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
213+
with:
214+
egress-policy: audit
215+
198216
- name: Install linux deps
199217
run: |
200218
sudo apt-get update
@@ -279,6 +297,12 @@ jobs:
279297
needs: [ unittest ]
280298
runs-on: ubuntu-22.04
281299
steps:
300+
- name: Harden Runner
301+
if: ${{ !github.event.repository.private }}
302+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
303+
with:
304+
egress-policy: audit
305+
282306
- name: Event File
283307
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
284308
with:

.github/workflows/projmgr.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ jobs:
6161
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
6262

6363
steps:
64+
- name: Harden Runner
65+
if: ${{ !github.event.repository.private }}
66+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
67+
with:
68+
egress-policy: audit
69+
6470
- name: Checkout devtools
6571
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6672
with:
@@ -91,6 +97,12 @@ jobs:
9197
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
9298

9399
steps:
100+
- name: Harden Runner
101+
if: ${{ !github.event.repository.private }}
102+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
103+
with:
104+
egress-policy: audit
105+
94106
- name: Checkout devtools
95107
if: matrix.pyswig || matrix.goswig
96108
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -299,6 +311,12 @@ jobs:
299311
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
300312

301313
steps:
314+
- name: Harden Runner
315+
if: ${{ !github.event.repository.private }}
316+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
317+
with:
318+
egress-policy: audit
319+
302320
- name: Checkout devtools
303321
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
304322
with:
@@ -349,6 +367,12 @@ jobs:
349367
runs-on: ubuntu-22.04
350368
timeout-minutes: 15
351369
steps:
370+
- name: Harden Runner
371+
if: ${{ !github.event.repository.private }}
372+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
373+
with:
374+
egress-policy: audit
375+
352376
- name: Install linux deps
353377
run: |
354378
sudo apt-get update
@@ -433,6 +457,12 @@ jobs:
433457
needs: [ unittest ]
434458
runs-on: ubuntu-22.04
435459
steps:
460+
- name: Harden Runner
461+
if: ${{ !github.event.repository.private }}
462+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
463+
with:
464+
egress-policy: audit
465+
436466
- name: Event File
437467
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
438468
with:

.github/workflows/scorecard.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
# actions: read
2929

3030
steps:
31+
- name: Harden Runner
32+
if: ${{ !github.event.repository.private }}
33+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
34+
with:
35+
egress-policy: audit
36+
3137
- name: "Checkout code"
3238
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3339
with:

0 commit comments

Comments
 (0)