Skip to content

ci: add zizmor workflow audit - #13232

Open
oc-tmueller wants to merge 3 commits into
owncloud:masterfrom
oc-tmueller:ci/zizmor
Open

oc-tmueller wants to merge 3 commits into
owncloud:masterfrom
oc-tmueller:ci/zizmor

Conversation

@oc-tmueller

Copy link
Copy Markdown
Contributor

Adds a zizmor audit of this repository's GitHub Actions workflows and Dependabot config, through the new reusable owncloud/reusable-workflows/.github/workflows/zizmor.yml (owncloud/reusable-workflows#104). It's part of an org-wide rollout. Once the repo PRs have landed, Zizmor / Zizmor becomes a required check through owncloud/admin.

  • Behaviour: any finding, at any severity, fails the check, with an annotation on the offending line. The check runs on every PR, on pushes to master and weekly, because online audits such as known-vulnerable actions can start failing without a code change.
  • Permissions: contents: read only, so it also works on fork PRs like this one.
  • Config: owncloud/* references may stay on @main. Everything else must be SHA-pinned.

Existing findings fixed (separate commits)

  • excessive-permissions: this repository's default GITHUB_TOKEN is read/write, so every workflow without a permissions: block ran with write access. They now default to contents: read.
    • Only create-github-release gets contents: write, for softprops/action-gh-release.
    • audit-release only GETs the published release, which contents: read covers.
    • I checked every job for implicit token use (gh, git push, comments, SARIF) and found none.
  • template-injection: ${{ }} expressions in run: scripts were moved to env:. This covers release.yml, release-npm-packages.yml and acceptance-tests.yml. The version-token check in determine-release-type stays as a second safeguard.
  • cache-poisoning: in the release workflow, setup-node (package-manager-cache: false) and setup-go (cache: false) no longer cache, so a tag build cannot restore a cache that a branch build wrote. Release jobs therefore download Go modules uncached.
  • artipacked: checkouts do not persist credentials. The only git commands after checkout are local git diff / git tag.
  • dependabot-cooldown: every ecosystem (gomod, composer, npm, docker) waits 7 days, as github-actions already does.
  • ref-version-mismatch: setup-php's tag is 2.40.0, without a v. The pnpm/action-setup comment now says v6.1.0, matching its SHA.
  • Suppressed inline, with the reason on the line:
    • The version-pinned gherlint install.
    • The softprops release step, which CI cannot exercise.
    • The unpinned npm install -g yarn npx --force in release.yml.

For the maintainers: that last install is the one item I deliberately left alone. Installing npx globally does nothing, since npm already ships it. yarn is unpinned in a job that holds BUF_API_TOKEN. Pinning yarn (as pnpm@$PNPM_VERSION already is) or dropping the install would let that suppression go.

Not exercised by this PR's CI: release.yml and release-npm-packages.yml only run on tags and releases.

zizmor 1.31.1 reports no findings on this branch.

🤖 Generated with Claude Code

oc-tmueller and others added 3 commits October 26, 2026 12:52
Runs zizmor over this repository's workflows and Dependabot config on
every pull request, on pushes to the default branch and weekly, through
owncloud/reusable-workflows' zizmor.yml. Any finding fails the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
- excessive-permissions: workflows without a permissions block ran
  with the repository default, which is read/write. They now default
  to contents: read; only create-github-release gets contents: write,
  for softprops/action-gh-release. audit-release only GETs the
  published release, which read covers.
- cache-poisoning: the release workflow's setup-node steps opt out of
  package-manager caching, so a tag build cannot restore a cache that a
  branch build wrote.
- artipacked: checkouts do not persist credentials. No job runs a git
  operation after checkout.
- dependabot-cooldown: every ecosystem waits 7 days, as github-actions
  already does.
- ref-version-mismatch: setup-php's tag is 2.40.0, without the v.
- self-repository: local reusable workflows and actions are called as
  $/... instead of ./... .
- Suppressed inline, with the reason on the line: the unpinned
  `npm install -g yarn npx` in the release workflow (pre-existing, left
  to the maintainers), the version-pinned gherlint install, and the
  softprops release step, which CI cannot exercise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
- zizmor's template-injection auto-fix read `${{ }}` inside a shell
  comment in determine-release-type as an expansion: it added an env
  entry reading that job's own output, which is always empty, and
  rewrote the comment to describe something no longer true. The entry
  is gone and the comment describes the env indirection the later jobs
  now use, with the version check as a second safeguard.
- Only pull request runs of the zizmor audit cancel each other now; a
  push to master and the weekly run share a ref.

The previous commit's message is incomplete: it lists a self-repository
change this repository did not need, and omits the auto-fixed
template-injection findings (expressions in run: moved to env: in
release.yml, release-npm-packages.yml and acceptance-tests.yml) and the
cache-poisoning fix also turning off setup-go's cache in the release
jobs, so a tag build cannot restore a cache a branch build wrote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
@oc-tmueller
oc-tmueller requested a review from a team as a code owner October 26, 2026 12:04
@update-docs

update-docs Bot commented Oct 26, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@kw-security

kw-security commented Oct 26, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

This branch has not been deployed

No deployments
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.

2 participants