From 9ef69426d1504348e1b919c29f7be679bef54f36 Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Fri, 15 May 2026 15:58:44 +0900 Subject: [PATCH] ci: declare workflow-level contents: read on 2 workflows 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 --- .github/workflows/check-index.yml | 3 +++ .github/workflows/mirror.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/check-index.yml b/.github/workflows/check-index.yml index b73c6fdd..423e9551 100644 --- a/.github/workflows/check-index.yml +++ b/.github/workflows/check-index.yml @@ -8,6 +8,9 @@ on: branches: - check-index-test +permissions: + contents: read + jobs: build: diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 1ed440f2..6863a26b 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -5,6 +5,9 @@ on: schedule: - cron: '0 0 * * 2' +permissions: + contents: read + jobs: mirror: name: Mirror images