Skip to content

ci: declare contents:read on Linux build workflow#495

Open
arpitjain099 wants to merge 1 commit into
ClickHouse:masterfrom
arpitjain099:chore/declare-workflow-perms-1778777268
Open

ci: declare contents:read on Linux build workflow#495
arpitjain099 wants to merge 1 commit into
ClickHouse:masterfrom
arpitjain099:chore/declare-workflow-perms-1778777268

Conversation

@arpitjain099
Copy link
Copy Markdown

Adds a workflow-level permissions: contents: read block. The build job checks out the repository (including submodules), installs the toolchain, then invokes cmake and the platform-native build to produce binaries. None of those steps call a GitHub API beyond the initial checkout.

The runtime supply-chain threat that this caps is the one CVE-2025-30066 (the March 2025 tj-actions/changed-files compromise) demonstrated. A tampered third-party action exfiltrates GITHUB_TOKEN from workflow logs and the leaked token retains whatever scope was issued at the workflow level. With contents: read declared in-file, any action - present or future - that runs in this workflow is bounded to read access, regardless of whatever the org default is set to. OpenSSF Scorecard's Token-Permissions check only credits the explicit per-workflow declaration.

YAML validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@slabko
Copy link
Copy Markdown
Contributor

slabko commented May 14, 2026

Hi @arpitjain099, although we do not use tj-actions/changed-files or any other similar actions, this is indeed a good hardening change. Can you please sign the CLA before I can merge it.

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.

3 participants