Skip to content

Commit 304dddd

Browse files
committed
ci: add CodeQL, Scorecard, and dependency-review workflows
- codeql.yml: reuses existing .github/codeql/codeql-config.yml (security-extended + security-and-quality queries), weekly + per-PR. - scorecard.yml: weekly OpenSSF Scorecard analysis, publishes to scorecard.dev and uploads SARIF to the Security tab. - dependency-review.yml: blocks PRs that introduce vulnerable dependencies at moderate severity or above. All actions SHA-pinned. Covers: ER-19/20/21, GH-19. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent 139e9bf commit 304dddd

File tree

3 files changed

+102
-0
lines changed

3 files changed

+102
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# Weekly, Monday 06:00 UTC — catches advisories for deps that change slowly.
10+
- cron: '0 6 * * 1'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
analyze:
18+
name: Analyze (${{ matrix.language }})
19+
runs-on: ubuntu-latest
20+
permissions:
21+
actions: read
22+
contents: read
23+
security-events: write
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language: [python]
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
34+
with:
35+
languages: ${{ matrix.language }}
36+
config-file: ./.github/codeql/codeql-config.yml
37+
queries: security-extended,security-and-quality
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
41+
with:
42+
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+
10+
jobs:
11+
dependency-review:
12+
name: Review dependency changes
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
18+
- name: Dependency Review
19+
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
20+
with:
21+
fail-on-severity: moderate
22+
comment-summary-in-pr: true

.github/workflows/scorecard.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: OpenSSF Scorecard
2+
3+
on:
4+
branch_protection_rule:
5+
schedule:
6+
- cron: '0 6 * * 1'
7+
push:
8+
branches: [main]
9+
workflow_dispatch:
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
name: Scorecard analysis
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write
19+
id-token: write
20+
contents: read
21+
actions: read
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
with:
26+
persist-credentials: false
27+
28+
- name: Run analysis
29+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
30+
with:
31+
results_file: results.sarif
32+
results_format: sarif
33+
publish_results: true
34+
35+
- name: Upload SARIF
36+
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
37+
with:
38+
sarif_file: results.sarif

0 commit comments

Comments
 (0)