fix(ci): harden GitHub Actions workflows (#1388) - #1389
Open
hf-security-analysis[bot] wants to merge 1 commit into
Open
hf-security-analysis[bot] wants to merge 1 commit into
hf-security-analysis[bot] wants to merge 1 commit into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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 #1388.
Warning
This narrows what the workflow can reach. Job permissions were declared in
.github/workflows/quality.yaml,.github/workflows/slow_tests.yaml,.github/workflows/tests.yaml. 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
dependabot/github_actions/actions-cb4a383b20. Files changed:.github/workflows/quality.yaml.github/workflows/slow_tests.yaml.github/workflows/tests.yaml.github/workflows/trufflehog.yml.github/workflows/vllm_main_tests.yamlFixed by this PR:
unpinned-action(pinact) — .github/workflows/tests.yaml:18unpinned-action(pinact) — .github/workflows/tests.yaml:23unpinned-action(pinact) — .github/workflows/tests.yaml:30unpinned-action(pinact) — .github/workflows/tests.yaml:37unpinned-action(pinact) — .github/workflows/tests.yaml:44unpinned-action(pinact) — .github/workflows/trufflehog.yml:18unpinned-action(pinact) — .github/workflows/vllm_main_tests.yaml:26unpinned-action(pinact) — .github/workflows/vllm_main_tests.yaml:31unpinned-action(pinact) — .github/workflows/vllm_main_tests.yaml:43excessive-permissions(zizmor) — .github/workflows/quality.yaml:1excessive-permissions(zizmor) — .github/workflows/quality.yaml:14excessive-permissions(zizmor) — .github/workflows/slow_tests.yaml:1excessive-permissions(zizmor) — .github/workflows/slow_tests.yaml:13excessive-permissions(zizmor) — .github/workflows/tests.yaml:1excessive-permissions(zizmor) — .github/workflows/tests.yaml:13This does not fix everything. 7 further finding(s) (1 high, 6 medium) need a decision this bot should not make for you. They are in the security channel with their locations — deliberately not repeated here, since this repository may be public and they are not fixed yet.
Permissions
.github/workflows/doc-build.yml.github/workflows/doc-pr-build.yml.github/workflows/doc-pr-upload.yml.github/workflows/quality.yamlcheck_code_qualitycontents: readmake qualitylocally, which uses no GitHub API..github/workflows/slow_tests.yamlrun_testscontents: readactions/checkout(with LFS) needs the token for source read; setup-uv, actions/cache and the pytest run use no GitHub API write operations..github/workflows/tests.yamlrun_testscontents: 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.