Skip to content

ci: add least-privilege workflow permissions (CodeQL)#603

Open
jhamon wants to merge 1 commit into
mainfrom
security/workflow-least-privilege-permissions
Open

ci: add least-privilege workflow permissions (CodeQL)#603
jhamon wants to merge 1 commit into
mainfrom
security/workflow-least-privilege-permissions

Conversation

@jhamon

@jhamon jhamon commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves all 11 open CodeQL actions/missing-workflow-permissions alerts across four workflow files. All workflows only check out the repo and run notebooks/scripts — none make writes via GITHUB_TOKEN.

Changes

  • client-versions.yamlpermissions: contents: read
  • pr.yamlpermissions: contents: read
  • test-notebooks-all.yamlpermissions: contents: read
  • test-notebooks-changed.yamlpermissions: contents: read

Verification

  • YAML parses cleanly (ruby -ryaml).
  • No behavior change — scoping the token doesn't affect the notebook runs, which use API keys from secrets (not GITHUB_TOKEN).

Part of PIN-16 (security tail), child of PIN-6.

🤖 Generated with Claude Code


Note

Low Risk
CI-only permission tightening with no application or secret-handling changes; notebook runs still use API keys from secrets, not expanded token rights.

Overview
Adds explicit permissions: contents: read to four GitHub Actions workflows that previously relied on the default GITHUB_TOKEN scope, addressing CodeQL actions/missing-workflow-permissions findings.

Affected workflows: client-versions.yaml, pr.yaml, test-notebooks-all.yaml, and test-notebooks-changed.yaml. Each file also documents that jobs only read the checkout and do not write via GITHUB_TOKEN.

No job logic or triggers change—only token scope is narrowed to match actual usage (checkout, validation, notebook runs using repo secrets).

Reviewed by Cursor Bugbot for commit b59fda8. Bugbot is set up for automated code reviews on this repo. Configure here.

Resolves all 11 CodeQL actions/missing-workflow-permissions alerts.
All four workflows are read-only; each only checks out the repo and
runs notebooks or scripts with no GITHUB_TOKEN writes. Set contents: read.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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