Skip to content

Add explicit least-privilege permissions to CI workflows#3635

Open
arpitjain099 wants to merge 1 commit into
apache:masterfrom
arpitjain099:security/workflow-permissions-ci-hardening
Open

Add explicit least-privilege permissions to CI workflows#3635
arpitjain099 wants to merge 1 commit into
apache:masterfrom
arpitjain099:security/workflow-permissions-ci-hardening

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Summary

  • Add explicit workflow token permissions to CI workflows currently relying on implicit defaults.
  • Set contents: read for build/test/check workflows.
  • For the badge-update automation workflow that creates pull requests, grant only required write scopes:
    • contents: write
    • pull-requests: write

Why

Explicitly declaring least-privilege GITHUB_TOKEN permissions improves Actions security posture and documents required access for each workflow without changing CI behavior.

Declare workflow-level permissions blocks on the CI workflows that
previously inherited the repository default GITHUB_TOKEN scope. Each
workflow only checks out code and runs build/test steps, so contents:
read is the minimum scope required. Documents intent explicitly and
removes reliance on org-default token grants.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 force-pushed the security/workflow-permissions-ci-hardening branch from b9d1561 to 00c6812 Compare May 13, 2026 16:41
@arpitjain099
Copy link
Copy Markdown
Contributor Author

Hi @kasjer, gentle ping on this. PR has been open for 4 days without review. I noticed you've been on the recent-merger side of recent merges in this repo. When you have a moment, would you mind giving it a quick look? No urgency. Happy to address any feedback.

@kasjer kasjer requested a review from sjanc May 18, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants