Repository navigation
Review do PR upstream #1407 #8
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | ||
|
|
||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
|
|
||
| name: Java CI with Maven | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| pull_request: | ||
| branches: [ "master" ] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a JDK that supports the project's Java 21 target. At the reviewed revision,
|
||
| distribution: 'temurin' | ||
| cache: maven | ||
| - name: Build with Maven | ||
| run: mvn -B package --file pom.xml | ||
|
|
||
| # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive | ||
| - name: Update dependency graph | ||
| uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exclude fork pull requests from dependency submission. When a fork pull-request build succeeds, this unconditional step attempts dependency submission. Fork tokens normally have read-only permissions, but the submission endpoint requires Run submission in a separate push-only job with explicit
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sensitive Data Exposure
Reachability: External
Exploitability: Difficult
CWE: CWE-522 — Insufficiently Protected Credentials
View Security blast radius
The build job runs Maven plugins with a checkout token that is not restricted.
actions/checkout@v4stores the job token in the Git configuration unlesspersist-credentials: falseis set. Thebuildjob declares nopermissions:block, so that token gets the repository default scope. Line 31 runsmvn package, which executes third-party plugins. A compromised plugin can read the persisted token. If the repository default grants write access, the plugin can write to the repository. The dependency-submission step at lines 34-35 runs in the same job after the build.Declare least-privilege permissions for the build job. Disable credential persistence in checkout. If the dependency-submission step needs write access, move it to a separate job that declares its own permissions.
Suggested change for the checkout step and build job permissions
zizmor (1.31.1)
[warning] 23-23: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 18-36: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
Sources: Learnings, Linters/SAST tools