Add zizmor as a pre-commit hook from zizmorcore/zizmor-pre-commit, hook id zizmor, pinned by commit SHA with a # frozen: vX.Y.Z comment like the other hooks.
Override files: to ^\.gitea/workflows/[^/]+\.ya?ml$. The hook's default only matches .github/workflows.
Run it at zizmor's default level, offline.
In image.yml, remove permissions: packages: write together with the job-token probe, keep one push-token probe that fails fast, and rewrite the header comment on credentials to match (scope from Does the stand-alone rule cover issue text and job logs). First check that the latest image build's log does not name the method job-token; if it does, stop and report. The digest scrape is unchanged.
Since this changes an image input, bump the ci image version (scripts/bump_image_versions.py).
Acceptance
The hook passes on all five workflows. A throwaway workflow with pull_request_target, or with ${{ github.event.pull_request.title }} in run:, fails it. Check this locally; do not commit the throwaway.
Image size: every layer of the ci image stays under 100 MB. If the hook's own Python environment does not fit, switch to zizmor in requirements-dev.txt/requirements-dev.lock and a language: system hook, like the repository's other tools.
Lint stays green. check_bot_pr_diff.py still accepts a Renovate bump of the new hook's rev: line.
Notes
Tested on 1.32.0 (MIT): it parses all five workflows when the files are passed explicitly, and finds nothing at the default level. Not tested: the hook run itself and a config file. The rule that only image.yml and renovate.yml may reference secrets is held by CODEOWNERS review, not by zizmor. More exactly: each secret is referenced by exactly one workflow (image.yml the push credential, renovate.yml the Renovate token, release.yml the release token).
Spec: [Threat model: what we defend against and what we accept](https://git.rkdr.net/Mortis/Kamino/issues/99), resolution comment, "zizmor".
## What
- Add zizmor as a pre-commit hook from `zizmorcore/zizmor-pre-commit`, hook id `zizmor`, pinned by commit SHA with a `# frozen: vX.Y.Z` comment like the other hooks.
- Override `files:` to `^\.gitea/workflows/[^/]+\.ya?ml$`. The hook's default only matches `.github/workflows`.
- Run it at zizmor's default level, offline.
- In `image.yml`, remove `permissions: packages: write` together with the job-token probe, keep one push-token probe that fails fast, and rewrite the header comment on credentials to match (scope from [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253)). First check that the latest image build's log does not name the method `job-token`; if it does, stop and report. The digest scrape is unchanged.
- Since this changes an image input, bump the `ci` image version (`scripts/bump_image_versions.py`).
## Acceptance
- The hook passes on all five workflows. A throwaway workflow with `pull_request_target`, or with `${{ github.event.pull_request.title }}` in `run:`, fails it. Check this locally; do not commit the throwaway.
- **Image size:** every layer of the `ci` image stays under 100 MB. If the hook's own Python environment does not fit, switch to zizmor in `requirements-dev.txt`/`requirements-dev.lock` and a `language: system` hook, like the repository's other tools.
- Lint stays green. `check_bot_pr_diff.py` still accepts a Renovate bump of the new hook's `rev:` line.
## Notes
Tested on 1.32.0 (MIT): it parses all five workflows when the files are passed explicitly, and finds nothing at the default level. Not tested: the hook run itself and a config file. The rule that only `image.yml` and `renovate.yml` may reference secrets is held by CODEOWNERS review, not by zizmor. More exactly: each secret is referenced by exactly one workflow (`image.yml` the push credential, `renovate.yml` the Renovate token, `release.yml` the release token).
Correction to the Notes, from Enforcement map for each prose-only rule: the secrets rule is "each secret is referenced by exactly one workflow (image.yml the push credential, renovate.yml the Renovate token, release.yml the release token)". It is held by CODEOWNERS review, not by zizmor.
Correction to the Notes, from [Enforcement map for each prose-only rule](https://git.rkdr.net/Mortis/Kamino/issues/102): the secrets rule is "each secret is referenced by exactly one workflow (`image.yml` the push credential, `renovate.yml` the Renovate token, `release.yml` the release token)". It is held by CODEOWNERS review, not by zizmor.
ci(images): assign image versions in CI (#165) now blocks this; once it lands CI assigns the image version, so skip the bump_image_versions.py step. (From Order of the implementation backlog, #198.)
ci(images): assign image versions in CI (#165) now blocks this; once it lands CI assigns the image version, so skip the `bump_image_versions.py` step. (From Order of the implementation backlog, #198.)
This issue lands after .gitea/workflows/AGENTS.md exists. In that file, change the held-by of the two rules zizmor now checks ("never pull_request_target"; "never interpolate ${{ github.* }} into a run: block") from review to "control: the zizmor hook". Reason: a held-by line names a control only once it exists, and must name it once it does.
This issue moves permissions: packages: write to the job in image.yml. An older open issue calls that permission and the job-token probe dead weight; see Does the stand-alone rule cover issue text and job logs, question 3.
Review of the map (2026-11-17).
- This issue lands after `.gitea/workflows/AGENTS.md` exists. In that file, change the held-by of the two rules zizmor now checks ("never `pull_request_target`"; "never interpolate `${{ github.* }}` into a `run:` block") from review to "control: the zizmor hook". Reason: a held-by line names a control only once it exists, and must name it once it does.
- This issue is blocked by the image-version issue only because its body describes the manual image bump. Whether that edge stays is in [Which issues must land before the first friend: image versions in CI, the apm trim and the unfiled skills commit](https://git.rkdr.net/Mortis/Kamino/issues/259).
- This issue moves `permissions: packages: write` to the job in `image.yml`. An older open issue calls that permission and the job-token probe dead weight; see [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253), question 3.
Scope added by Does the stand-alone rule cover issue text and job logs (2026-11-20): instead of moving permissions: packages: write to the job, remove it together with the job-token probe in image.yml, keeping one push-token probe that fails fast, and rewrite the header comment on credentials to match. First check that the latest image build's log does not name the method job-token; if it does, stop and report. The digest scrape is unchanged.
Scope added by [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253) (2026-11-20): instead of moving `permissions: packages: write` to the job, remove it together with the job-token probe in `image.yml`, keeping one push-token probe that fails fast, and rewrite the header comment on credentials to match. First check that the latest image build's log does not name the method `job-token`; if it does, stop and report. The digest scrape is unchanged.
Claude
removed a dependency 2026-11-20 21:25:58 +00:00
Final validation round, second pass (2026-11-20): body edited.
"Move packages: write in image.yml from workflow level to the job" is replaced by the comment of 2026-11-20 (from the stand-alone-rule issue): remove it together with the job-token probe, keep one push-token probe that fails fast, rewrite the credentials header comment, and first check the latest build log does not name the method job-token.
The Notes carry the corrected secrets rule from the comment of 2026-11-15.
The comments above stay as history.
Final validation round, second pass (2026-11-20): body edited.
- "Move `packages: write` in `image.yml` from workflow level to the job" is replaced by the comment of 2026-11-20 (from the stand-alone-rule issue): remove it together with the job-token probe, keep one push-token probe that fails fast, rewrite the credentials header comment, and first check the latest build log does not name the method `job-token`.
- The Notes carry the corrected secrets rule from the comment of 2026-11-15.
- The comments above stay as history.
Defame1297
was assigned by Claude2026-11-21 18:44:44 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Spec: Threat model: what we defend against and what we accept, resolution comment, "zizmor".
What
zizmorcore/zizmor-pre-commit, hook idzizmor, pinned by commit SHA with a# frozen: vX.Y.Zcomment like the other hooks.files:to^\.gitea/workflows/[^/]+\.ya?ml$. The hook's default only matches.github/workflows.image.yml, removepermissions: packages: writetogether with the job-token probe, keep one push-token probe that fails fast, and rewrite the header comment on credentials to match (scope from Does the stand-alone rule cover issue text and job logs). First check that the latest image build's log does not name the methodjob-token; if it does, stop and report. The digest scrape is unchanged.ciimage version (scripts/bump_image_versions.py).Acceptance
pull_request_target, or with${{ github.event.pull_request.title }}inrun:, fails it. Check this locally; do not commit the throwaway.ciimage stays under 100 MB. If the hook's own Python environment does not fit, switch to zizmor inrequirements-dev.txt/requirements-dev.lockand alanguage: systemhook, like the repository's other tools.check_bot_pr_diff.pystill accepts a Renovate bump of the new hook'srev:line.Notes
Tested on 1.32.0 (MIT): it parses all five workflows when the files are passed explicitly, and finds nothing at the default level. Not tested: the hook run itself and a config file. The rule that only
image.ymlandrenovate.ymlmay reference secrets is held by CODEOWNERS review, not by zizmor. More exactly: each secret is referenced by exactly one workflow (image.ymlthe push credential,renovate.ymlthe Renovate token,release.ymlthe release token).Correction to the Notes, from Enforcement map for each prose-only rule: the secrets rule is "each secret is referenced by exactly one workflow (
image.ymlthe push credential,renovate.ymlthe Renovate token,release.ymlthe release token)". It is held by CODEOWNERS review, not by zizmor.ci(images): assign image versions in CI (#165) now blocks this; once it lands CI assigns the image version, so skip the
bump_image_versions.pystep. (From Order of the implementation backlog, #198.)Review of the map (2026-11-17).
.gitea/workflows/AGENTS.mdexists. In that file, change the held-by of the two rules zizmor now checks ("neverpull_request_target"; "never interpolate${{ github.* }}into arun:block") from review to "control: the zizmor hook". Reason: a held-by line names a control only once it exists, and must name it once it does.permissions: packages: writeto the job inimage.yml. An older open issue calls that permission and the job-token probe dead weight; see Does the stand-alone rule cover issue text and job logs, question 3.Scope added by Does the stand-alone rule cover issue text and job logs (2026-11-20): instead of moving
permissions: packages: writeto the job, remove it together with the job-token probe inimage.yml, keeping one push-token probe that fails fast, and rewrite the header comment on credentials to match. First check that the latest image build's log does not name the methodjob-token; if it does, stop and report. The digest scrape is unchanged.Final validation round, second pass (2026-11-20): body edited.
packages: writeinimage.ymlfrom workflow level to the job" is replaced by the comment of 2026-11-20 (from the stand-alone-rule issue): remove it together with the job-token probe, keep one push-token probe that fails fast, rewrite the credentials header comment, and first check the latest build log does not name the methodjob-token.