ci: add zizmor for GitHub Actions security scanning#43
Draft
blimmer wants to merge 1 commit into
Draft
Conversation
Introduces zizmor static analysis for .github/. Findings upload to GitHub code scanning (Security tab), and the workflow's SARIF format keeps the job's exit at 0 regardless of findings. The audit is gated on changes to .github/** or the root zizmor.yml so we don't burn the shared 5,000/hr GITHUB_TOKEN budget on every PR. Also address the findings on existing workflows: - Fix template-injection in the fetch-release-secrets composite action by routing inputs.parameter-path through env-var indirection. - Pin 13 actions to commit SHAs across ci.yml, release-sdk.yml, release-plz.yml, deploy-website.yml, fetch-release-secrets, and zizmor.yml. dtolnay/rust-toolchain@stable keeps its branch ref (the action's documented "stable channel" usage) with inline zizmor: ignore[unpinned-uses] comments. Important: SHAs come from the commit those tags point at, not the annotated-tag object SHA. Annotated tags are accepted by the runner but trigger a worst-case API loop in zizmor's impostor-commit audit (per zizmorcore/zizmor#1997 — ~3,500 calls for github/codeql-action alone). Use `gh api repos/X/git/refs/tags/Y` then dereference via `gh api repos/X/git/tags/<sha>` when .object.type is "tag". - Bump aws-actions/configure-aws-credentials v6.1.0 -> v6.1.1. - Add persist-credentials: false to all checkouts in ci.yml, release-sdk.yml, and deploy-website.yml. - Add top-level permissions: contents: read to ci.yml and release-plz.yml. deploy-website.yml's workflow-level pages: write / id-token: write move down to the deploy job only. - Add 3-day dependabot cooldown across all ecosystems with inline zizmor: ignore[dependabot-cooldown] (matches planbridge: fast bumps for low-risk updates; security advisories bypass cooldown anyway). - Exclude .github/workflows/release.yml from audit. It is generated by cargo-dist, so any fixes there get clobbered on `dist generate`. - The mise-action and setup-node steps in release-sdk.yml carry inline zizmor: ignore[cache-poisoning] with a rationale comment. GitHub Actions cache scoping prevents PR-scope caches from propagating up to tag/main builds, so poisoning this workflow's cache requires a merged PR (at which point caching is the least of the problems). The build-time win is worth keeping. Heads up: GitHub code scanning must be enabled (Settings -> Code security) for the SARIF upload step to succeed on first run.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.
Summary
Adds zizmor static analysis for
.github/. Findings upload to GitHub code scanning (Security tab); the workflow's SARIF format keeps the job at exit 0 regardless of findings. The audit is gated on changes to.github/**or the rootzizmor.ymlso we don't burn the shared 5,000/hrGITHUB_TOKENbudget on every PR. Also addresses every finding zizmor reports on the existing workflows — final state is 0 findings at regular persona.Review focus
SHA pinning gotcha. Three pins (
github/codeql-action,Swatinem/rust-cache,release-plz/action) were initially set to annotated-tag-object SHAs returned bygh api .../git/refs/tags/<tag>. The runner accepts those, but zizmor'simpostor-commitaudit triggers a worst-casecompare_commitsloop on them — see zizmorcore/zizmor#1997. A single bad pin against a popular repo likecodeql-action(~893 refs) burns ~3,500 API calls and exhausts the token. All 13 pins in this PR have been verified to point at commit SHAs, not tag-object SHAs.release.ymlexcluded from audit. Generated by cargo-dist; any pins/perms fixes get clobbered on the nextdist generate. The zizmor workflow usesfind ... ! -path .github/workflows/release.ymlto exclude it.In-job paths-filter, not trigger-level
paths:. If zizmor ever becomes a required status check, a trigger-levelpaths:filter would leave the check stuck in "Pending" and block merges on PRs that don't touch.github/. The in-jobdorny/paths-filtergates the heavy steps while the job itself still always starts and reports.dtolnay/rust-toolchain@stablekeeps its branch ref. The action's documented usage; SHA-pinning defeats the "stable channel" semantics. Five usages carry inline# zizmor: ignore[unpinned-uses].cache-poisoningon the SDK publish flow is inline-ignored, not fixed. Cache scoping in GitHub Actions prevents PR-scope caches from propagating up to tag/main builds, so an attacker would need a merged PR to poison the cache release-sdk reads — at which point caching is the least of the problems. The mise + pnpm build-time wins are worth keeping.dependabot-cooldownis suppressed at 3 days, not raised to the audit's 7-day threshold. Matches planbridge's stance: fast bumps for low-risk updates, security advisories bypass cooldown anyway.Workflow permissions narrowed where possible.
ci.ymlandrelease-plz.ymlgain top-levelcontents: read.deploy-website.yml's workflow-levelpages: write/id-token: writemove down to thedeployjob (thebuildjob inherits read-only).Built-in
GITHUB_TOKEN, no app token. Aether's workflows don't reference any private actions, so the default token has the access it needs. With the SHA fixes above, the rate-limit problem doesn't return.Prereq before merge
GitHub code scanning must be enabled (Settings -> Code security) or the
upload-sarifstep will fail on the first run.Commits
This is a single commit so the history reads as one cohesive change. Happy to split if you'd prefer per-concern commits.
6326af6b— Add zizmor workflow + config; pin 13 actions to commit SHAs; fix one template-injection; addpersist-credentials: false, narrow permissions, dependabot cooldown, inline-ignores with rationale.