Repository navigation
ci: declare workflow-level contents: read on 6 workflows - #380
fcostaoliveira merged 3 commits into
Conversation
Pins the default GITHUB_TOKEN to contents: read on the workflows in .github/workflows/ that don't call a GitHub API beyond the initial checkout. The other workflows in this directory are left implicit because they need write scopes that a maintainer is better placed to declare. Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow caps bound runtime authority irrespective of repo or org default, give drift protection if the default ever widens, and are credited per-file by the OpenSSF Scorecard Token-Permissions check. YAML validated locally with yaml.safe_load. Signed-off-by: Arpit Jain <[email protected]>
…low-perms-readonly
|
Thanks for this @arpitjain099. PR #393 (the same idea, narrower scope) merged earlier today and already added the `permissions: contents: read` block to 5 of the 6 workflows this PR covers (`asan.yml`, `ci.yml`, `code-style.yml`, `tsan.yml`, `ubsan.yml`). I've pushed an update to your branch (via the maintainer-modify hook) that:
Net effect: 3 files, +9 lines, no overlap with merged work. Ready for review. |
Thank you @fcostaoliveira ! |
Pins the default
GITHUB_TOKENtocontents: readon 6 workflows in.github/workflows/that don't call a GitHub API beyond the initial checkout.Why
CVE-2025-30066 (March 2025
tj-actions/changed-filessupply-chain compromise) exfiltratedGITHUB_TOKENfrom workflow logs. Pinning per workflow caps runtime authority irrespective of the repo or org default, gives drift protection if the default ever widens, and is credited per-file by the OpenSSF ScorecardToken-Permissionscheck.YAML validated locally with
yaml.safe_loadon each touched file.Note
Low Risk
YAML-only token scope tightening with no application or build logic changes.
Overview
Adds an explicit workflow-level
permissions: contents: readblock (afteron:) on several GitHub Actions workflows, includingdockers.yml,fuzz-smoke.yml, andsoak-nightly.yml, so the defaultGITHUB_TOKENcannot write repo contents or use broader scopes than checkout needs.This is supply-chain / least-privilege hardening (aligned with OpenSSF Scorecard Token-Permissions); job steps and triggers are unchanged.
Reviewed by Cursor Bugbot for commit 5b1f918. Bugbot is set up for automated code reviews on this repo. Configure here.