Skip to content

ci: harden GitHub workflow permissions to least privilege#27414

Open
matifali wants to merge 4 commits into
mainfrom
ci/harden-workflow-permissions
Open

ci: harden GitHub workflow permissions to least privilege#27414
matifali wants to merge 4 commits into
mainfrom
ci/harden-workflow-permissions

Conversation

@matifali

@matifali matifali commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Hardens GitHub Actions workflow token permissions to address OpenSSF Scorecard findings.

Changes

  • Default affected workflows to no token permissions (permissions: {}).
  • Move required write permissions directly to the jobs that consume them.
  • Document the least-privilege permissions rule in AGENTS.md: never grant write permissions at the workflow top level; scope grants to jobs.<id>.permissions.

Validation

  • make lint-light passed locally via pre-commit hooks.

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑💻

@matifali matifali changed the title ci: enforce least privilege for github workflow permissions ci: harden GitHub workflow permissions to least privilege Jul 22, 2026
@matifali

Copy link
Copy Markdown
Member Author

@jdomeracki-coder A few recent workflows added these top-level permissions, which were making OpenSSF scorevcsrd unhappy. This should fix that.

I thought about a linter to catch this, but it may be overkill.

@matifali
matifali requested a review from nickvigilante July 22, 2026 17:37

@nickvigilante nickvigilante left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Coder Agents found one issue worth investigating.

Comment thread .github/workflows/pr-cherry-pick-check.yaml Outdated
@matifali
matifali enabled auto-merge (squash) July 22, 2026 19:28
@matifali
matifali disabled auto-merge July 22, 2026 19:35
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