Skip to content

ci: set least-privilege GITHUB_TOKEN permissions (SEC-843) - #398

Draft
Matt Sutkus (msuitcase) wants to merge 1 commit into
sec-842/persist-credentialsfrom
sec-842/least-privilege-permissions
Draft

Matt Sutkus (msuitcase) wants to merge 1 commit into
sec-842/persist-credentialsfrom
sec-842/least-privilege-permissions

Conversation

@msuitcase

Copy link
Copy Markdown

What

  • Top-level permissions: contents: read.
  • docs job: contents: write, which the gh-pages deploy needs.

Why

The workflow had no permissions: block, so every job got the repo's default token scope. With this change, a job that only builds and tests gets a read-only token.

Testing note

docs only runs on master, so this PR's CI doesn't exercise it. Check the first docs run after merge.

Stack

  1. ci: don't persist GITHUB_TOKEN in checkout (SEC-843) #397: persist-credentials: false
  2. This PR (based on ci: don't persist GITHUB_TOKEN in checkout (SEC-843) #397): merge after it

Part of SEC-842.

Default the workflow token to read-only. Only the docs job writes to the
repo (gh-pages deploy), so it alone gets contents: write.

Refs SEC-843

This branch has not been deployed

No deployments
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