Skip to content

ci: declare workflow-level contents: read on the 6 CI workflows#684

Open
arpitjain099 wants to merge 1 commit into
vitessio:mainfrom
arpitjain099:chore/workflow-perms
Open

ci: declare workflow-level contents: read on the 6 CI workflows#684
arpitjain099 wants to merge 1 commit into
vitessio:mainfrom
arpitjain099:chore/workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown

Pins the default GITHUB_TOKEN to contents: read on the 6 CI workflows that only do lint/build/test/verify:

  • ansible-lint.yml
  • golang_build.yaml
  • golang_lint.yaml
  • golang_tidy.yaml
  • golang_unit_test.yaml
  • verify_cli_documentation.yml

None of these call the GitHub API beyond checkout. deploy.yml is intentionally left untouched since it does exercise write paths and the scope decision there belongs to maintainers.

Motivation: CVE-2025-30066 (the tj-actions/changed-files compromise in March) exfiltrated unspoken GITHUB_TOKEN scopes from caller workflow logs. Per-workflow caps make the blast radius predictable irrespective of repo or org default.

YAML validated locally with yaml.safe_load on each touched file.

Pins the default GITHUB_TOKEN to contents: read on the CI workflows that only do lint/build/test/verify (ansible-lint, golang_build, golang_lint, golang_tidy, golang_unit_test, verify_cli_documentation). None of these call the GitHub API beyond checkout.

The deploy.yml workflow is intentionally left out since it actually exercises write paths.

Same per-workflow least-privilege pattern that became standard after CVE-2025-30066 (the tj-actions/changed-files compromise exfiltrated unspoken token scopes from caller workflow logs in March). yaml.safe_load validated on each touched file.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from frouioui as a code owner May 18, 2026 22:40
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