-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add CodeQL + OWASP Dependency-Check, attach SBOM and attestations to releases #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jcputney
wants to merge
5
commits into
main
Choose a base branch
from
claude/add-sast-sca-sbom-JxH34
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+279
−1
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
012dfcd
ci: add CodeQL + OWASP Dependency-Check, attach SBOM and attestations…
claude 24c25b9
ci(release): fail fast on missing SBOM/JAR instead of warning + glob …
claude 9f7ea7e
ci(depcheck): key NVD cache by ISO week instead of run_id
claude 4834228
ci(depcheck): scope plugin to root + relocate NVD cache off ~/.m2
claude 5e43da8
ci(release): replace SBOM globs with explicit versioned paths in gh r…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: CodeQL | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| # Weekly Monday 09:30 ET (13:30 UTC, no DST drift worth caring about for a | ||
| # weekly cadence). Catches CVEs that land in CodeQL's queries between | ||
| # commits when the repo is otherwise quiet. | ||
| - cron: '30 13 * * 1' | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| actions: read | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (java) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: temurin | ||
| java-version: '17' | ||
|
|
||
| - uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.m2/repository | ||
| key: maven-codeql-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| maven-codeql- | ||
|
|
||
| - uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: java-kotlin | ||
| # security-and-quality includes the security-extended pack plus | ||
| # maintainability/reliability queries — fine for a small library. | ||
| queries: security-and-quality | ||
|
|
||
| # Manual build: skip tests + spotless/license to keep CodeQL extraction | ||
| # focused on compilable bytecode. The full verify matrix in ci.yml owns | ||
| # those checks. | ||
| - name: Compile | ||
| run: mvn -B -ntp -DskipTests -Dspotless.check.skip=true -Dlicense.skip=true package | ||
|
|
||
| - uses: github/codeql-action/analyze@v4 | ||
| with: | ||
| category: /language:java-kotlin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: Dependency-Check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| # Weekly Tuesday 09:30 ET (13:30 UTC). Offset from CodeQL's Monday cron so | ||
| # a slow NVD API morning doesn't pile both onto the same hour. | ||
| - cron: '30 13 * * 2' | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| actions: read | ||
|
|
||
| jobs: | ||
| scan: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: temurin | ||
| java-version: '17' | ||
|
|
||
| - uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.m2/repository | ||
| key: maven-depcheck-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| maven-depcheck- | ||
|
|
||
| # NVD data cache: pom.xml relocates the dependency-check dataDirectory | ||
| # to ~/.cache/dependency-check-data so this cache path is disjoint from | ||
| # the ~/.m2/repository cache above (overlapping paths cause redundant | ||
| # storage and unpredictable restores). Key on ISO year-week (`%G-%V`) | ||
| # so PR/push runs share one entry within the week; the weekly cron | ||
| # naturally rolls to a new key, refreshing the NVD feed. | ||
| - name: Compute weekly cache bucket | ||
| id: cachekey | ||
| run: echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.cache/dependency-check-data | ||
| key: depcheck-nvd-${{ runner.os }}-${{ steps.cachekey.outputs.week }} | ||
| restore-keys: | | ||
| depcheck-nvd-${{ runner.os }}- | ||
|
|
||
| - name: Run dependency-check | ||
| run: | | ||
| mvn -B -ntp -P security \ | ||
| -DskipTests=true \ | ||
| -Dspotless.check.skip=true \ | ||
| -Dlicense.skip=true \ | ||
| ${NVD_API_KEY:+-DnvdApiKey=$NVD_API_KEY} \ | ||
| verify | ||
| env: | ||
| # Optional: set NVD_API_KEY in repo secrets to lift NVD rate limits. | ||
| # Without it, the job still works but is slower on cold caches. | ||
| NVD_API_KEY: ${{ secrets.NVD_API_KEY }} | ||
|
|
||
| - name: Upload SARIF to GitHub Security tab | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| sarif_file: target/dependency-check/dependency-check-report.sarif | ||
| category: dependency-check | ||
|
|
||
| - name: Upload HTML/JSON report | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: dependency-check-report | ||
| path: target/dependency-check/ | ||
| retention-days: 14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.