Skip to content

ci: add CodeQL SAST, CycloneDX SBOM, and build attestations#470

Merged
jcputney merged 6 commits intomainfrom
claude/add-sast-sca-sbom-CUirM
May 6, 2026
Merged

ci: add CodeQL SAST, CycloneDX SBOM, and build attestations#470
jcputney merged 6 commits intomainfrom
claude/add-sast-sca-sbom-CUirM

Conversation

@jcputney
Copy link
Copy Markdown
Owner

@jcputney jcputney commented May 5, 2026

  • New CodeQL workflow runs security-and-quality queries on push, PR, and
    weekly schedule to catch SAST issues alongside the existing Dependabot
    SCA coverage.
  • cyclonedx-maven-plugin generates a CycloneDX 1.6 SBOM (XML + JSON) for
    compile/runtime/provided dependencies during the package phase, attached
    as a build artifact so it's published to Maven Central with the JAR.
  • release.yml and snapshot.yml now produce GitHub build provenance and
    SBOM attestations (actions/attest-build-provenance, attest-sbom) so
    downstream consumers can verify artifacts via gh attestation verify.
    Release workflow also uploads the SBOM to the GitHub Release.

- New CodeQL workflow runs security-and-quality queries on push, PR, and
  weekly schedule to catch SAST issues alongside the existing Dependabot
  SCA coverage.
- cyclonedx-maven-plugin generates a CycloneDX 1.6 SBOM (XML + JSON) for
  compile/runtime/provided dependencies during the package phase, attached
  as a build artifact so it's published to Maven Central with the JAR.
- release.yml and snapshot.yml now produce GitHub build provenance and
  SBOM attestations (actions/attest-build-provenance, attest-sbom) so
  downstream consumers can verify artifacts via gh attestation verify.
  Release workflow also uploads the SBOM to the GitHub Release.
@github-actions github-actions Bot added the build-ci Build or CI changes label May 5, 2026
@jcputney jcputney requested a review from Copilot May 5, 2026 23:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

📊 Benchmark Results

Triggered by workflow run.

Benchmark Score Error Unit
🟢 detectModuleType 0.002 ±0.000 ms/op
🟢 parseModule 1.383 ±6.370 ms/op
🟢 detectModuleType 0.000 ±0.000 ms/op
🟢 parseModule 0.094 ±0.336 ms/op
🟢 detectModuleType 0.204 ±0.620 ms/op
🟢 parseModule 0.667 ±3.323 ms/op
🟢 detectModuleType 0.158 ±0.533 ms/op
🟢 parseModule 1.310 ±6.743 ms/op

All benchmarks passed performance thresholds.

@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds supply-chain/security automation around the existing Maven build and release process: CodeQL code scanning, CycloneDX SBOM generation, and GitHub artifact attestations for snapshot/release artifacts.

Changes:

  • Adds a new CodeQL workflow for Java on pushes, PRs, and a weekly schedule.
  • Configures Maven to generate CycloneDX 1.6 SBOM files during package.
  • Extends snapshot/release workflows to create attestations and publish SBOM artifacts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pom.xml Adds the CycloneDX Maven plugin and version property to generate SBOMs during packaging.
.github/workflows/snapshot.yml Adds snapshot attestation steps and uploads generated SBOM files as workflow artifacts.
.github/workflows/release.yml Adds release attestation steps and attempts to upload SBOM files to the GitHub Release.
.github/workflows/codeql.yml Introduces a dedicated CodeQL analysis workflow for the Java codebase.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/snapshot.yml Outdated
Comment thread .github/workflows/release.yml Outdated
…upload

- snapshot.yml: move attestation steps to after the GitHub Packages
  deploy. The deploy re-runs the package phase and overwrites target/,
  so attesting before deploy produced digests that did not match the
  published JARs, making the attestations unverifiable for consumers.
- release.yml: replace `gh release upload` with `gh release create`
  since `mvn release:perform` only creates a git tag, not a GitHub
  Release. The previous command always fell through the `|| echo`
  guard and the SBOM was never attached to the release.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/snapshot.yml Outdated
Comment thread .github/workflows/release.yml Outdated
The library SBOM describes the main artifact's dependency graph. The
previous subject-path glob also matched -sources and -javadoc JARs,
which would have published an SBOM attestation claiming dependencies
those artifacts do not have. Build provenance attestations still cover
all three JARs since they are all genuine build outputs.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/snapshot.yml Outdated
…napshot

- release.yml: the GitHub Release upload runs after the irreversible
  Maven Central publish in `mvn release:perform`. Mark the step
  `continue-on-error: true` so a transient gh API error does not fail
  the job once Central has already accepted the version, and detect
  whether the release already exists so a rerun uploads with --clobber
  instead of erroring on `gh release create`.
- snapshot.yml: switch the SBOM workflow artifact upload from
  `if-no-files-found: warn` to `error` so a regression in the SBOM
  packaging path fails the build instead of silently passing.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/snapshot.yml Outdated
Comment thread .github/workflows/release.yml Outdated
The Maven build steps execute repository-controlled plugin code, so
granting id-token: write and attestations: write to the same job that
runs `mvn` made those credentials reachable from any Maven plugin.
Move attestations and the GitHub Release SBOM upload into a dedicated
post-build job that only has those permissions; the build job stays
read-only for OIDC.

This also removes the need for `continue-on-error` on the GitHub
Release upload: the Maven Central publish completes in the release
job (which stays green once Central accepts the version), and a
failure in the attest job is now a visibly red, rerunnable job
instead of a silently green workflow with no follow-up signal.

Artifacts are staged into a directory and uploaded with
if-no-files-found: error so a regression in the SBOM packaging path
fails the build.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-ci Build or CI changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants