Skip to content

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

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:add-zizmor-pre-commit
Mar 25, 2026
Merged

🔒 ci(workflows): add zizmor security auditing#467
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:add-zizmor-pre-commit

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Mar 24, 2026

Copy link
Copy Markdown
Member

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 requested a review from ofek as a code owner March 24, 2026 22:38
@gaborbernat gaborbernat enabled auto-merge (squash) March 24, 2026 22:46
@gaborbernat gaborbernat force-pushed the add-zizmor-pre-commit branch 2 times, most recently from 74e30a6 to 983ed62 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
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 983ed62 to 299ebeb Compare March 25, 2026 04:02
@gaborbernat gaborbernat merged commit 9777f9a into tox-dev:main Mar 25, 2026
29 checks passed
@jayaddison

Copy link
Copy Markdown

@gaborbernat

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.

Most of zizmor's recommendations seem free of drawbacks; the pinning of GitHub Actions to commit hashes, though, I believe has a side-effect of (inadvertently) conflicting with Dependabot Alerts.

Hopefully that's an acceptable tradeoff, but I think/hope it's worth mentioning.

Refs:

@jayaddison

Copy link
Copy Markdown

Because I've been seeing this type of reconfiguration more frequently recently, I've opened a discussion related to it upstream at: https://github.com/orgs/zizmorcore/discussions/1898

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.

2 participants