Skip to content

ci: add zizmor and fix its findings - #134

Merged
eseidel merged 2 commits into
mainfrom
zizmor
Dec 2, 2026
Merged

eseidel merged 2 commits into
mainfrom
zizmor

Conversation

@eseidel

@eseidel eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Why

zizmor flagged 3 high and 15 medium findings on main on 12-01: 1 template-injection (high), 2 github-env (high), 10 dependabot-cooldown, 5 excessive-permissions. Template injection lets anyone who can open a PR or name a branch run code with the workflow's token.

The standard way

zizmor is the de facto linter for GitHub Actions security; shorebirdtech/setup-shorebird already runs it. The new .github/workflows/zizmor.yml runs zizmorcore/zizmor-action (SHA-pinned, zizmor 1.33.1) on pull requests and pushes to main that touch .github/**, with min-severity: medium and online audits on. The workflow token is permissions: {} at the top and contents: read for the job; checkout doesn't persist credentials. advanced-security: false because Code Security is off on our private repos, so findings go to the job log instead of a SARIF upload.

What this fixes

  • _shorebird_ci_flutter.yaml and shorebird_ci.yaml regenerated with shorebird_ci generate --style static --no-update-actions at shorebird_ci 0.3.4 (shorebird_ci verify rejects hand edits). 0.3.4 moves inputs.subpackages into env: (the template injection), adds persist-credentials: false, uses $/ self-repository refs, and adds its own offline zizmor job to required.
  • That generated job fails on any finding in .github/workflows at any severity, so the low/info ones are fixed too: persist-credentials: false on the main.yaml and deploy_pages.yaml checkouts, $/ refs to local actions, and deploy_pages.yaml's ${{ }} in its build script (Pages base path, Supabase URL/key) moved into env:.
  • main.yaml gets permissions: contents: read, plus pull-requests: read on changes for dorny/paths-filter.
  • setup_flutter action: the Flutter version read from the release manifest goes into GITHUB_OUTPUT/GITHUB_ENV/GITHUB_PATH, so it's now checked against ^[A-Za-z0-9._+-]+$. zizmor can't see the check, so the Install step carries # zizmor: ignore[github-env] with that reason.
  • Dependabot cooldowns go from 5 to 7 days, the threshold zizmor's dependabot-cooldown audit asks for. Security updates still skip the cooldown.

What could break

deploy_pages.yaml only runs on push to main/dispatch, so this PR can't exercise it: its build step now reads the Pages base path and Supabase values from env, and its checkout no longer persists credentials (nothing after it pushes). main.yaml jobs get a read-only token; changes keeps pull-requests: read for paths-filter. The generated files moved shorebird_ci 0.3.3 -> 0.3.4.

Landing

Lands with --admin once a maintainer has LGTM'd, the adversarial review comment is answered, and required checks are green.

🤖 Generated with Claude Code

Run zizmor (GitHub Actions security linter) on changes to .github/ and
fix the medium and high findings it reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eseidel

eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Adversarial review (agent):

Blockers: None.

What I checked:

  • New zizmor.yml matches the spec (pull_request + push to main on .github/**, permissions: {}, job contents: read, checkout SHA-pinned to v7.0.1 with persist-credentials: false, zizmor-action SHA-pinned to v0.9.2 with version: 1.33.1, advanced-security: false, min-severity: medium, online-audits: true). I checked that both SHAs are the tagged commits.
  • zizmor --min-severity medium . (zizmor 1.33.1, online audits on) on the branch reports no findings.
  • main.yaml now sets workflow-level contents: read, plus pull-requests: read on changes for dorny/paths-filter's API listing of changed files on pull_request, which is this workflow's only trigger. build_flutter_apps, fastlane_demo_fastlane and ci don't use the token. 👀 Detect Changes, 🎯 Build flavors and fastlane_demo_fastlane pass on this head.
  • persist-credentials: false breaks nothing: there is no .gitmodules (so submodules: recursive fetches nothing), nothing runs git push, and the fastlane_demo Gemfile and Pluginfile only use rubygems.org.
  • deploy_pages.yaml: moving steps.pages.outputs.base_path and secrets.X || vars.X into env keeps the same quoting ("$PAGES_BASE_PATH/patch-runner/", --dart-define=SUPABASE_URL="$SUPABASE_URL"), so the values passed don't change.
  • setup_flutter: the regex for version (^[A-Za-z0-9._+-]+$) accepts every Flutter release version format, including x.y.z and x.y.z-n.m.pre. The # zizmor: ignore[github-env] ... comment after run: | is a valid header comment, and the flavors build that uses this step passed. The suppression has a reason, and that reason holds: SDK_DIR comes from the validated version, and PUB_CACHE_DIR is $HOME/.pub-cache.
  • _shorebird_ci_flutter.yaml / shorebird_ci.yaml are the shorebird_ci generate --style static 0.3.4 output, and shorebird_ci verify passes in changes.
  • Dependabot cooldown 5→7 days.

Nits:

  • The comment above advanced-security: false says "Code Security is off on our private repos", but this repo is public, so that reason doesn't apply here. Consider rewording it, e.g. to say we want findings in the job log rather than in the Security tab.
  • deploy_pages.yaml only runs on push to main or workflow_dispatch, so this PR never exercises it ($/ setup_flutter, env-moved secrets). This PR changes the workflow file, so its push to main will trigger a deploy. Check that run after merge.
  • shorebird_ci.yaml now has its own (offline) zizmor job, so PRs that touch .github/** show two checks named zizmor. Consider renaming the job in the hand-written zizmor.yml so the two checks are easy to tell apart.
  • flutter_app/action.yaml still calls ./.github/actions/setup_flutter. zizmor flags this only as a help-level self-repository finding, so it can stay. Mentioning it for consistency with the workflows that now use $/.

Reword the advanced-security comment, drop persisted checkout
credentials where flagged, and fold the new workflow into the existing
zizmor job where one is hand-written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eseidel

eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Answering the adversarial review (pushed in the second commit):

  • advanced-security comment: fixed. It now says findings go to the job log because a SARIF upload would need security-events: write, which this job doesn't get.
  • Duplicate zizmor job: the existing one is in shorebird_ci.yaml, which shorebird_ci generate writes and shorebird_ci verify rejects hand edits to. The generator has no option to drop the job or switch it to online audits, so it can't be removed or extended here. It covers only .github/workflows, offline, so the new workflow stays for the online audits, .github/actions and Dependabot config. Its job is renamed zizmor (online) so the two checks are easy to tell apart. Folding online audits into the generated job is a follow-up for shorebird_ci itself.
  • deploy_pages.yaml: agreed. The first push to main after this lands triggers a deploy, so check that run.
  • flutter_app still uses ./.github/actions/setup_flutter: left as is. zizmor rates it help-level only, and composite actions aren't in the generated job's scope.

@eseidel

eseidel commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Eric approved landing this with the rest of the zizmor batch (ceo ask 13906, 12-01). Checks are green and the adversarial review is answered, so landing.

@eseidel
eseidel merged commit 94f41f2 into main Dec 2, 2026
16 checks passed
@eseidel
eseidel deleted the zizmor branch December 2, 2026 00:26
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