Skip to content

ci: Add explicit permissions to workflows - #143

Merged
philippemnoel merged 1 commit into
mainfrom
harden/workflow-permissions
Jul 20, 2026
Merged

ci: Add explicit permissions to workflows#143
philippemnoel merged 1 commit into
mainfrom
harden/workflow-permissions

Conversation

@philippemnoel

Copy link
Copy Markdown
Member

Every workflow lacking a permissions: block inherits the repository default for GITHUB_TOKEN, which is currently write across the org. That grants linters and test workflows push access they never use.

This adds a minimal top-level block to each workflow that had none:

  • contents: read for linters, tests, and workflows that authenticate to external services with their own credentials
  • elevated scopes only where the workflow demonstrably needs them (release publishing, issue creation)

Workflows that already declare workflow- or job-level permissions are untouched. Pure additions, no deletions.

This is a prerequisite for switching the org default workflow permissions to read-only — flipping that setting first would break the workflows that currently rely on implicit write.

Found via GitHub's Code Security assessment ("Workflow does not contain permissions", Medium, 35 findings), then audited across all non-archived, non-fork repos.

https://claude.ai/code/session_01Rg3UBFSnmKMPQLNpNKkn8d

Every workflow lacking a `permissions:` block inherits the repository
default for GITHUB_TOKEN, which is currently `write` across the org.
This grants linters and test workflows push access they never use.

Adds a minimal top-level block to each workflow that had none, with
elevated scopes only where demonstrably required. Workflows with
existing workflow- or job-level permissions are untouched.

Prerequisite for switching the org default workflow permissions to
read-only.

Claude-Session: https://claude.ai/code/session_01Rg3UBFSnmKMPQLNpNKkn8d
@philippemnoel
philippemnoel merged commit 8c606c6 into main Jul 20, 2026
22 checks passed
@philippemnoel
philippemnoel deleted the harden/workflow-permissions branch July 20, 2026 13:34
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.

1 participant