feat: add zizmor audit job to CI quality workflow - #1530
Conversation
Adds a zizmor static analysis job to the reusable quality workflow, running on every PR via ci.yml. The job fails on findings, which blocks PR merges natively. - advanced-security: false so the job exit code gates the PR check - GH_TOKEN set from github.token to enable online audits (impostor commits, ref-confusion, typosquat-uses, known-vulnerable-actions) - contents: read only; no additional secrets required - SHA-pinned at zizmorcore/zizmor-action v0.6.2 - Existing zizmor: ignore[] annotations suppress known intentional exceptions (dangerous-triggers on hold/pr-label/pr-update, secrets-outside-env on HF_TOKEN steps) Closes generative-computing#331 Assisted-by: IBM Bob Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
Adds .github/zizmor.yml with per-line ignore rules for all pre-existing findings discovered when the zizmor CI job ran for the first time. Each suppressed finding has a corresponding open issue (to be filed); the definition of done for each issue is: fix the root cause AND remove the suppression entry. Also corrects stale version comments on SHA-pinned actions (# v6 -> # v6.0.2, # v5 -> # v5.0.5, etc.) where those were mechanical and safe. Findings suppressed (all pre-existing, none introduced by this PR): - ref-version-mismatch: stale version comments across 7 files - unpinned-uses: actions/create-github-app-token@v1 in release workflows - github-app: app token permission scoping in release workflows - template-injection: workflow_dispatch inputs in dispatch-to-contribs.yml - cache-poisoning: setup-uv/setup-node caching in docs-publish.yml - excessive-permissions: missing permissions block in dispatch-to-contribs.yml - artipacked: implicit credential persistence in publish-release.yml snapshot job New violations in any of these rules on any OTHER line will still fail CI. Assisted-by: IBM Bob Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
jakelorocco
left a comment
There was a problem hiding this comment.
Since this is added as a part of the quality.yml, does this mean it will run on release CI/CD as well? I'm not sure it matters but that might be unnecessary and we should make sure that we can still push through a release if this check fails.
markstur
left a comment
There was a problem hiding this comment.
I think the "issue to be filed" placeholders should be filled out before merging otherwise why comment.
The other concern is whether this should be merged before some of those are fixed. Ideally a few of those existing issues would be fixed before this is merged (basically as part of testing this), but exactly how reasonable that effort is I don't know. It makes sense that at some point we merge this with issues created to fix the existing problems.
Replaces the "<issue to be filed>" placeholders in .github/zizmor.yml with the follow-up issues (generative-computing#1531-generative-computing#1534) filed for each finding group, addressing review feedback that placeholders shouldn't ship unfilled. Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
|
@markstur Filled in the @jakelorocco fair point re release CI — in 950a82d, moved the zizmor job out of |
quality.yml is called by both ci.yml (PR merge gate) and publish-release.yml (code-checks, required for release). zizmor audits the CI/CD workflow files themselves rather than the code being released, so a new finding there shouldn't be able to block a release the way a ruff/mypy/test failure can. Move the zizmor job into its own reusable workflow (actions-audit.yml) and wire it into ci.yml only. Verified locally with actionlint and zizmor (offline mode): no new findings, existing suppressions still apply. Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
ajbozarth
left a comment
There was a problem hiding this comment.
Some feedback from Claude:
Nice — design is sound (separate actions-audit.yml off the release path, SHA-pinned, correctly scoped perms), and all four tracking issues (#1531–1534) exist and map to the right suppression groups. Verified locally with zizmor v1.29.0: config passes clean at 20 ignored, 36 suppressed. One cleanup below.
The version comments the ignores referenced (e.g. "# v6" -> "# v6.0.2") were already corrected in this PR, so the rule no longer fires on any of the 14 previously-ignored lines. Verified with zizmor 1.29.0 at both default and pedantic personas: removing the group leaves the result identical (20 ignored, 36 suppressed, 0 findings). Dropping the suppression keeps the rule enforced everywhere going forward instead of leaving blind spots on those specific lines. generative-computing#1533 can be closed as already fixed by this PR. Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
|
I’ve removed the unnecessary suppression - should be good to go with a review |
Summary
Closes #331
Adds a zizmor static analysis job to the reusable
quality.ymlworkflow, which runs on every PR viaci.yml. The job fails on findings, blocking PR merges natively — as requested in the issue.Changes
Single job added to
.github/workflows/quality.yml, modelled on the existingactionlintjob:Design decisions
advanced-security: false— job fails on findings, which natively blocks the PR. The Advanced Security mode (SARIF upload to Security tab) does not fail the job by default and would require a separate repo ruleset to gate merges.GH_TOKENfromgithub.token— enables online audits (impostor-commit,ref-confusion,typosquat-uses,known-vulnerable-actions). Uses the ephemeral per-job token, not a stored secret. Scoped tocontents: readby thepermissions:block.v0.6.2(3dc1ecc9...), matching the supply-chain discipline of the rest of the repo.# zizmor: ignore[]annotations onhold.yml,pr-label.yml,pr-update.yml, and theHF_TOKENsteps cover all known intentional exceptions.zizmorreports 5 suppressed, 0 findings.