Harden CI: least-privilege, concurrency, timeouts, pin actions + Dependabot#32
Open
dcasota wants to merge 2 commits into
Open
Harden CI: least-privilege, concurrency, timeouts, pin actions + Dependabot#32dcasota wants to merge 2 commits into
dcasota wants to merge 2 commits into
Conversation
…ndabot Supply-chain and hygiene hardening for the CI workflows (no library code change): - Pin every third-party action to a full commit SHA (intended version kept as an inline comment) - they were on mutable tags (@v4/@v2) or a mutable branch (snyk @master). Follows GitHub's hardening guide and the OpenSSF Scorecard pinned-dependencies check. - Add a `github-actions` Dependabot config so the SHAs stay current via reviewed PRs (immutability + freshness). - pull-request-check: drop unused write scopes (packages, attestations, id-token); keep contents:read + security-events:write + pull-requests:write. Add a concurrency group (cancel-in-progress) and timeout-minutes. - maven-central-publish: add timeout-minutes (permissions already minimal). Signed-off-by: Daniel Casota <14890243+dcasota@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions CI/CD configuration to reduce supply-chain risk and improve operational safeguards (least-privilege tokens, run cancellation, timeouts, SHA-pinned actions, and Dependabot updates for actions).
Changes:
- Add
concurrency(cancel-in-progress) andtimeout-minutesto workflows to avoid runaway and redundant runs. - Restrict
GITHUB_TOKENpermissions and remove unused elevated permissions. - Pin all GitHub Actions to commit SHAs and add Dependabot config for
github-actionsupdates.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/pull-request-check.yml |
Adds concurrency + timeout, reduces permissions, and SHA-pins all actions used in PR CI/security scans. |
.github/workflows/maven-central-publish.yml |
Adds timeout and SHA-pins actions used in release publishing workflow. |
.github/dependabot.yml |
Enables weekly Dependabot PRs for GitHub Actions updates (useful for maintaining SHA pins). |
No step writes to the PR, so the permission is dead. Addresses Copilot review. Signed-off-by: Daniel Casota <14890243+dcasota@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Supply-chain hardening. Least-privilege
permissions, aconcurrencygroup (cancel-in-progress),timeout-minutes, all actions pinned to commit SHAs, and agithub-actionsDependabot entry.Notes
SNYK_TOKEN/SNYK_ORGsecrets; fork-PR CI runs only after a maintainer clicks Approve and run.