Skip to content

Harden CI: least-privilege, concurrency, timeouts, pin actions + Dependabot#32

Open
dcasota wants to merge 2 commits into
swiyu-admin-ch:mainfrom
dcasota:fix/ci-hardening
Open

Harden CI: least-privilege, concurrency, timeouts, pin actions + Dependabot#32
dcasota wants to merge 2 commits into
swiyu-admin-ch:mainfrom
dcasota:fix/ci-hardening

Conversation

@dcasota
Copy link
Copy Markdown

@dcasota dcasota commented May 22, 2026

Supply-chain hardening. Least-privilege permissions, a concurrency group (cancel-in-progress), timeout-minutes, all actions pinned to commit SHAs, and a github-actions Dependabot entry.


Notes

  • Snyk steps need maintainer-side SNYK_TOKEN/SNYK_ORG secrets; fork-PR CI runs only after a maintainer clicks Approve and run.
  • DCO: commit signed off by Daniel Casota.

…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>
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 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) and timeout-minutes to workflows to avoid runaway and redundant runs.
  • Restrict GITHUB_TOKEN permissions and remove unused elevated permissions.
  • Pin all GitHub Actions to commit SHAs and add Dependabot config for github-actions updates.

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).

Comment thread .github/workflows/pull-request-check.yml Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants