Skip to content

🔒 ci(workflows): add zizmor security auditing#3099

Merged
gaborbernat merged 2 commits intopypa:mainfrom
gaborbernat:add-zizmor-pre-commit
Mar 26, 2026
Merged

🔒 ci(workflows): add zizmor security auditing#3099
gaborbernat merged 2 commits intopypa:mainfrom
gaborbernat:add-zizmor-pre-commit

Conversation

@gaborbernat
Copy link
Copy Markdown
Contributor

@gaborbernat gaborbernat commented Mar 24, 2026

GitHub Actions workflows were vulnerable to several security issues including template injection, credential exposure, and permission over-scoping. These vulnerabilities could allow attackers to execute arbitrary code or access sensitive tokens.

This change adds zizmor as a pre-commit hook to continuously audit workflow security and fixes all existing vulnerabilities. The fixes include pinning actions to commit hashes, moving secrets to dedicated environments, isolating GitHub context from shell execution, and restricting permissions to the minimum required scope.

All workflows now pass security audit with zero findings. Future workflow changes will be automatically checked before commit.

@gaborbernat gaborbernat force-pushed the add-zizmor-pre-commit branch 2 times, most recently from 64b9e80 to ff75c8e Compare March 24, 2026 23:14
@gaborbernat gaborbernat changed the title Add zizmor pre-commit hook and fix security issues 🔒 ci(workflows): add zizmor security auditing Mar 24, 2026
@gaborbernat gaborbernat force-pushed the add-zizmor-pre-commit branch 2 times, most recently from 93b3926 to d0584c8 Compare March 26, 2026 04:34
Add zizmor pre-commit hook to catch GitHub Actions security issues.
Fix all existing findings:
- template-injection: Move GitHub context to env vars
- secrets-outside-env: Add environment declarations
- dangerous-triggers: Replace pull_request_target with pull_request
- bot-conditions: Use pull_request.user.login instead of github.actor
- excessive-permissions: Move permissions to job level
- superfluous-actions: Replace with native tools
@gaborbernat gaborbernat force-pushed the add-zizmor-pre-commit branch from d0584c8 to 1d69479 Compare March 26, 2026 04:41
for more information, see https://pre-commit.ci

Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
@gaborbernat gaborbernat force-pushed the add-zizmor-pre-commit branch from d837072 to 9e8e4b5 Compare March 26, 2026 05:34
@gaborbernat gaborbernat enabled auto-merge (squash) March 26, 2026 05:35
@gaborbernat gaborbernat merged commit 1bbeb90 into pypa:main Mar 26, 2026
59 checks passed
@gaborbernat gaborbernat deleted the add-zizmor-pre-commit branch March 26, 2026 05:57
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.

1 participant