Skip to content

Commit a983419

Browse files
Jonathan D.A. Jewellclaude
andcommitted
fix: OpenSSF Scorecard compliance (permissions, SHA-pins, SAST)
- Add permissions: read-all to workflows - SHA-pin all GitHub Actions - Add Semgrep SAST workflow - Add mirror workflow for GitLab/Bitbucket - Add SPDX license headers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8ab369f commit a983419

3 files changed

Lines changed: 44 additions & 5 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: "CodeQL"
23

34
on:
@@ -32,10 +33,10 @@ jobs:
3233

3334
steps:
3435
- name: Checkout repository
35-
uses: actions/checkout@v6
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3637

3738
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@v3
39+
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3
3940
with:
4041
languages: ${{ matrix.language }}
4142
build-mode: ${{ matrix.build-mode }}
@@ -45,6 +46,6 @@ jobs:
4546
echo 'Build step for compiled languages'
4647
4748
- name: Perform CodeQL Analysis
48-
uses: github/codeql-action/analyze@v3
49+
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3
4950
with:
5051
category: "/language:${{matrix.language}}"

.github/workflows/mirror.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: Mirror to GitLab and Bitbucket
23

34
on:
@@ -7,14 +8,16 @@ on:
78
- 'v*'
89
workflow_dispatch:
910

11+
permissions: read-all
12+
1013
jobs:
1114
mirror-gitlab:
1215
runs-on: ubuntu-latest
1316
if: ${{ vars.GITLAB_MIRROR_ENABLED == 'true' }}
1417

1518
steps:
1619
- name: Checkout
17-
uses: actions/checkout@v6
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1821
with:
1922
fetch-depth: 0
2023

@@ -33,7 +36,7 @@ jobs:
3336

3437
steps:
3538
- name: Checkout
36-
uses: actions/checkout@v6
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3740
with:
3841
fetch-depth: 0
3942

.github/workflows/semgrep.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
2+
name: Semgrep SAST
3+
4+
on:
5+
push:
6+
branches: [main, master]
7+
pull_request:
8+
branches: [main, master]
9+
schedule:
10+
- cron: '0 5 * * 1'
11+
workflow_dispatch:
12+
13+
permissions: read-all
14+
15+
jobs:
16+
semgrep:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
security-events: write
20+
contents: read
21+
container:
22+
image: semgrep/semgrep
23+
steps:
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
26+
- name: Run Semgrep
27+
run: semgrep scan --sarif --output=semgrep.sarif --config=auto .
28+
env:
29+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
30+
31+
- name: Upload SARIF
32+
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
33+
with:
34+
sarif_file: semgrep.sarif
35+
if: always()

0 commit comments

Comments
 (0)