From f2d1a3beaa1cc1c523a421a6f3c2a48692e00a5a Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Fri, 15 May 2026 15:57:09 +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/workflow-lint.yml | 3 +++ .github/workflows/workflow-test.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index 36d97bd573a..ece6d898867 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -7,6 +7,9 @@ on: - 'release/**' pull_request: +permissions: + contents: read + jobs: # Runs golangci to ensure that: # 1. the tooling is working on the target platform diff --git a/.github/workflows/workflow-test.yml b/.github/workflows/workflow-test.yml index 09558b6ec3d..e52f661de7c 100644 --- a/.github/workflows/workflow-test.yml +++ b/.github/workflows/workflow-test.yml @@ -9,6 +9,9 @@ on: paths-ignore: - '**.md' +permissions: + contents: read + jobs: test-unit: # Note: inputs.hack is undefined - its purpose is to prevent GitHub Actions from displaying all matrix variants as part of the name.