Set least-privilege GITHUB_TOKEN scope on CI workflow - #5
Draft
posthog[bot] wants to merge 1 commit into
Draft
Conversation
Add a workflow-level `permissions:` block with `contents: read` to `.github/workflows/ci.yml`. The `registry` job only checks out code and runs read-only steps, so it does not need the default full token scope. This closes the CodeQL medium-severity alert for this workflow. Generated-By: PostHog Desktop Task-Id: 81966967-a939-4197-8666-c73a2f638650
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GITHUB_TOKENscope, which is wider than the job needs. CodeQL flags this as a medium-severity alert with a Vanta compliance deadline of 2026-10-06..github/workflows/ci.ymldeclares nopermissions:block, so theregistryjob gets the default token scope instead of the read-only scope it actually uses.registryjob only checks out code and runstypecheck,lint,test,build, andgit diff --exit-code r/. Nothing writes to the repo, comments on a PR, publishes a package, or requests an OIDC token, so the extra scope only widens the blast radius.Changes
permissions:block that grantscontents: read, between theon:andjobs:blocks.pull_request: branches: [main] +permissions: + contents: read jobs:This matches the pattern merged for the workflows in
logo-dev/logo(PR #789, commit4c6dc96).Scope
arenaand the marketing site ships as separate PRs, one per repo.Risk
contents: readdoes not restrict any step it runs.Agent context
.github/workflows/; found none.Created with PostHog Desktop from this inbox report, addressing API-927, DASH-414.