Skip to content

ci: declare contents:read on lint_and_coverage workflow#490

Open
arpitjain099 wants to merge 1 commit into
uber:masterfrom
arpitjain099:chore/declare-workflow-perms
Open

ci: declare contents:read on lint_and_coverage workflow#490
arpitjain099 wants to merge 1 commit into
uber:masterfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown

Pins .github/workflows/lint_and_coverage.yml to permissions: contents: read at the workflow level. The job clones, sets up Python, installs deps, runs lint and pytest with coverage. Nothing in that flow calls a GitHub API that needs write access.

The supply-chain motivation behind explicit per-workflow scopes is CVE-2025-30066 (the March 2025 tj-actions/changed-files compromise) - a tampered third-party action exfiltrated GITHUB_TOKEN via workflow logs, and the blast radius equalled whatever scope the token was issued with. A workflow-level cap of contents: read keeps that bounded regardless of what the repo or org default happens to be at any given moment, and survives a future default-widening change. The block also registers with OpenSSF Scorecard's Token-Permissions check, which only credits explicit declarations.

Validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.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