Skip to content

ci: add least-privilege permissions blocks to CI workflows - #347

Merged
jhamon merged 1 commit into
mainfrom
chore/least-privilege-permissions
Aug 14, 2026
Merged

ci: add least-privilege permissions blocks to CI workflows#347
jhamon merged 1 commit into
mainfrom
chore/least-privilege-permissions

Conversation

@jhamon

@jhamon jhamon commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What

Adds a top-level permissions: contents: read block to both of VSB's CI workflows (black.yml and python-package.yml). Both only read the repo — the credentialed integration tests use the PINECONE_API_KEY secret, which is independent of GITHUB_TOKEN scopes — 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-audit currently flags 2 advisoriesclick 8.1.7 → 8.3.3 (safe minor) and pyarrow 18.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: read block to black.yml and python-package.yml, so the default GITHUB_TOKEN is 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.

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.
@jhamon
jhamon merged commit fcfd006 into main Aug 14, 2026
5 checks passed
@jhamon
jhamon deleted the chore/least-privilege-permissions branch August 14, 2026 04:28
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