ci: add least-privilege workflow permissions (CodeQL)#100
Closed
jhamon wants to merge 1 commit into
Closed
Conversation
Add explicit top-level permissions blocks to CI and CD workflows to satisfy the principle of least privilege and resolve two CodeQL actions/missing-workflow-permissions alerts. - CI.yaml: permissions: contents: read (read-only test runner) - CD.yaml: permissions: contents: write (creates git tags and GitHub releases) Resolves CodeQL alerts #1 (CI.yaml) and #2 (CD.yaml). PIN-24
Contributor
Author
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 explicit
permissions:blocks to both GitHub Actions workflows to resolve two CodeQLactions/missing-workflow-permissionsalerts and enforce the principle of least privilege on the defaultGITHUB_TOKEN.permissions: contents: read(read-only test runner; no writes needed)permissions: contents: write(creates git tags and GitHub releases via the token)CodeQL alerts resolved
.github/workflows/CI.yaml— actions/missing-workflow-permissions.github/workflows/CD.yaml— actions/missing-workflow-permissionsReferences
PIN-24
Note
Low Risk
Workflow-only security hardening with permissions aligned to existing CI read and CD release behavior; no application or runtime logic changes.
Overview
Adds explicit
permissions:blocks toCI.yamlandCD.yamlso the defaultGITHUB_TOKENis no longer granted broad repo access, addressing CodeQLactions/missing-workflow-permissionsalerts.CI is scoped to
contents: readfor checkout and test runs. CD is scoped tocontents: writeso release steps can create tags and GitHub releases.Reviewed by Cursor Bugbot for commit 2525e4b. Bugbot is set up for automated code reviews on this repo. Configure here.