ci: add least-privilege permissions to workflows#553
Open
rootulp wants to merge 1 commit into
Open
Conversation
Declare a top-level `permissions: contents: read` block in each workflow so the GITHUB_TOKEN is scoped to read-only. None of these workflows push, comment, or release; they only check out code and run validation. Resolves the `actions/missing-workflow-permissions` CodeQL alerts (#1-7) for validate-genesis.yml, validate-gentx.yml, and trailing-commas.yml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tty47
approved these changes
Jun 12, 2026
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.
Summary
Adds a top-level
permissions: contents: readblock to all three GitHub Actions workflows so theGITHUB_TOKENis scoped to read-only. None of these workflows push commits, comment, or create releases — they only check out code and run validation — socontents: readis sufficient.A single top-level block covers every job in a file, resolving all 7 alerts at once.
Alerts addressed
Resolves the following
actions/missing-workflow-permissions(CodeQL, medium) code scanning alerts:validate-genesis.yml— alerts Add John's gentx. #3, Rene GenTx #6, Add John's gentx and genesis. #7validate-gentx.yml— alerts tzdybal whale #2, tzdybal devnet whale #4, blah #5trailing-commas.yml— alert Add musalbas gentx for devnet-1 #1Closes https://github.com/celestiaorg/networks/security/code-scanning/1
Closes https://github.com/celestiaorg/networks/security/code-scanning/2
Closes https://github.com/celestiaorg/networks/security/code-scanning/3
Closes https://github.com/celestiaorg/networks/security/code-scanning/4
Closes https://github.com/celestiaorg/networks/security/code-scanning/5
Closes https://github.com/celestiaorg/networks/security/code-scanning/6
Closes https://github.com/celestiaorg/networks/security/code-scanning/7
Test plan
🤖 Generated with Claude Code