Skip to content

ci: add zizmor and fix its findings - #46

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

eseidel merged 3 commits into
mainfrom
zizmor

Conversation

@eseidel

@eseidel eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Why

zizmor flagged 0 high and 2 medium findings on main on 12-01: 1 dependabot-cooldown, 1 excessive-permissions. No template injection here today; the workflow keeps it that way. (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

  • e2e.yaml gets permissions: contents: read; it only checks out and runs the installers.
  • 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

e2e.yaml now runs with a read-only token. It doesn't call the GitHub API with it.

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

The e2e failure (all three Rerun installer steps: "A previous Shorebird install at ... is incomplete") isn't from this PR. The first install succeeds; the rerun's completeness check doesn't recognize the prebuilt CLI install. The same three steps fail the same way on the scorecard branch's run https://github.com/shorebirdtech/install/actions/runs/46759839644, and main hasn't run e2e since 11-17. #45 ("fix: count a prebuilt CLI install as complete on rerun") fixes it and its run is green: https://github.com/shorebirdtech/install/actions/runs/46760280661. This PR's only change to e2e.yaml is permissions: contents: read; neither installer uses the token. I'll rerun e2e here once #45 lands.

@eseidel

eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Adversarial review (agent):

Blockers: None in this diff. The red install (*) checks are not caused by it (details below).

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.
  • e2e.yaml gains workflow-level permissions: contents: read. The job only checks out this public repo and runs install.sh / install.ps1, which clone a public repo and download artifacts without a token. Read access is enough.
  • e2e fails on all three OSes at 🔁 Rerun installer: the second run reports "A previous Shorebird install ... is incomplete" instead of "already installed". This step is already on main, and ci: add zizmor and fix its findings #46 doesn't touch the installers. The scorecard PR fails the same way, and fix: count a prebuilt CLI install as complete on rerun #45 ("fix: count a prebuilt CLI install as complete on rerun") fixes it. It was caused by the installer now fetching a prebuilt CLI. Land fix: count a prebuilt CLI install as complete on rerun #45 first, or expect this PR's e2e to stay red until it lands. e2e is not a required check here.
  • 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.
  • The checkout in e2e.yaml still persists credentials. zizmor rates this artipacked finding as help-level only, and the job uploads no artifacts, so it's harmless. persist-credentials: false would still be a free tightening, since nothing in the job uses git auth.

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.
  • persist-credentials: false added to the e2e.yaml checkout. Nothing in the job uses git auth.
  • e2e red: pre-existing, see my earlier comment. fix: count a prebuilt CLI install as complete on rerun #45 fixes it.

@eseidel

eseidel commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

lgtm

@eseidel
eseidel merged commit 2ab48f0 into main Dec 2, 2026
4 checks passed
@eseidel
eseidel deleted the zizmor branch December 2, 2026 00:30
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