Skip to content

Commit 2b12bd4

Browse files
feat: Add Dependabot and CVE scanning workflows (#56)
* feat: Add Dependabot for dependency updates and CVE scanning workflow - Add Dependabot config for Maven dependencies (grouped by ecosystem) and GitHub Actions, running weekly on Mondays - Add CVE scan workflow with: - OSSF Scorecard for supply chain security - Dependency Review on PRs (blocks on high severity or GPL licenses) - Trivy filesystem scan for known vulnerabilities - All scan results uploaded as SARIF to GitHub Security tab Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Update trivy-action to v0.35.0 The 0.28.0 version was flagged as compromised (GHSA-69fq-xp46-6x23) and could not be resolved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Pin all GitHub Actions by commit SHA and fix Trivy build step - Pin all actions across ci.yml, release.yml, and cve-scan.yml to commit SHAs to satisfy OSSF Scorecard pinned-dependencies check - Scope permissions per-job instead of top-level in cve-scan.yml - Change mvn dependency:resolve to mvn install -DskipTests so inter-module SNAPSHOT artifacts are available for Trivy scan Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Revert to version tags for actions and fix Trivy build step Revert SHA pinning back to readable version tags — Dependabot keeps them updated. Keep the actual fix: mvn install -DskipTests for Trivy and per-job permissions scoping in cve-scan.yml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5789108 commit 2b12bd4

2 files changed

Lines changed: 139 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: 2
2+
updates:
3+
# Maven dependencies
4+
- package-ecosystem: "maven"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
open-pull-requests-limit: 10
10+
labels:
11+
- "dependencies"
12+
commit-message:
13+
prefix: "deps"
14+
groups:
15+
kotlin:
16+
patterns:
17+
- "org.jetbrains.kotlin*"
18+
- "org.jetbrains.dokka*"
19+
spring-boot:
20+
patterns:
21+
- "org.springframework.boot*"
22+
- "org.springframework*"
23+
jackson:
24+
patterns:
25+
- "tools.jackson*"
26+
- "com.fasterxml.jackson*"
27+
testing:
28+
patterns:
29+
- "io.kotest*"
30+
- "io.mockk*"
31+
- "org.testcontainers*"
32+
- "au.com.dius.pact*"
33+
34+
# GitHub Actions
35+
- package-ecosystem: "github-actions"
36+
directory: "/"
37+
schedule:
38+
interval: "weekly"
39+
day: "monday"
40+
open-pull-requests-limit: 5
41+
labels:
42+
- "dependencies"
43+
- "ci"
44+
commit-message:
45+
prefix: "ci"

.github/workflows/cve-scan.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CVE Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
# Run every Monday at 06:00 UTC
12+
- cron: '0 6 * * 1'
13+
14+
permissions: {}
15+
16+
jobs:
17+
ossf-scorecard:
18+
name: OSSF Scorecard
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
security-events: write
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
27+
28+
- name: Run OSSF Scorecard
29+
uses: ossf/scorecard-action@v2.4.1
30+
with:
31+
results_file: results.sarif
32+
results_format: sarif
33+
publish_results: true
34+
35+
- name: Upload SARIF to GitHub Security
36+
uses: github/codeql-action/upload-sarif@v3
37+
with:
38+
sarif_file: results.sarif
39+
40+
dependency-review:
41+
name: Dependency Review
42+
if: github.event_name == 'pull_request'
43+
runs-on: ubuntu-latest
44+
permissions:
45+
contents: read
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Dependency Review
50+
uses: actions/dependency-review-action@v4
51+
with:
52+
fail-on-severity: high
53+
deny-licenses: GPL-2.0, GPL-3.0, AGPL-3.0
54+
55+
trivy:
56+
name: Trivy Vulnerability Scan
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: read
60+
security-events: write
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Set up JDK 25
65+
uses: actions/setup-java@v4
66+
with:
67+
distribution: temurin
68+
java-version: 25
69+
70+
- name: Cache Maven dependencies
71+
uses: actions/cache@v4
72+
with:
73+
path: ~/.m2/repository
74+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
75+
restore-keys: |
76+
${{ runner.os }}-maven-
77+
78+
- name: Build to resolve dependencies
79+
run: mvn install -B -q -DskipTests
80+
81+
- name: Run Trivy vulnerability scanner
82+
uses: aquasecurity/trivy-action@v0.35.0
83+
with:
84+
scan-type: fs
85+
scan-ref: .
86+
scanners: vuln
87+
format: sarif
88+
output: trivy-results.sarif
89+
severity: CRITICAL,HIGH
90+
91+
- name: Upload Trivy SARIF to GitHub Security
92+
uses: github/codeql-action/upload-sarif@v3
93+
with:
94+
sarif_file: trivy-results.sarif

0 commit comments

Comments
 (0)