Skip to content

gateway: emit with.version for known unpinned-tools actions (unblocks #885)#893

Open
potiuk wants to merge 1 commit into
mainfrom
zizmor-unpinned-tools-1password
Open

gateway: emit with.version for known unpinned-tools actions (unblocks #885)#893
potiuk wants to merge 1 commit into
mainfrom
zizmor-unpinned-tools-1password

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 27, 2026

Summary

#886 tried to silence zizmor 1.25.2's new unpinned-tools audit on 1Password/load-secrets-action with an inline # zizmor: ignore[] comment, but placed it on the if: false line. zizmor only honours the ignore on the line where the finding lives (line 40 — the - uses: line), so the suppression never took effect, and #885 (zizmor 0.5.5 → 0.5.6) has been stuck failing CI ever since.

Why not just move the inline ignore to the right line?

Two reasons:

  1. Fragile to dependabot rewrites — the - uses: line already carries dependabot's # v4.0.0 version comment. Dependabot rewrites that comment on every bump and would strip an appended zizmor-ignore tail.
  2. No fallback via zizmor.yml config — the zizmor configuration docs state explicitly: "Composite action findings cannot be ignored via zizmor.yml currently. They can be ignored inline [with comments]."

Why pin with.version instead

The audit's actual remediation (per its source at crates/zizmor/src/audit/unpinned_tools.rs) is to set a static with.version value. The audit fires only when the input is missing or set to literal latest. Setting it to any specific string silences the finding cleanly. Since these composite entries are if: false (allowlist registration only — they never execute), the version value is cosmetic; only the static analyser cares.

Changes

Test plan

🤖 Generated with Claude Code

@potiuk potiuk requested review from dfoulks1 and ppkarwasz as code owners May 27, 2026 23:54
@potiuk potiuk force-pushed the zizmor-unpinned-tools-1password branch from d76dce8 to d5d3a1a Compare May 28, 2026 17:45
`1Password/load-secrets-action` with an inline `# zizmor: ignore[]`
comment, but placed it on the `if: false` line. zizmor only honours
the ignore on the line where the finding lives — line 40 (the
`- uses:` line) — so the suppression never took effect, and #885
(zizmor 0.5.5 → 0.5.6 bump) has been stuck failing CI ever since.

Inline placement on the `- uses:` line would also be fragile: it
sits next to dependabot's `# v4.0.0` version comment, and dependabot
rewrites that comment on every bump. The zizmor docs (configuration
guide) also state that "composite action findings cannot be ignored
via `zizmor.yml`", so the config-file path is closed.

The audit's actual remediation (per its source at
crates/zizmor/src/audit/unpinned_tools.rs) is to set a static
`with.version` value. The audit fires only when the input is
missing or literal `latest`. Setting it to any specific string
silences the finding. Since these composite entries are `if: false`
(allowlist registration only — they never execute), the version
value is cosmetic; only the static analyser cares.

This change:

- Adds `_unpinned_tool_version_pin()` + `_UNPINNED_TOOLS_VERSION_PINS`
  in `gateway/gateway.py` so the composite generator emits a
  `with.version` block for any action zizmor's `unpinned-tools` audit
  knows about (currently `1password/load-secrets-action` and
  `aquasecurity/setup-trivy`; the latter is preemptive — we don't
  carry it on the allowlist today).
- Applies the same `with.version` block manually to the existing
  `1Password/load-secrets-action` entries in the composite. The next
  full regeneration (post #892's pipeline recovery) will produce
  identical content; the manual edit only fast-paths the fix so #885
  can land immediately.
- Drops the no-op `# zizmor: ignore[unpinned-tools]` tail comment
  #886 added on the `if: false` line — the version pin is now the
  real suppression mechanism.

Local verification: `zizmor --min-severity medium --min-confidence
medium .github/ allowlist-check/ pelican/ stash/` now reports
"No findings to report. Good job!" (down from 1 medium). Gateway
tests still pass (8 passed).

Generated-by: Claude Opus 4.7
@potiuk potiuk force-pushed the zizmor-unpinned-tools-1password branch from d5d3a1a to 3d112b0 Compare May 28, 2026 19:01
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented May 29, 2026

Ping @raboof @ppkarwasz @dfoulks1 — this one's blocking #885 (zizmor 0.5.6 bump). Verified locally: zizmor 1.25.2 reports clean on this branch whereas main alone reports 1 medium on the 1Password unpinned-tools audit. Small diff (28 LOC in gateway.py + 4 in composite), CI green. Would appreciate a quick look so the chain can land.

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