fix(ci): harden GitHub Actions workflows (#2119) - #2410
Closed
hf-security-analysis[bot] wants to merge 0 commit into
Closed
hf-security-analysis[bot] wants to merge 0 commit into
hf-security-analysis[bot] wants to merge 0 commit into
Conversation
Merged
hf-security-analysis
Bot
force-pushed
the
security/workflow-hardening/pr-2119
branch
from
September 18, 2026 07:47
4802855 to
6f8f8eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated hardening of the workflow files flagged on #2119.
Warning
This narrows what the workflow can reach. Job permissions were declared in
.github/workflows/bitsplit.yml,.github/workflows/docs-check.yml,.github/workflows/node.yml,.github/workflows/rust-release.yml,.github/workflows/rust.yml. Each job now gets only the scopes its steps were read to need — if one of them does something this could not see, it will fail on the next run. The table below says which step drove each scope.Targets
feat/train_encode_split. Files changed:.github/workflows/CI.yml.github/workflows/bitsplit.yml.github/workflows/docs-check.yml.github/workflows/node.yml.github/workflows/python.yml.github/workflows/rust-release.yml.github/workflows/rust.ymlFixed by this PR:
unpinned-action(pinact) — .github/workflows/CI.yml:200unpinned-action(pinact) — .github/workflows/bitsplit.yml:18unpinned-action(pinact) — .github/workflows/bitsplit.yml:32unpinned-action(pinact) — .github/workflows/bitsplit.yml:53unpinned-action(pinact) — .github/workflows/bitsplit.yml:56unpinned-action(pinact) — .github/workflows/node.yml:33unpinned-action(pinact) — .github/workflows/node.yml:46unpinned-action(pinact) — .github/workflows/node.yml:55unpinned-action(pinact) — .github/workflows/node.yml:90unpinned-action(pinact) — .github/workflows/python.yml:76unpinned-action(pinact) — .github/workflows/python.yml:86unpinned-action(pinact) — .github/workflows/python.yml:128unpinned-action(pinact) — .github/workflows/rust.yml:47unpinned-action(pinact) — .github/workflows/rust.yml:56unpinned-action(pinact) — .github/workflows/rust.yml:258unpinned-action(pinact) — .github/workflows/rust.yml:267excessive-permissions(zizmor) — .github/workflows/bitsplit.yml:1excessive-permissions(zizmor) — .github/workflows/bitsplit.yml:15excessive-permissions(zizmor) — .github/workflows/bitsplit.yml:29excessive-permissions(zizmor) — .github/workflows/bitsplit.yml:50excessive-permissions(zizmor) — .github/workflows/docs-check.yml:1excessive-permissions(zizmor) — .github/workflows/docs-check.yml:16excessive-permissions(zizmor) — .github/workflows/node.yml:1excessive-permissions(zizmor) — .github/workflows/node.yml:13excessive-permissions(zizmor) — .github/workflows/node.yml:62excessive-permissions(zizmor) — .github/workflows/node.yml:100excessive-permissions(zizmor) — .github/workflows/rust-release.yml:1excessive-permissions(zizmor) — .github/workflows/rust-release.yml:12excessive-permissions(zizmor) — .github/workflows/rust.yml:1excessive-permissions(zizmor) — .github/workflows/rust.yml:10excessive-permissions(zizmor) — .github/workflows/rust.yml:101excessive-permissions(zizmor) — .github/workflows/rust.yml:128excessive-permissions(zizmor) — .github/workflows/rust.yml:145excessive-permissions(zizmor) — .github/workflows/rust.yml:176excessive-permissions(zizmor) — .github/workflows/rust.yml:200excessive-permissions(zizmor) — .github/workflows/rust.yml:233Reported on the pull request but not fixed here — each needs a decision this bot should not make for you:
impostor-commit(zizmor) — .github/workflows/docs-check.yml:31impostor-commit(zizmor) — .github/workflows/node.yml:24impostor-commit(zizmor) — .github/workflows/node.yml:73impostor-commit(zizmor) — .github/workflows/node.yml:111impostor-commit(zizmor) — .github/workflows/python.yml:26impostor-commit(zizmor) — .github/workflows/python.yml:60impostor-commit(zizmor) — .github/workflows/python.yml:112impostor-commit(zizmor) — .github/workflows/python.yml:161impostor-commit(zizmor) — .github/workflows/rust-release.yml:19impostor-commit(zizmor) — .github/workflows/rust.yml:26impostor-commit(zizmor) — .github/workflows/rust.yml:115impostor-commit(zizmor) — .github/workflows/rust.yml:138impostor-commit(zizmor) — .github/workflows/rust.yml:155impostor-commit(zizmor) — .github/workflows/rust.yml:186impostor-commit(zizmor) — .github/workflows/rust.yml:210impostor-commit(zizmor) — .github/workflows/rust.yml:243unpinnable-reference(pinact) — .github/workflows/bitsplit.yml:19unpinnable-reference(pinact) — .github/workflows/bitsplit.yml:33unpinnable-reference(pinact) — .github/workflows/bitsplit.yml:54unpinnable-reference(pinact) — .github/workflows/rust.yml:280excessive-permissions(zizmor) — .github/workflows/build_pr_documentation.yml:1excessive-permissions(zizmor) — .github/workflows/build_pr_documentation.yml:17Permissions
.github/workflows/bitsplit.ymlnativecontents: readcargo run -p bitmap_gen && git diff --exit-codedrift check operate on the local checkout without any API access.avx512-sdecontents: readwasmcontents: read.github/workflows/build_pr_documentation.yml.github/workflows/docs-check.ymlbuildcontents: read.github/workflows/node.ymlbuild_and_testcontents: readactions/checkouttouches the GitHub token; themake teststep downloads Hub fixtures withsecrets.HF_TOKEN(unrelated to GITHUB_TOKEN) and caching/setup actions need no scopes — the Makefile contents are not in this file, so double-check that step if it ever calls the GitHub API.qualitycontents: readactions/checkoutis the sole token consumer.auditcontents: readcargo install cargo-auditpluscargo audit, which query crates.io/RustSec rather than the GitHub API, soactions/checkoutdrives the only needed scope..github/workflows/rust-release.ymlrust_publishcontents: readgit diffcheck andcargo publishall use crates.io's CRATES_TOKEN secret rather than GITHUB_TOKEN, so no write scopes are required..github/workflows/rust.ymlbuild_and_testcontents: readmake test/make oraclesteps fetch fixtures from the HF Hub using HF_TOKEN, not GITHUB_TOKEN — the Makefile targets are not in this file, so a reviewer may want to confirm they make no GitHub API calls.clippycontents: readcargo clippyneed no repository scopes.formatcontents: readcargo fmt --checkneeds nothing.readmecontents: readauditcontents: readcargo auditreads the RustSec advisory database over plain HTTPS and does not upload results to GitHub, so no security-events is needed.semvercontents: readcargo semver-checkscompares against crates.io, not the GitHub API.feature_matrixcontents: readAnything not listed above keeps the permissions it had. To measure a job this could not read, add
GitHubSecurityLab/actions-permissions/monitorto it and run the workflow — it reports the minimum the run actually used.Pinning changes come from
pinactand are mechanical. Any other change was generated by Claude — read it before merging.