ci: add least-privilege permissions blocks to CI workflows - #347
Merged
Conversation
Add 'permissions: contents: read' to both CI workflows (black lint and the python-package build/test). Both only need to read the repo — the credentialed integration tests use the PINECONE_API_KEY secret, which is independent of the GITHUB_TOKEN scopes — so this narrows the token from its broad default without affecting anything.
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.
What
Adds a top-level
permissions: contents: readblock to both of VSB's CI workflows (black.ymlandpython-package.yml). Both only read the repo — the credentialed integration tests use thePINECONE_API_KEYsecret, which is independent ofGITHUB_TOKENscopes — so this narrows the default token permissions with no behavioral change.This closes the security-hardening (least-privilege) gap from the CI rubric. VSB already has black formatting, flake8 lint, pytest, and Dependabot.
Follow-up (tracked separately)
A CI dependency-audit gate (
pip-audit) is worth adding but needs care:pip-auditcurrently flags 2 advisories —click8.1.7 → 8.3.3 (safe minor) andpyarrow18.1.0 → 23.0.1 (a major bump), the latter a known deferred decision. It also needs handling for the poetry 1.8 (CI) vs 2.x lock-format difference. I've captured this as a separate task rather than bundle a risky major bump here.🤖 Generated with Claude Code
Note
Low Risk
Workflow-only hardening with no application or secret-handling changes; checkout and existing tests should behave the same.
Overview
Adds a top-level
permissions: contents: readblock toblack.ymlandpython-package.yml, so the defaultGITHUB_TOKENis limited to read-only repo access instead of broader workflow defaults.No job steps, secrets, or test behavior change; Pinecone integration still uses
PINECONE_API_KEY, not expanded token scopes.Reviewed by Cursor Bugbot for commit 9dbd378. Bugbot is set up for automated code reviews on this repo. Configure here.