Skip to content

CI: harden the workflows, add dependabot - #55

Merged
ThomasWaldmann merged 1 commit into
mainfrom
harden-ci
Aug 31, 2026
Merged

CI: harden the workflows, add dependabot#55
ThomasWaldmann merged 1 commit into
mainfrom
harden-ci

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Everything here comes from running zizmor 1.30.0 with --persona=auditor over .github/workflows/. Nothing dangerous was found - no script injection, no pull_request_target, no secrets exposure - so this is all hardening.

What zizmor complained about

audit severity fix
unpinned-uses high actions/checkout and actions/setup-python are pinned to their full commit hash (# vX.Y.Z comment kept), the same pins borg uses. A moved tag can no longer silently change what runs in CI. This also bumps them v4 -> v7.0.1 and v5 -> v7.0.0.
excessive-permissions medium permissions: contents: read for the CI workflow, instead of whatever the repository default happens to be.
artipacked low persist-credentials: false on the checkouts, so the GITHUB_TOKEN is not left in .git/config for the rest of the job. Neither workflow pushes; the release workflow passes github.token to gh explicitly.
concurrency-limits help CI cancels superseded runs of a PR. The release workflow gets a group that never cancels - a second push of the same tag queues rather than killing a release mid-flight.
anonymous-definition info the CI job has a name: now.

zizmor --persona=auditor is clean on both workflows after this.

Dependabot

Hash pins need something to move them, so .github/dependabot.yml is modelled on borg's: grouped weekly updates for the actions and for requirements.d, with the same cooldown (14/30/90 days) so a brand new release is not picked up the day it appears. The CI paths filter already matches **.yml and requirements.d/*, so its PRs run CI.

Note that both dependabot ecosystems only start working once dependabot is enabled for the repository in its settings.

zizmor (auditor persona) findings on .github/workflows/:

- unpinned-uses: pin actions/checkout and actions/setup-python to their
  full commit hash, with the version as a comment - same pins borg uses.
  A moved tag can not silently change what runs in CI anymore.
- excessive-permissions: give the CI workflow "permissions: contents:
  read" instead of whatever the repository default is.
- artipacked: "persist-credentials: false" for the checkouts, so the
  GITHUB_TOKEN does not end up in .git/config for the rest of the job.
  Neither workflow pushes; the release workflow passes github.token to
  gh explicitly.
- concurrency-limits: superseded CI runs of a PR are cancelled now. The
  release workflow gets a concurrency group that never cancels - it
  queues a second push of the same tag instead.
- anonymous-definition: name the CI job.

Pinning to hashes needs something to move the pins, so add a dependabot
config modelled on borg's: grouped weekly updates for the actions and
for requirements.d, with the same cooldown so brand new releases are not
picked up immediately.
@ThomasWaldmann
ThomasWaldmann merged commit a9eef2e into main Aug 31, 2026
3 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the harden-ci branch August 31, 2026 20:32
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