Skip to content

Commit 3ae33cd

Browse files
committed
build: harden security
1 parent 862eaf5 commit 3ae33cd

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

.github/workflows/codeql.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
branches: [ "master" ]
88
schedule:
99
- cron: '31 7 * * 3'
10+
permissions:
11+
contents: read
1012

1113
jobs:
1214
analyze:
@@ -23,19 +25,24 @@ jobs:
2325
language: [ 'go' ]
2426

2527
steps:
28+
- name: Harden the runner (Audit all outbound calls)
29+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
30+
with:
31+
egress-policy: audit
32+
2633
- name: Checkout repository
2734
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2835

29-
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
31-
with:
32-
languages: ${{ matrix.language }}
33-
3436
- name: Setup Go
3537
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3638
with:
3739
go-version-file: 'go.mod'
3840

41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
43+
with:
44+
languages: ${{ matrix.language }}
45+
3946
- name: Build
4047
run: make build
4148

.github/workflows/release-manual.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
outputs:
2424
version: ${{ steps.validate.outputs.version }}
2525
steps:
26+
- name: Harden the runner (Audit all outbound calls)
27+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
28+
with:
29+
egress-policy: audit
30+
2631
- name: Checkout
2732
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2833
with:
@@ -55,6 +60,11 @@ jobs:
5560
permissions:
5661
contents: read
5762
steps:
63+
- name: Harden the runner (Audit all outbound calls)
64+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
65+
with:
66+
egress-policy: audit
67+
5868
- name: Checkout
5969
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6070

@@ -81,6 +91,11 @@ jobs:
8191
outputs:
8292
hashes: ${{ steps.hash.outputs.hashes }}
8393
steps:
94+
- name: Harden the runner (Audit all outbound calls)
95+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
96+
with:
97+
egress-policy: audit
98+
8499
- name: Checkout
85100
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
86101
with:

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
outputs:
2020
hashes: ${{ steps.hash.outputs.hashes }}
2121
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
24+
with:
25+
egress-policy: audit
26+
2227
- name: Checkout
2328
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2429
with:

.github/workflows/scorecard.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ jobs:
3333
# actions: read
3434

3535
steps:
36+
- name: Harden the runner (Audit all outbound calls)
37+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
38+
with:
39+
egress-policy: audit
40+
3641
- name: "Checkout code"
3742
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3843
with:
@@ -75,4 +80,4 @@ jobs:
7580
- name: "Upload to code-scanning"
7681
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
7782
with:
78-
sarif_file: results.sarif
83+
sarif_file: results.sarif

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
matrix:
1515
go-version: ['1.24.3']
1616
steps:
17+
- name: Harden the runner (Audit all outbound calls)
18+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
19+
with:
20+
egress-policy: audit
21+
1722
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1823

1924
- name: Set up Go
@@ -46,4 +51,4 @@ jobs:
4651
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
4752
with:
4853
name: coverage-${{ matrix.go-version }}
49-
path: coverage.html
54+
path: coverage.html

0 commit comments

Comments
 (0)