Skip to content

ci: declare workflow-level contents: read on 6 workflows - #380

Merged
fcostaoliveira merged 3 commits into
redis:masterfrom
arpitjain099:chore/declare-workflow-perms-readonly
Jun 1, 2026
Merged

fcostaoliveira merged 3 commits into
redis:masterfrom
arpitjain099:chore/declare-workflow-perms-readonly

Conversation

@arpitjain099

@arpitjain099 arpitjain099 commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Pins the default GITHUB_TOKEN to contents: read on 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-files supply-chain compromise) exfiltrated GITHUB_TOKEN from 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 Scorecard Token-Permissions check.

YAML validated locally with yaml.safe_load on 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: read block (after on:) on several GitHub Actions workflows, including dockers.yml, fuzz-smoke.yml, and soak-nightly.yml, so the default GITHUB_TOKEN cannot 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.

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]>
@fcostaoliveira fcostaoliveira added this to the 2.4 milestone Jun 1, 2026
Extends the PR to cover the two workflows that landed after it was
first opened (fuzz-smoke.yml from PR #421, soak-nightly.yml from
PR #423). After the merge with master, dockers.yml + the two new ones
are the only files where the permissions block is still missing.
@fcostaoliveira

Copy link
Copy Markdown
Collaborator

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:

  1. Merges current master, so the 5 overlapping changes drop out cleanly as no-ops.
  2. Keeps the new `dockers.yml` block (the only file PR ci: declare workflow-level contents: read on 6 workflows #380 still adds on top of master).
  3. Adds the same block to two workflows that landed after PR ci: declare workflow-level contents: read on 6 workflows #380 was first opened: `fuzz-smoke.yml` (from PR test(fuzz): libFuzzer harnesses for split_command_to_args + monitor + RESP parsers #421) and `soak-nightly.yml` (from PR ci(soak): add nightly soak/stress suite -- would have caught the VLA crash #423).

Net effect: 3 files, +9 lines, no overlap with merged work. Ready for review.

@fcostaoliveira
fcostaoliveira merged commit 7284bcf into redis:master Jun 1, 2026
89 of 90 checks passed
@arpitjain099

Copy link
Copy Markdown
Contributor Author

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:

  1. Merges current master, so the 5 overlapping changes drop out cleanly as no-ops.
  2. Keeps the new dockers.yml block (the only file PR ci: declare workflow-level contents: read on 6 workflows #380 still adds on top of master).
  3. Adds the same block to two workflows that landed after PR ci: declare workflow-level contents: read on 6 workflows #380 was first opened: fuzz-smoke.yml (from PR test(fuzz): libFuzzer harnesses for split_command_to_args + monitor + RESP parsers #421) and soak-nightly.yml (from PR ci(soak): add nightly soak/stress suite -- would have caught the VLA crash #423).

Net effect: 3 files, +9 lines, no overlap with merged work. Ready for review.

Thank you @fcostaoliveira !

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.

2 participants