docs(adr): record the threat model as ADR 0001 #143
Notifications
Due Date
No due date set.
Blocks
Depends on
#167 docs(adr): record self-built CI and molecule images, versioned by CI, pinned by version and digest
Mortis/Kamino
Reference: Mortis/Kamino#143
Reference in new issue
Block a user
Spec: Threat model: what we defend against and what we accept (resolution comment), as changed by Where the maintainer's own procedures live, and what "held by review" means for them and the decisions named below.
What
Write
docs/adr/0001-threat-model.md, which records the stance only, and add an "Accepted risks" section toSECURITY.md, which holds the register. The ADR has these sections:docs/contributing/maintaining.md, not in the ADR.release/*only..gitea/workflows/AGENTS.md. Do not name the secrets. A script that decides whether a pull request's own diff is allowed runs frommain's copy, called from a workflow that only the maintainer can change (CODEOWNERS); a script that checks content or the built artefact runs from the pull request's copy, and CODEOWNERS review covers edits to it. Committed skills and agents (.claude/) are agent instructions and are owned likeAGENTS.md, because a skill can grant itself tools, run shell commands and register hooks without a trust prompt. The local-run layer: review the hook and script changes of a branch you did not write before running it; the rule lives indocs/contributing/reviewing.md.SECURITY.md"Accepted risks" section; later decisions add entries there, not to the ADR."Held by" values in the ADR: control (naming the check), review, aspirational. "Agent instruction" is a place a rule lives, not a held-by value.
Accepted risks register (
SECURITY.md, "Accepted risks")One entry per risk: risk, why accepted, trigger, planned reduction. No infrastructure detail (no hostnames, runner names, account names or secret names). Entries from this issue:
Status/Ready for Agentissues opened by the maintainer, a trusted contributor or an agent account, never adds that label itself, and treats issue text as data (rule home:docs/agents/issue-tracker.md)..claude/. Ephemeral runners are the planned fix and the trigger.successfor Lint, Build and Molecule on its own branch. Not tested on this server. Listed under "a compromised bot or agent token: cheap measures only".v*tags (Gitea checks create and delete with one permission). The tag message's sha256 catches a swap by any writer except the release bot, so a leaked release-bot token can replace a release unreviewed. Accepted; no artifact signing. Consumers who need more pin the git route to a commit (stated in the README). This is the reason tag protection alone does not guard releases once a release token exists.MANIFEST.jsonhash covers every file's content and the Collection metadata, but not file modes. A writer who swaps the release tarball can change a file's exec bit without being detected. Accepted because the Collection ships roles only.renovate/*push allowlist.Acceptance
accepted, set on the maintainer's approval of its pull request (confirmed by the maintainer);docs/adr/is under CODEOWNERS, so that approval is a control;SECURITY.mdregister;REUSE.toml; the pre-commit hooks pass.Notes
Measures go in as one-line targets, not as how-to. CODEOWNERS and zizmor have their own issues.
Addition from How friends get code in: in the trust boundary section, add one line naming the three positions. A trusted contributor has write access and the secrets. A friend works from a fork whose every push the maintainer or a trusted contributor approves. An outsider's fork pull request is closed, never approved, until ephemeral runners exist.
Input from Enforcement map for each prose-only rule: add one sentence to the ADR. "A script that decides whether a pull request's own diff is allowed runs from
main's copy; a script that checks content or the built artefact runs from the pull request's copy, and CODEOWNERS review covers edits to it."Addition from Recommended repository settings and branch protection: the secrets stay at organisation level, so the trust boundary is organisation-wide. Add one line to the ADR: write access to any repository in the organisation is secret access to all of them; granting write anywhere in the organisation is granting this repository's secrets.
Addition from Agent guard hook and permission allowlist, for the accepted list: agent-side hooks are a convenience, not a control; they bind only Claude Code and can be switched off locally, so server-side controls (branch protection, CI) hold the rules.
Review of the map (2026-11-15): corrections to this issue.
image.ymlandrenovate.ymlmay reference secrets". The plannedrelease.ymladds a third. No comment here carries the restated rule from Enforcement map for each prose-only rule. Change: write it in the ADR as "each secret is referenced by exactly one workflow; no other workflow references a secret except the job token", held by CODEOWNERS review. Do not name the secrets (no infrastructure detail).main's copy" holds only through CODEOWNERS on the calling workflow. The base copy is fetched by a step in the pull request's own workflow file (.gitea/workflows/lint.yml:102-118,.gitea/workflows/molecule.yml:166-178). A pull request that deletes that step still gets a green Lint, and only code-owner review on.gitea/stops the merge. Change the sentence from the second comment to: "...runs frommain's copy, called from a workflow that only the maintainer can change (CODEOWNERS)".successfor Lint, Build and Molecule on its own branch. This was not tested on this server. Change: add it to the accepted risks, under "a compromised bot or agent token: cheap measures only"..claude/settings, hooks and skills, and itsAGENTS.mdfiles, also take effect when a contributor opens that branch with an agent. Change: name.pre-commit-config.yaml,.claude/and everyAGENTS.mdin the rule, and suggest reviewing a friend's branch in the web diff, or in a clone where no agent runs.Waiting on other decisions: the friend tier and approval wording wait on The friend boundary once the approval facts are known; what agent tokens may do waits on Agent credentials and what unattended agents can do; where secrets live and what CODEOWNERS covers wait on Code-owner approval against Renovate automerge, and where secrets live.
Scope from The friend boundary once the approval facts are known, points 2 and 5:
image.ymlat capacity 2, and a root Molecule job planting code in the cached molecule virtualenv and collection cache that later jobs reuse. Ephemeral runners stay the named fix and trigger.Scope added by Committed skills as agent instructions: ownership, updates and required tools: one line in ADR 0001. Committed skills and agents (
.claude/) are agent instructions and are owned likeAGENTS.md, because a skill can grant itself tools, run shell commands and register hooks without a trust prompt.Scope added by Agent credentials and what unattended agents can do (resolution 6 and 1):
Scope added by Code-owner approval against Renovate automerge, and where secrets live (resolution, points 5 and 7):
Scope added by Release path: fragment check, failed publish and tarball integrity: a residual-risk line. Any writer on Releases can replace a release asset, and the release bot can delete and recreate
v*tags (Gitea checks create and delete with one permission). The tag message's sha256 catches a swap by any writer except the release bot, so a leaked release-bot token can replace a release unreviewed. Accepted; no artifact signing. Consumers who need more pin the git route to a commit (stated in the README).Review of the map (2026-11-17).
Three lines of this spec are superseded by later comments without saying so, and two things are open.
Changed: this issue is now blocked by the ticket on the maintainer's procedures.
Proposed, not done: after that ticket closes, rewrite the body once as the full section list in final wording.
Scope added by Pushes onto a pull request that has a scheduled merge (resolution, point 6). One residual-risk line:
This withdraws the
renovate/*push allowlist from the Code-owner approval against Renovate automerge, and where secrets live line;release/*keeps its allowlist.Scope added by What a second repository in the organisation shares besides secrets
One line, narrowing the shared-runner accepted risk: the runner is registered for this repository only, never for the organisation; another repository in the organisation (the skills source) runs on a runner sharing no host, Docker daemon, cache or filesystem with it and shares no secret with it; its content reaches this repository only through the content re-check and CODEOWNERS on
.claude/.Scope change from Where the maintainer's own procedures live, and what "held by review" means for them (2026-11-20)
This answers the three open points of the review comment of 2026-11-17.
SECURITY.md, in this issue's scope: one entry per risk (risk, why accepted, trigger, planned reduction; no infrastructure detail). Every accepted risk added by the comments above goes there, not into the ADR. Later decisions add entries there, not to the ADR. The acceptance item "a residual-risk section" is met by the rule above plus the register.image.yml" relied on approved fork runs; reword that entry accordingly in the register.docs/contributing/maintaining.md(the maintaining.md issue filed from #250), not in the ADR.accepted(confirmed by the maintainer).docs/adr/is under CODEOWNERS, so that approval is a control.Scope change from Who counts as having set Status/Ready for Agent, and where that rule lives (2026-11-20)
SECURITY.md"Accepted risks" register) gets a second trigger: before thekamino-releasebot's secret is stored, unattended agents move to the planned Restricted account without write, or stop running unattended. Reason: that secret can tag and publish a release consumers install.Status/Ready for Agentissues opened by the maintainer, a trusted contributor or an agent account, never adds that label itself, and treats issue text as data (rule home:docs/agents/issue-tracker.md).From What the tarball checksum in the tag message proves when a publish is repaired (2026-11-20)
Add one entry to the accepted-risks register (in
SECURITY.md, per Where the maintainer's own procedures live): the release tag'sMANIFEST.jsonhash covers every file's content and the Collection metadata, but not file modes. A writer who swaps the release tarball can change a file's exec bit without being detected. Accepted because the Collection ships roles only.Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, #87 (comment)). The body is the spec; the earlier comments are history.
SECURITY.mdregister (eight entries listed in the body); statusacceptedon the maintainer's approval of the pull request,docs/adr/code-owned; push allowlist onrelease/*only.Final validation round, second pass (2026-11-20): body edited.
.gitea/workflows/AGENTS.md; the local-run rule is one sentence linking todocs/contributing/reviewing.md.