Skip to content

Commit 845b090

Browse files
authored
ci(053): supply-chain security workflows — CodeQL, Scorecard, dep-review, Trivy, SHA-pinning (WP-B1–B5) (#501)
* ci(053): add CodeQL analysis for Go + JS/TS (WP-B1) * ci(053): add OpenSSF Scorecard workflow + README badge (WP-B2) * ci(053): add dependency-review gate on PRs (WP-B3) * ci(053): add Trivy image scan to scanner-images build (WP-B4) * ci(053): pin all GitHub Actions to commit SHAs (WP-B5) * fix(053): use autobuild for CodeQL Go analysis (build-mode:none unsupported for Go)
1 parent e9352a0 commit 845b090

16 files changed

Lines changed: 294 additions & 111 deletions

.github/actions/build-linux-packages/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ runs:
4343
ls -la linux-packages/
4444
4545
- name: Upload Linux packages artifact
46-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4747
with:
4848
name: linux-packages-${{ inputs.goarch }}
4949
path: linux-packages/*

.github/workflows/claude-md-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
check-size:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1313

1414
- name: Check CLAUDE.md size
1515
run: |

.github/workflows/codeql.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CodeQL Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
# Weekly scan — Tuesday 03:17 UTC (off-peak, avoids Monday congestion)
12+
- cron: '17 3 * * 2'
13+
14+
permissions:
15+
security-events: write
16+
packages: read
17+
actions: read
18+
contents: read
19+
20+
jobs:
21+
analyze:
22+
name: Analyze (${{ matrix.language }})
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- language: go
30+
# build-mode: autobuild — CodeQL 2.25.x does not support
31+
# build-mode:none for Go; autobuild runs `go build ./...` which
32+
# is sufficient because the standard module builds cleanly on
33+
# ubuntu-latest (verified by the Build CI job).
34+
build-mode: autobuild
35+
- language: javascript-typescript
36+
# build-mode: none — default for JS/TS; no compilation needed.
37+
build-mode: none
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
42+
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
45+
with:
46+
languages: ${{ matrix.language }}
47+
build-mode: ${{ matrix.build-mode }}
48+
49+
- name: Autobuild
50+
if: matrix.build-mode == 'autobuild'
51+
uses: github/codeql-action/autobuild@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
52+
53+
- name: Perform CodeQL Analysis
54+
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
55+
with:
56+
category: /language:${{ matrix.language }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Dependency Review
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
dependency-review:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
17+
18+
- name: Dependency Review
19+
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
20+
with:
21+
fail-on-severity: high
22+
comment-summary-in-pr: on-failure

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
build:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2525

2626
- name: Setup Node.js
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2828
with:
2929
node-version: '20'
3030
cache: 'npm'
@@ -59,7 +59,7 @@ jobs:
5959
github.event_name == 'push' &&
6060
github.ref == 'refs/heads/main' &&
6161
github.repository == 'smart-mcp-proxy/mcpproxy-go'
62-
uses: cloudflare/wrangler-action@v3
62+
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3.9.0
6363
with:
6464
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
6565
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

.github/workflows/e2e-tests.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1717

1818
- name: Setup Node.js
19-
uses: actions/setup-node@v4
19+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2020
with:
2121
node-version: '20'
2222
cache: 'npm'
@@ -29,7 +29,7 @@ jobs:
2929
run: cd frontend && npm run build
3030

3131
- name: Upload frontend artifact
32-
uses: actions/upload-artifact@v4
32+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3333
with:
3434
name: frontend-dist-e2e
3535
path: frontend/dist/
@@ -52,10 +52,10 @@ jobs:
5252

5353
steps:
5454
- name: Checkout code
55-
uses: actions/checkout@v4
55+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
5656

5757
- name: Set up Go
58-
uses: actions/setup-go@v5
58+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
5959
with:
6060
go-version: ${{ matrix.go-version }}
6161
cache: true
@@ -67,7 +67,7 @@ jobs:
6767
run: go mod verify
6868

6969
- name: Download frontend artifact
70-
uses: actions/download-artifact@v4
70+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
7171
with:
7272
name: frontend-dist-e2e
7373
path: frontend/dist
@@ -176,16 +176,16 @@ jobs:
176176

177177
steps:
178178
- name: Checkout code
179-
uses: actions/checkout@v4
179+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
180180

181181
- name: Set up Go
182-
uses: actions/setup-go@v5
182+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
183183
with:
184184
go-version: "1.25"
185185
cache: true
186186

187187
- name: Download frontend artifact
188-
uses: actions/download-artifact@v4
188+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
189189
with:
190190
name: frontend-dist-e2e
191191
path: frontend/dist
@@ -239,7 +239,7 @@ jobs:
239239
go tool cover -html=coverage-logs.out -o coverage-logs.html
240240
241241
- name: Upload coverage reports
242-
uses: codecov/codecov-action@v3
242+
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
243243
with:
244244
file: ./coverage.out
245245
flags: e2e-tests
@@ -272,16 +272,16 @@ jobs:
272272

273273
steps:
274274
- name: Checkout code
275-
uses: actions/checkout@v4
275+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
276276

277277
- name: Set up Go
278-
uses: actions/setup-go@v5
278+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
279279
with:
280280
go-version: "1.25"
281281
cache: true
282282

283283
- name: Download frontend artifact
284-
uses: actions/download-artifact@v4
284+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
285285
with:
286286
name: frontend-dist-e2e
287287
path: frontend/dist
@@ -433,10 +433,10 @@ jobs:
433433

434434
steps:
435435
- name: Checkout code
436-
uses: actions/checkout@v4
436+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
437437

438438
- name: Set up Go
439-
uses: actions/setup-go@v5
439+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
440440
with:
441441
go-version: "1.25"
442442
cache: true
@@ -460,16 +460,16 @@ jobs:
460460

461461
steps:
462462
- name: Checkout code
463-
uses: actions/checkout@v4
463+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
464464

465465
- name: Set up Go
466-
uses: actions/setup-go@v5
466+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
467467
with:
468468
go-version: "1.25"
469469
cache: true
470470

471471
- name: Download frontend artifact
472-
uses: actions/download-artifact@v4
472+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
473473
with:
474474
name: frontend-dist-e2e
475475
path: frontend/dist

.github/workflows/frontend.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2121

2222
- name: Setup Node.js
23-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2424
with:
2525
node-version: '20'
2626
cache: 'npm'
@@ -42,8 +42,8 @@ jobs:
4242
run: cd frontend && npm run build
4343

4444
- name: Upload build artifacts
45-
uses: actions/upload-artifact@v4
45+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4646
with:
4747
name: frontend-dist
4848
path: frontend/dist/
49-
retention-days: 7
49+
retention-days: 7

.github/workflows/pr-build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
latest_tag: ${{ steps.version.outputs.latest_tag }}
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2020
with:
2121
fetch-depth: 0
2222

@@ -47,10 +47,10 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- name: Checkout
50-
uses: actions/checkout@v4
50+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
5151

5252
- name: Set up Go
53-
uses: actions/setup-go@v5
53+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
5454
with:
5555
go-version: "1.25"
5656

@@ -66,10 +66,10 @@ jobs:
6666
runs-on: ubuntu-latest
6767
steps:
6868
- name: Checkout
69-
uses: actions/checkout@v4
69+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
7070

7171
- name: Setup Node.js
72-
uses: actions/setup-node@v4
72+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7373
with:
7474
node-version: '20'
7575
cache: 'npm'
@@ -82,7 +82,7 @@ jobs:
8282
run: cd frontend && npm run build
8383

8484
- name: Upload frontend artifact
85-
uses: actions/upload-artifact@v4
85+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
8686
with:
8787
name: frontend-dist-pr
8888
path: frontend/dist/
@@ -136,12 +136,12 @@ jobs:
136136

137137
steps:
138138
- name: Checkout
139-
uses: actions/checkout@v4
139+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
140140
with:
141141
fetch-depth: 0
142142

143143
- name: Set up Go
144-
uses: actions/setup-go@v5
144+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
145145
with:
146146
go-version: "1.25"
147147
cache: false # Disable built-in cache to use explicit cache step below
@@ -153,7 +153,7 @@ jobs:
153153
rm -rf ~/go/pkg/mod/golang.org/toolchain* || true
154154
155155
- name: Cache Go modules and build
156-
uses: actions/cache@v4
156+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
157157
with:
158158
path: |
159159
~/.cache/go-build
@@ -167,7 +167,7 @@ jobs:
167167
run: go mod download
168168

169169
- name: Download frontend artifact
170-
uses: actions/download-artifact@v4
170+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
171171
with:
172172
name: frontend-dist-pr
173173
path: frontend/dist
@@ -357,15 +357,15 @@ jobs:
357357
echo "Production builds go through full notarization in release workflow"
358358
359359
- name: Upload archive artifact
360-
uses: actions/upload-artifact@v4
360+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
361361
with:
362362
name: archive-${{ matrix.goos }}-${{ matrix.goarch }}
363363
path: mcpproxy-*-${{ matrix.goos }}-${{ matrix.goarch }}.${{ matrix.archive_format }}
364364
retention-days: 14
365365

366366
- name: Upload macOS installer DMG
367367
if: matrix.goos == 'darwin'
368-
uses: actions/upload-artifact@v4
368+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
369369
with:
370370
name: installer-dmg-${{ matrix.goos }}-${{ matrix.goarch }}
371371
path: mcpproxy-*-darwin-${{ matrix.goarch }}-installer.dmg

0 commit comments

Comments
 (0)