Skip to content

Commit 70e8a40

Browse files
committed
ci: declare workflow-level contents: read on 3 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 <arpitjain099@gmail.com>
1 parent e9a4219 commit 70e8a40

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ env:
1515
# CHC_VERSION: "0.9.0"
1616
CH_VERSION: "25.3"
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
nightly:
2023
if: ${{ startsWith(github.repository, 'ClickHouse/') }}

.github/workflows/run_examples.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ concurrency:
2222
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
2323
cancel-in-progress: true
2424

25+
permissions:
26+
contents: read
2527

2628
jobs:
2729
run-examples-with-8-jdk-and-latest:

.github/workflows/test_head.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ concurrency:
1919
env:
2020
CH_VERSION: "head"
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
test-java-client:
2427
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)