Skip to content

chore(ci): restrict GITHUB_TOKEN to least privilege - #2104

Merged
paralta merged 2 commits into
mainfrom
chore/restrict-token-permissions
Sep 7, 2026
Merged

paralta merged 2 commits into
mainfrom
chore/restrict-token-permissions

Conversation

@paralta

@paralta paralta commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

GitHub Actions currently grant write access at the workflow level, so every job inherits tokens that can push code, publish packages, or comment on PRs. OpenSSF Scorecard flags that as Token-Permissions 0/10. These changes make every workflow default to read-only and declare write only on the jobs that actually publish, comment, or mint OIDC tokens.

  • Release and image-push jobs also request id-token and attestations write so later Cosign/SLSA steps can run without widening the default token again.
  • Docs CI grants contents: write on the reusable docs job even though that mode does not push; GitHub forbids a called workflow from asking for more than the caller allowed, and the same job is used for gh-pages deploys.

This PR also removes the stale demo workflow.

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedSep 3, 2026, 12:44 PM

@github-actions github-actions Bot added the size/S Denotes a PR that changes 50-199 lines label Sep 3, 2026
@paralta
paralta force-pushed the chore/restrict-token-permissions branch from baf504d to f2d526e Compare September 3, 2026 12:44
@github-actions github-actions Bot added size/M Denotes a PR that changes 200-999 lines and removed size/S Denotes a PR that changes 50-199 lines labels Sep 3, 2026
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@paralta
paralta marked this pull request as ready for review September 3, 2026 13:20
@paralta
paralta requested a review from a team as a code owner September 3, 2026 13:20
@paralta
paralta merged commit e364ed5 into main Sep 7, 2026
38 checks passed
@paralta
paralta deleted the chore/restrict-token-permissions branch September 7, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants