From e524eef4e86f68e74c39871bc1846c6e37d9daa2 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 21 Nov 2026 21:20:10 +0000 Subject: [PATCH 1/7] docs(agents): write roles/AGENTS.md with the role rules State every role rule in force with its reason and how it is held. Rules whose control has not landed say "review until #N lands". Keep the file out of the Collection tarball (build_ignore) until the tarball check refuses AGENTS.md at any depth, and put it on the Molecule selector's IGNORED list: no scenario reads it. Closes #181 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- galaxy.yml | 2 + roles/AGENTS.md | 122 ++++++++++++++++++ scripts/select_molecule_scenarios.py | 1 + .../scripts/test_select_molecule_scenarios.py | 5 + 4 files changed, 130 insertions(+) create mode 100644 roles/AGENTS.md diff --git a/galaxy.yml b/galaxy.yml index cc58577..446e111 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -61,4 +61,6 @@ build_ignore: - gitleaks-report.json - importer_result.json - 'roles/*/molecule' + # Contributor rules for agents: a consumer's agent reading an installed role must not load them. + - roles/AGENTS.md - '*.tar.gz' diff --git a/roles/AGENTS.md b/roles/AGENTS.md new file mode 100644 index 0000000..16a13fe --- /dev/null +++ b/roles/AGENTS.md @@ -0,0 +1,122 @@ +# Role rules + +Every rule for a role in this Collection, in full; the contributor docs point here. Each rule +gives its reason (*Why*) and how it is held (*Held*): a control names its hook or check, review +means a person other than the author sees the change before it merges, aspirational means +nothing checks it. "Until #N lands" names the backlog issue that will add the control. + +## Shape + +- **Layout.** Every role has `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, + `meta/argument_specs.yml`, `README.md` and `molecule/default/`; `vars/` holds only constants a + consumer must not override. *Why:* one predictable shape, and `vars/` outranks inventory. + *Held:* control for the scenario (`scripts/select_molecule_scenarios.py` fails a changed role + without one), review for the rest. +- **README headings (public roles).** Supported platforms; Requirements and run order; Role + variables (table); Entry points (when several); Variables set by the role (when any); Tags; + Example play; Tests; Notes, with an "Idempotent: yes/no" line. No licence or author heading. + *Why:* a consumer finds the same thing in the same place. *Held:* review. +- **Complexity.** ansible-lint's `complexity` rule at its default `max_tasks` (100), gated with + `warn_list: []`; 40 once ansible-lint accepts the key. *Why:* a long task file is hard to + review. *Held:* review until #138 lands. +- **Roadmap.** The pull request that adds a role removes it from the README "Roadmap" list, and + removes the section when the list is empty. *Why:* the list is only useful if it is true. + *Held:* review. + +## Interface + +- **Role interface.** Inputs, supported entry points, documented output facts and documented + tags (the README `## Tags` section). Renaming or removing any of them is a `breaking_changes` + fragment; adding one is `minor_changes`. *Why:* this is what a consumer may depend on. + *Held:* review. +- **Input changes.** Renaming or removing an input is `breaking_changes` and a major release, + with no compatibility alias. *Why:* with latest-only support an alias costs more than it + gives. *Held:* review until the fragment check (#183) lands. +- **argument_specs.** Every optional input has a value in `defaults/main.yml` and a spec entry + with `type`, `description` and the same `default:`; `choices` for closed sets; a `required: + true` input has no default. *Why:* a spec `default:` never sets the variable, but without it + `ansible-doc -t role` shows `null`. *Held:* review until the spec-defaults drift check (#135) + lands. +- **Suboption defaults.** The role applies them itself; spec suboption defaults are + documentation. *Why:* Ansible does not apply them. *Held:* review until #135 lands. +- **Supported entry points.** Each has its own `meta/argument_specs.yml` key, an "Entry points" + README entry and a Molecule scenario; every other `tasks/*.yml` is internal. *Why:* a consumer + must be able to tell what it may call. *Held:* review until #227 lands. +- **Output facts.** A fact documented under "Variables set by the role" keeps `_`; + everything else a role sets or registers is `___`. *Why:* the name says what is + interface. *Held:* review. +- **Handlers are internal.** A caller never notifies a role's handler; a README names one only to + explain behaviour; renaming one needs no fragment. *Why:* handler names are global in a play, so + a caller bound to one breaks on a rename. *Held:* review. + +## Variables and validation + +- **Internal variables.** `vars/` constants, `register:` and `set_fact` results are `___`. + *Why:* it is the Red Hat Automation Good Practices convention and tells an input from an + internal name. *Held:* ansible-lint `var-naming[no-role-prefix]` for the prefix, review for + the `__`. +- **Validation.** The spec holds `type`, `choices` and `required`; a rule between role variables + is an `assert` in `tasks/validate.yml`; cross-input spec keys (`required_if`, + `mutually_exclusive` and the like) appear only inside a dict input's suboptions. *Why:* Ansible + does not apply them at entry-point level. *Held:* ansible-lint for the misuse, review for the + rest. +- **Validation order.** `validate.yml` runs before any task that changes the host, loaded with + `import_tasks` and `tags: always`; only fact-computing tasks run before it, and they carry + `always` too. *Why:* a bad input fails before any change, and `always` on `include_tasks` does + not reach the included tasks. *Held:* review. +- **`noqa`.** Prefer fixing a finding; a `noqa` that remains names one rule and has a reason + comment. *Why:* an unexplained exception cannot be reviewed. *Held:* review. +- **Secrets.** Never in plaintext in the repository, a role's defaults, task output or a file on + the controller; `no_log: true` on every task that carries one; a secret is a required input + with no default; a role generates one only straight into a secret store the consumer names. + Keys a host generates for itself and keeps (SSH host keys) are not covered. The README line + "`no_log` is not used: the role handles no secrets" stays only where true. *Why:* nothing leaks + today and a role writing to a secret store stays possible. *Held:* review. + +## Platforms + +- **Declared means tested.** A platform in `meta/main.yml` is one the role passes Molecule on in + CI; one used but untested goes only in a README "Untested platforms" line. Until #226 and #133 + land, `trixie` is declared untested and some roles still declare `jammy` or `all`. *Why:* no + tool reads the declaration, so it is worth something only if true. *Held:* review. +- **Platforms follow the target hosts.** Ubuntu-targeting roles declare exactly `noble` and + `resolute`; Proxmox-targeting roles declare Debian `trixie`; each is tested on its own OS. + *Why:* testing on hosts a role never runs on proves nothing. *Held:* review. Aspirational: + every role covers all three; fewer needs a one-line README reason. +- **Dropping a platform.** Removing or narrowing a declared platform is `breaking_changes`, + tested or not. *Why:* a consumer on it loses support. *Held:* review until #183 lands. + +## Tests + +- **Verify** asserts the effect on the host (the service loaded the config), not only rendered + files. *Why:* a rendered file proves nothing about a running service. *Held:* review. +- **Negative tests.** Every validation has one in `verify.yml` (or a file it includes): + block/rescue/assert matching the expected error message. *Why:* a bare "it failed" passes for + the wrong error. *Held:* review. +- **Check mode.** Every scenario runs `check` before and after converge. The only guards are + `check_mode: false` on read-only probes and `when: not ansible_check_mode`; `--check` is the + supported preview, and the README says a play-level `check_mode: true` is not supported. A role + that cannot support check mode says why in README Notes and drops the step. *Why:* check-mode + breakage is a common fix class, and one guard pattern is reviewable. *Held:* review until #134 + lands. + +## Roles calling roles + +- **Dependencies.** A role uses another role of this Collection only through + `ansible.builtin.include_role` or `import_role` by FQCN, never a role outside the Collection, + and lists it in its README; `meta/main.yml` `dependencies` stays `[]`. It calls a public role + only on a supported entry point, an internal role on any entry point in its argument_specs. + *Why:* a task-level include keeps the order readable, where `meta` dependencies run hidden and + deduplicated. *Held:* control for the scenarios (the selector runs a dependent role's scenarios + when a role it uses changes), review for empty `dependencies` until #246 lands. +- **Internal roles.** A leading `_`; only roles of this Collection call it, by FQCN; it refuses + to run without a parent role (an `assert` on `ansible_parent_role_names`, as in + `_binary_update`); it has argument_specs, Molecule scenarios and follows the platform rules. + Its README opens with the internal-role statement and otherwise keeps its own headings. Its + variables keep `__` with no `__` split. It is outside semver: a change confined to it + takes a `trivial` fragment, and the calling role writes the fragment for any effect a consumer + can see. *Why:* shared machinery without a versioning promise. *Held:* the assert at run time; + review that each new internal role has it. +- **`role-name` for internal roles.** Each internal role has one `role-name` line in + `.ansible-lint-ignore`. Until #138 lands `role-name` is skipped repository-wide in + `.ansible-lint`. *Why:* a misnamed public role must still fail. *Held:* review. diff --git a/scripts/select_molecule_scenarios.py b/scripts/select_molecule_scenarios.py index c71bd9a..b4d7735 100644 --- a/scripts/select_molecule_scenarios.py +++ b/scripts/select_molecule_scenarios.py @@ -63,6 +63,7 @@ IGNORED = ( "SECURITY.md", "GLOSSARY.md", "CLAUDE.md", + "roles/AGENTS.md", "CODEOWNERS", "CHANGELOG.rst", "COPYING", diff --git a/tests/scripts/test_select_molecule_scenarios.py b/tests/scripts/test_select_molecule_scenarios.py index 5bf3551..3ef9e65 100644 --- a/tests/scripts/test_select_molecule_scenarios.py +++ b/tests/scripts/test_select_molecule_scenarios.py @@ -125,6 +125,11 @@ class SelectTest(unittest.TestCase): ) self.assertEqual(chosen, []) + def test_role_rules_for_agents_select_nothing(self): + # roles/AGENTS.md is contributor guidance that no scenario reads (it is not shipped). + chosen, _reason = sel.select(ALL, ["roles/AGENTS.md"]) + self.assertEqual(chosen, []) + def test_ignored_does_not_mask_a_role(self): chosen, _reason = sel.select(ALL, ["docs/x.md", "roles/docker/tasks/main.yml"]) self.assertEqual(chosen, ["roles/docker/molecule/default"]) From 11c1483af3703be1f0f7cae040251b44ebc43306 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 21 Nov 2026 21:32:25 +0000 Subject: [PATCH 2/7] docs(agents): word pending controls as pending in roles/AGENTS.md Review: name the check each pending control will be, not only its issue; state complexity and the role-name exemption as future controls; name schema[role-arg-spec] for the validation misuse; merge the duplicated input rule into the role interface; add entry-point validation and the negative-test ordering; drop the claim that contributor docs point here. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- roles/AGENTS.md | 108 ++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/roles/AGENTS.md b/roles/AGENTS.md index 16a13fe..a5df8d9 100644 --- a/roles/AGENTS.md +++ b/roles/AGENTS.md @@ -1,69 +1,66 @@ # Role rules -Every rule for a role in this Collection, in full; the contributor docs point here. Each rule -gives its reason (*Why*) and how it is held (*Held*): a control names its hook or check, review -means a person other than the author sees the change before it merges, aspirational means -nothing checks it. "Until #N lands" names the backlog issue that will add the control. +Every rule for a role in this Collection, in full. Each gives its reason (*Why*) and how it is +held (*Held*): a control names its hook or check; review means a person other than the author +sees the change before it merges; aspirational means nothing checks it. "Until X (#N) lands" +names a check that does not exist yet and its backlog issue. ## Shape -- **Layout.** Every role has `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, - `meta/argument_specs.yml`, `README.md` and `molecule/default/`; `vars/` holds only constants a - consumer must not override. *Why:* one predictable shape, and `vars/` outranks inventory. - *Held:* control for the scenario (`scripts/select_molecule_scenarios.py` fails a changed role - without one), review for the rest. +- **Layout.** `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, `meta/argument_specs.yml`, + `README.md` and `molecule/default/`; `vars/` holds only constants a consumer must not override. + *Why:* one predictable shape, and `vars/` outranks inventory. *Held:* the scenario by + `scripts/select_molecule_scenarios.py` (fails a changed role without one), the rest by review. - **README headings (public roles).** Supported platforms; Requirements and run order; Role variables (table); Entry points (when several); Variables set by the role (when any); Tags; Example play; Tests; Notes, with an "Idempotent: yes/no" line. No licence or author heading. *Why:* a consumer finds the same thing in the same place. *Held:* review. -- **Complexity.** ansible-lint's `complexity` rule at its default `max_tasks` (100), gated with - `warn_list: []`; 40 once ansible-lint accepts the key. *Why:* a long task file is hard to - review. *Held:* review until #138 lands. +- **Complexity.** A task file stays within ansible-lint's `complexity` limit, `max_tasks` 100 + (40 once ansible-lint accepts the key). *Why:* a long task file is hard to review. *Held:* + review until the Lint job enables and gates `complexity` (#138). - **Roadmap.** The pull request that adds a role removes it from the README "Roadmap" list, and - removes the section when the list is empty. *Why:* the list is only useful if it is true. - *Held:* review. + the section goes when the list is empty. *Why:* the list is useful only if true. *Held:* review. ## Interface - **Role interface.** Inputs, supported entry points, documented output facts and documented - tags (the README `## Tags` section). Renaming or removing any of them is a `breaking_changes` - fragment; adding one is `minor_changes`. *Why:* this is what a consumer may depend on. - *Held:* review. -- **Input changes.** Renaming or removing an input is `breaking_changes` and a major release, - with no compatibility alias. *Why:* with latest-only support an alias costs more than it - gives. *Held:* review until the fragment check (#183) lands. + tags (README `## Tags`). Renaming or removing one is a `breaking_changes` fragment and a major + release, with no compatibility alias; adding one is `minor_changes`. *Why:* this is what a + consumer may depend on, and with latest-only support an alias costs more than it gives. + *Held:* review (the fragment check, #183, will only see that a fragment exists). - **argument_specs.** Every optional input has a value in `defaults/main.yml` and a spec entry with `type`, `description` and the same `default:`; `choices` for closed sets; a `required: true` input has no default. *Why:* a spec `default:` never sets the variable, but without it - `ansible-doc -t role` shows `null`. *Held:* review until the spec-defaults drift check (#135) - lands. + `ansible-doc -t role` shows `null`. *Held:* review until the spec-defaults drift check (#135). - **Suboption defaults.** The role applies them itself; spec suboption defaults are - documentation. *Why:* Ansible does not apply them. *Held:* review until #135 lands. -- **Supported entry points.** Each has its own `meta/argument_specs.yml` key, an "Entry points" - README entry and a Molecule scenario; every other `tasks/*.yml` is internal. *Why:* a consumer - must be able to tell what it may call. *Held:* review until #227 lands. + documentation. *Why:* Ansible does not apply them. *Held:* review; the drift check (#135) will + hold those it can see. +- **Supported entry points.** Each has its own spec key, runs its validation before any change, + has an "Entry points" README entry and a Molecule scenario; every other `tasks/*.yml` is + internal and may be renamed. *Why:* a consumer must tell what it may call. *Held:* review until + the drift check compares spec keys, README entries and task files (#227). - **Output facts.** A fact documented under "Variables set by the role" keeps `_`; everything else a role sets or registers is `___`. *Why:* the name says what is interface. *Held:* review. -- **Handlers are internal.** A caller never notifies a role's handler; a README names one only to - explain behaviour; renaming one needs no fragment. *Why:* handler names are global in a play, so - a caller bound to one breaks on a rename. *Held:* review. +- **Handlers are internal.** A caller never notifies a role's handler; a README names one only + to explain behaviour; renaming one needs no fragment. *Why:* handler names are global in a + play, so a caller bound to one breaks on a rename. *Held:* review. ## Variables and validation - **Internal variables.** `vars/` constants, `register:` and `set_fact` results are `___`. - *Why:* it is the Red Hat Automation Good Practices convention and tells an input from an - internal name. *Held:* ansible-lint `var-naming[no-role-prefix]` for the prefix, review for - the `__`. + *Why:* the Red Hat Automation Good Practices convention, and it tells an input from an internal + name. *Held:* ansible-lint `var-naming[no-role-prefix]` for the prefix (not in internal roles, + see below), review for the `__`. - **Validation.** The spec holds `type`, `choices` and `required`; a rule between role variables is an `assert` in `tasks/validate.yml`; cross-input spec keys (`required_if`, `mutually_exclusive` and the like) appear only inside a dict input's suboptions. *Why:* Ansible - does not apply them at entry-point level. *Held:* ansible-lint for the misuse, review for the - rest. + does not apply them at entry-point level. *Held:* ansible-lint `schema[role-arg-spec]` for the + misuse, review for the rest. - **Validation order.** `validate.yml` runs before any task that changes the host, loaded with - `import_tasks` and `tags: always`; only fact-computing tasks run before it, and they carry - `always` too. *Why:* a bad input fails before any change, and `always` on `include_tasks` does - not reach the included tasks. *Held:* review. + `import_tasks` and `tags: always`; only fact-computing tasks run before it, tagged `always` + too. *Why:* a bad input fails before any change, and `always` on `include_tasks` does not reach + the included tasks. *Held:* review. - **`noqa`.** Prefer fixing a finding; a `noqa` that remains names one rule and has a reason comment. *Why:* an unexplained exception cannot be reviewed. *Held:* review. - **Secrets.** Never in plaintext in the repository, a role's defaults, task output or a file on @@ -76,29 +73,32 @@ nothing checks it. "Until #N lands" names the backlog issue that will add the co ## Platforms - **Declared means tested.** A platform in `meta/main.yml` is one the role passes Molecule on in - CI; one used but untested goes only in a README "Untested platforms" line. Until #226 and #133 - land, `trixie` is declared untested and some roles still declare `jammy` or `all`. *Why:* no - tool reads the declaration, so it is worth something only if true. *Held:* review. + CI; one used but untested goes only in a README "Untested platforms" line. Accepted until the + Debian image (#226) and the platform cleanup (#133) land: `trixie` declared untested, and + `jammy` or `all` still declared. *Why:* no tool reads the declaration, so it is worth something + only if true. *Held:* review. - **Platforms follow the target hosts.** Ubuntu-targeting roles declare exactly `noble` and `resolute`; Proxmox-targeting roles declare Debian `trixie`; each is tested on its own OS. - *Why:* testing on hosts a role never runs on proves nothing. *Held:* review. Aspirational: - every role covers all three; fewer needs a one-line README reason. + *Why:* testing on hosts a role never runs on proves nothing. *Held:* review. +- **All three releases.** A role aims at `noble`, `resolute` and `trixie`; one that covers fewer + says why in one README line. *Why:* a wider role serves more hosts. *Held:* aspirational. - **Dropping a platform.** Removing or narrowing a declared platform is `breaking_changes`, - tested or not. *Why:* a consumer on it loses support. *Held:* review until #183 lands. + tested or not. *Why:* a consumer on it loses support. *Held:* review until the fragment check + fails a dropped platform without one (#183). ## Tests - **Verify** asserts the effect on the host (the service loaded the config), not only rendered files. *Why:* a rendered file proves nothing about a running service. *Held:* review. - **Negative tests.** Every validation has one in `verify.yml` (or a file it includes): - block/rescue/assert matching the expected error message. *Why:* a bare "it failed" passes for - the wrong error. *Held:* review. + block/rescue/assert matching the expected error message, run last or failing before any + change. *Why:* a bare "it failed" passes for the wrong error. *Held:* review. - **Check mode.** Every scenario runs `check` before and after converge. The only guards are `check_mode: false` on read-only probes and `when: not ansible_check_mode`; `--check` is the supported preview, and the README says a play-level `check_mode: true` is not supported. A role that cannot support check mode says why in README Notes and drops the step. *Why:* check-mode - breakage is a common fix class, and one guard pattern is reviewable. *Held:* review until #134 - lands. + breakage is a frequent fix, and one guard pattern is reviewable. *Held:* review until every + scenario's `test_sequence` runs `check` (#134). ## Roles calling roles @@ -107,16 +107,16 @@ nothing checks it. "Until #N lands" names the backlog issue that will add the co and lists it in its README; `meta/main.yml` `dependencies` stays `[]`. It calls a public role only on a supported entry point, an internal role on any entry point in its argument_specs. *Why:* a task-level include keeps the order readable, where `meta` dependencies run hidden and - deduplicated. *Held:* control for the scenarios (the selector runs a dependent role's scenarios - when a role it uses changes), review for empty `dependencies` until #246 lands. + deduplicated. *Held:* the selector runs a dependent role's scenarios when a role it uses + changes; review for empty `dependencies` until Lint fails a non-empty one (#246). - **Internal roles.** A leading `_`; only roles of this Collection call it, by FQCN; it refuses to run without a parent role (an `assert` on `ansible_parent_role_names`, as in - `_binary_update`); it has argument_specs, Molecule scenarios and follows the platform rules. + `_binary_update`); it has argument_specs and Molecule scenarios and follows the platform rules. Its README opens with the internal-role statement and otherwise keeps its own headings. Its - variables keep `__` with no `__` split. It is outside semver: a change confined to it + variables keep `__`, with no `__` split. It is outside semver: a change confined to it takes a `trivial` fragment, and the calling role writes the fragment for any effect a consumer can see. *Why:* shared machinery without a versioning promise. *Held:* the assert at run time; review that each new internal role has it. -- **`role-name` for internal roles.** Each internal role has one `role-name` line in - `.ansible-lint-ignore`. Until #138 lands `role-name` is skipped repository-wide in - `.ansible-lint`. *Why:* a misnamed public role must still fail. *Held:* review. +- **`role-name` for internal roles.** An internal role is exempted from ansible-lint `role-name` + by its own line in `.ansible-lint-ignore`. *Why:* a misnamed public role must still fail. + *Held:* review; until #138 replaces it, `.ansible-lint` skips `role-name` repository-wide. From f01f6b93747fbef83b2a17675b975c93f706185f Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 21 Nov 2026 21:35:19 +0000 Subject: [PATCH 3/7] docs(agents): keep the no-alias rule to inputs and reconcile platform aims Review round 2: the no-alias ban was decided for inputs only; the fragment check requires a fragment and checks the section only for a dropped platform; schema[role-arg-spec] holds entry-level misuse; say why internal roles are listed in .ansible-lint-ignore; scope the all-three-releases aim to roles that target both kinds of host. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- roles/AGENTS.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/roles/AGENTS.md b/roles/AGENTS.md index a5df8d9..2e20d12 100644 --- a/roles/AGENTS.md +++ b/roles/AGENTS.md @@ -7,7 +7,7 @@ names a check that does not exist yet and its backlog issue. ## Shape -- **Layout.** `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, `meta/argument_specs.yml`, +- **Layout.** Every role has `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, `meta/argument_specs.yml`, `README.md` and `molecule/default/`; `vars/` holds only constants a consumer must not override. *Why:* one predictable shape, and `vars/` outranks inventory. *Held:* the scenario by `scripts/select_molecule_scenarios.py` (fails a changed role without one), the rest by review. @@ -24,10 +24,10 @@ names a check that does not exist yet and its backlog issue. ## Interface - **Role interface.** Inputs, supported entry points, documented output facts and documented - tags (README `## Tags`). Renaming or removing one is a `breaking_changes` fragment and a major - release, with no compatibility alias; adding one is `minor_changes`. *Why:* this is what a - consumer may depend on, and with latest-only support an alias costs more than it gives. - *Held:* review (the fragment check, #183, will only see that a fragment exists). + tags (README `## Tags`). Renaming or removing one is a `breaking_changes` fragment (a major + release), for an input with no compatibility alias; adding one is `minor_changes`. *Why:* this + is what a consumer may depend on, and with latest-only support an alias costs more than it + gives. *Held:* review; the fragment check (#183) will require a fragment, not pick its section. - **argument_specs.** Every optional input has a value in `defaults/main.yml` and a spec entry with `type`, `description` and the same `default:`; `choices` for closed sets; a `required: true` input has no default. *Why:* a spec `default:` never sets the variable, but without it @@ -50,13 +50,14 @@ names a check that does not exist yet and its backlog issue. - **Internal variables.** `vars/` constants, `register:` and `set_fact` results are `___`. *Why:* the Red Hat Automation Good Practices convention, and it tells an input from an internal - name. *Held:* ansible-lint `var-naming[no-role-prefix]` for the prefix (not in internal roles, - see below), review for the `__`. + name. *Held:* ansible-lint `var-naming[no-role-prefix]` for the prefix, review for the `__`. + The check misreads a leading `_`, so an internal role's files are listed in + `.ansible-lint-ignore` and its prefix is held by review. - **Validation.** The spec holds `type`, `choices` and `required`; a rule between role variables is an `assert` in `tasks/validate.yml`; cross-input spec keys (`required_if`, `mutually_exclusive` and the like) appear only inside a dict input's suboptions. *Why:* Ansible - does not apply them at entry-point level. *Held:* ansible-lint `schema[role-arg-spec]` for the - misuse, review for the rest. + does not apply them at entry-point level. *Held:* ansible-lint `schema[role-arg-spec]` for + entry-level misuse, review for the rest. - **Validation order.** `validate.yml` runs before any task that changes the host, loaded with `import_tasks` and `tags: always`; only fact-computing tasks run before it, tagged `always` too. *Why:* a bad input fails before any change, and `always` on `include_tasks` does not reach @@ -80,8 +81,9 @@ names a check that does not exist yet and its backlog issue. - **Platforms follow the target hosts.** Ubuntu-targeting roles declare exactly `noble` and `resolute`; Proxmox-targeting roles declare Debian `trixie`; each is tested on its own OS. *Why:* testing on hosts a role never runs on proves nothing. *Held:* review. -- **All three releases.** A role aims at `noble`, `resolute` and `trixie`; one that covers fewer - says why in one README line. *Why:* a wider role serves more hosts. *Held:* aspirational. +- **All three releases.** A role aims to target both Ubuntu and Proxmox hosts, and so to declare + `noble`, `resolute` and `trixie`; one that covers fewer says why in one README line. *Why:* a + wider role serves more hosts. *Held:* aspirational. - **Dropping a platform.** Removing or narrowing a declared platform is `breaking_changes`, tested or not. *Why:* a consumer on it loses support. *Held:* review until the fragment check fails a dropped platform without one (#183). From 8f08badfd4cfa15a921204e91ec47d270fe07834 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 21 Nov 2026 21:37:33 +0000 Subject: [PATCH 4/7] docs(agents): rewrap the layout rule Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- roles/AGENTS.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/AGENTS.md b/roles/AGENTS.md index 2e20d12..9e1db5d 100644 --- a/roles/AGENTS.md +++ b/roles/AGENTS.md @@ -7,8 +7,9 @@ names a check that does not exist yet and its backlog issue. ## Shape -- **Layout.** Every role has `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, `meta/argument_specs.yml`, - `README.md` and `molecule/default/`; `vars/` holds only constants a consumer must not override. +- **Layout.** Every role has `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, + `meta/argument_specs.yml`, `README.md` and `molecule/default/`; `vars/` holds only constants a + consumer must not override. *Why:* one predictable shape, and `vars/` outranks inventory. *Held:* the scenario by `scripts/select_molecule_scenarios.py` (fails a changed role without one), the rest by review. - **README headings (public roles).** Supported platforms; Requirements and run order; Role From e36872c255fbb86582fec6d40f60f7d6d8f71968 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 21 Nov 2026 22:08:28 +0000 Subject: [PATCH 5/7] docs(adr): record the threat model as ADR 0001 ADR 0001 records the stance: actors and how far each is defended, assets, the trust boundary, least-privilege targets, the layers against a pull request that removes its own gate, and what is not done. The accepted risks go to a new register in SECURITY.md, one entry per risk with why it is accepted, its trigger and its planned reduction. Closes #143 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- SECURITY.md | 92 +++++++++++++++++++++++++++++++++++ docs/adr/0001-threat-model.md | 78 +++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 docs/adr/0001-threat-model.md diff --git a/SECURITY.md b/SECURITY.md index 146c34e..8dab430 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -14,3 +14,95 @@ coordinate a fix and its disclosure with you. This repository holds Ansible roles, CI workflows and the container images they use. Roles change the hosts they run against, so a flaw that weakens a hardening default or leaks a secret is in scope. Only the latest release is supported. + +## Accepted risks + +Risks this repository knowingly carries, as [ADR 0001](docs/adr/0001-threat-model.md) +requires: each with why it is accepted, the trigger that reopens it and its planned +reduction. A later decision that accepts a risk adds an entry here. + +### Prompt injection of an unattended agent + +- **Risk:** unattended agents act from the write agent account, so injected text can steer one + into pushing a branch whose workflow reads every secret this repository's workflows can + reach, before any review. +- **Why accepted:** small today, because registration is closed and the maintainer creates + every account. Cheap measure: an unattended agent acts only on `Status/Ready for Agent` + issues opened by the maintainer, a trusted contributor or an agent account, never adds that + label itself, and treats issue text as data ([rule](docs/agents/issue-tracker.md)). +- **Trigger:** an account the maintainer did not create can write issues or comments, or a + first injection is suspected; or the release bot's secret is stored. +- **Planned reduction:** none for now; decided again at either trigger. + +### Every write-capable token reaches the secrets + +- **Risk:** least privilege limits a token's API scope and merge rights, not its reach: any + write-capable token (humans, the agent account, Renovate, the release bot) can push a + branch whose workflow reads every secret this repository's workflows can reach. +- **Why accepted:** write access goes only to people and bots trusted with the secrets, and + every secret is rotated when a writer is removed or a token leaks. +- **Trigger:** ephemeral runners, or secrets scoped to environments, become available. +- **Planned reduction:** none planned beyond the trigger. + +### Shared runner + +- **Risk:** one long-lived runner holds the image push credential, the release bot token and + the Renovate token. A Molecule job runs as root and can plant code in the cached molecule + virtualenv and collection cache that later jobs, the privileged ones included, reuse. +- **Why accepted:** only trusted contributors' runs execute on it. The runner is to be + 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. That repository's content reaches this one + only through the content re-check and code-owner review of `.claude/`. +- **Trigger:** ephemeral runners become available. +- **Planned reduction:** ephemeral runners, a clean host per privileged job. + +### Required checks can be satisfied by a posted commit status + +- **Risk:** as far as is known, Gitea's required status checks match by context name and do + not check that Actions posted them, and the commit status API needs only code write. A + leaked bot or agent token could post `success` for Lint, Build and Molecule on its own + branch. Not tested on this server. +- **Why accepted:** a compromised bot or agent token is defended by cheap measures only + (ADR 0001, actors). +- **Trigger:** none set. +- **Planned reduction:** none planned. + +### Agent-side hooks are a convenience, not a control + +- **Risk:** agent-side hooks bind only Claude Code and can be switched off locally. +- **Why accepted:** server-side controls (branch protection, CI) hold the rules; the hooks + only catch mistakes earlier. +- **Trigger:** none set. +- **Planned reduction:** none planned. + +### Release assets and tags + +- **Risk:** any writer on Releases can replace a release asset, and the release bot can delete + and recreate `v*` tags, because Gitea checks tag 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. This is why tag protection alone does + not guard releases once a release token exists. +- **Why accepted:** artifact signing is not done; consumers who need more pin the git route + to a commit. +- **Trigger:** none set. +- **Planned reduction:** none planned. + +### Release tarball file modes + +- **Risk:** the release tag's `MANIFEST.json` hash 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 undetected. +- **Why accepted:** the Collection ships roles only. +- **Trigger:** none set. +- **Planned reduction:** none planned. + +### A push onto a Renovate pull request that has a scheduled merge + +- **Risk:** a writer can add a version-shaped change to such a pull request, and it merges as + the Renovate bot. +- **Why accepted:** bounded by the bot-diff gate (shape, not value) and by code-owner + approval, which a push dismisses; every account that can push there already reaches every + secret. There is no `renovate/*` push allowlist. +- **Trigger:** a token that can push here but cannot reach the secrets. +- **Planned reduction:** none planned. diff --git a/docs/adr/0001-threat-model.md b/docs/adr/0001-threat-model.md new file mode 100644 index 0000000..7cbf078 --- /dev/null +++ b/docs/adr/0001-threat-model.md @@ -0,0 +1,78 @@ +# 0001. Threat model: what we defend against and what we accept + +Status: accepted + +## Context + +This repository publishes Ansible roles that change the hosts they run on, built and tested by +CI that holds secrets. Contributors, many working with AI agents, push to it. The guardrails +defend first against mistakes and over-eager agents; against malice they take cheap measures +and write down what they leave undefended. + +## Decision + +**Actors and how far each is defended.** Held by is control (a named check), review (a person +other than the one acting sees the change first) or aspirational (checked by nothing). + +| Actor | Defence | +|---|---| +| A contributor with write access who makes a mistake | Controls | +| A contributor's agent that overreaches (turns a check green, weakens a gate, adds a secret reference) | Controls | +| An outsider's fork or AGit pull request | A human closes it without approving its runs and points to issues; never approved or merged | +| Instructions injected through issue, pull request or repository text an agent reads | Cheap measures; the rest is accepted | +| A malicious contributor, or a stolen contributor token | Cheap measures; the rest is accepted | +| A compromised bot or agent token | Cheap measures only: least privilege, below | +| A compromised upstream (Python packages, hooks, base images) | Pins, hashes, digests and release age; the rest is accepted | + +**Assets, in priority order:** what consumers install (`main` and the `v*` tags); the image +push credential, because every later CI run executes the images it pushes; contributors' +machines, where a branch's hooks and scripts run on checkout; control of the repository +(branch and tag protection, the secrets); the runner, which is rebuildable. + +**Trust boundary.** Two positions: a trusted contributor has write access and the secrets; an +outsider's fork or AGit pull request is closed, never approved. Write access to this +repository is access to every secret this repository's workflows can reach. Least privilege +limits a token's API scope and merge rights, not that reach: every write-capable token +(humans, the agent account, Renovate, the release bot) can push a branch whose workflow reads +them, before any review. Secrets live at repository level once a second repository joins the +organisation. When a writer is removed, or any write-capable token leaks, the maintainer +rotates every repository secret ([rotation list](../contributing/maintaining.md)). + +**Least-privilege targets.** Each bot or agent token does only its own job, and none owns the +organisation. Each agent account has exactly one accountable person, named in its profile, +and sits in a team with Actions read, so it cannot approve fork runs. The push allowlist +applies to `release/*` only. + +**Layers against a pull request that removes its own gate.** + +- Code owners: gate files, `docs/adr/`, every `AGENTS.md` and `.claude/` need the + maintainer's approval (`CODEOWNERS`); held by control once branch protection requires it. +- Secrets: each secret is referenced by exactly one workflow; held by code-owner review + ([rule](../../.gitea/workflows/AGENTS.md)). +- Judge scripts: a script that decides whether a pull request's own diff is allowed runs from + `main`'s copy, called from a workflow only the maintainer can change; a script that checks + content or the built artefact runs from the pull request's copy, and code-owner review + covers edits to it. +- Agent instructions: committed skills and agents (`.claude/`) are owned like `AGENTS.md`, + because a skill can grant itself tools, run shell commands and register hooks without a + trust prompt. +- Local runs: review the hook, script and agent-file changes of a branch you did not write + before running it; held by review ([rule](../contributing/reviewing.md)). + +**Every accepted risk is written down** with why it is accepted, its trigger and its planned +reduction, in the [Accepted risks](../../SECURITY.md#accepted-risks) register. Later +decisions add entries there, not here. + +## Reason + +Branch protection controls what merges, never what runs: anyone who can push a branch runs +their own workflow with the secrets. So trust is drawn at write access, and the controls +aim at the likelier failure, a well-meant change that weakens a gate. + +## Not done + +- **Signed commits:** a signature proves which key signed, not who wrote the change. +- **CLA or DCO:** GPL-3.0-or-later and REUSE already settle licensing, and only trusted + contributors' changes merge. +- **Signing release artifacts:** the tag message's checksum covers what review can; the + remaining gap is an accepted risk. From 3ddbc751b5e906e98cd3e084128606b717e32b23 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 21 Nov 2026 22:10:14 +0000 Subject: [PATCH 6/7] docs(adr): state held-by on every layer and tighten the register Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- SECURITY.md | 52 +++++++++++++++-------------------- docs/adr/0001-threat-model.md | 50 ++++++++++++++++----------------- 2 files changed, 45 insertions(+), 57 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 8dab430..211b30f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -30,19 +30,18 @@ reduction. A later decision that accepts a risk adds an entry here. every account. Cheap measure: an unattended agent acts only on `Status/Ready for Agent` issues opened by the maintainer, a trusted contributor or an agent account, never adds that label itself, and treats issue text as data ([rule](docs/agents/issue-tracker.md)). -- **Trigger:** an account the maintainer did not create can write issues or comments, or a - first injection is suspected; or the release bot's secret is stored. -- **Planned reduction:** none for now; decided again at either trigger. +- **Triggers**, the two moments to decide again: (1) an account the maintainer did not create + can write issues or comments, or a first injection is suspected; (2) the release bot's + secret is stored. +- **Planned reduction:** none for now. ### Every write-capable token reaches the secrets -- **Risk:** least privilege limits a token's API scope and merge rights, not its reach: any - write-capable token (humans, the agent account, Renovate, the release bot) can push a - branch whose workflow reads every secret this repository's workflows can reach. -- **Why accepted:** write access goes only to people and bots trusted with the secrets, and - every secret is rotated when a writer is removed or a token leaks. -- **Trigger:** ephemeral runners, or secrets scoped to environments, become available. -- **Planned reduction:** none planned beyond the trigger. +- **Risk:** see the trust boundary in [ADR 0001](docs/adr/0001-threat-model.md). +- **Why accepted:** write access goes only to those trusted with the secrets, and every + secret is rotated when a writer is removed or a write-capable token leaks. +- **Trigger:** ephemeral runners, or secrets scoped to environments, are adopted. +- **Planned reduction:** none beyond the trigger. ### Shared runner @@ -50,12 +49,11 @@ reduction. A later decision that accepts a risk adds an entry here. the Renovate token. A Molecule job runs as root and can plant code in the cached molecule virtualenv and collection cache that later jobs, the privileged ones included, reuse. - **Why accepted:** only trusted contributors' runs execute on it. The runner is to be - 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. That repository's content reaches this one + registered for this repository only, never for the organisation. Another repository in the + organisation (the skills source) is to run on a runner sharing no host, Docker daemon, cache + or filesystem with it, and to share no secret with it; its content reaches this repository only through the content re-check and code-owner review of `.claude/`. -- **Trigger:** ephemeral runners become available. -- **Planned reduction:** ephemeral runners, a clean host per privileged job. +- **Trigger and planned reduction:** ephemeral runners, a clean host per privileged job. ### Required checks can be satisfied by a posted commit status @@ -63,18 +61,14 @@ reduction. A later decision that accepts a risk adds an entry here. not check that Actions posted them, and the commit status API needs only code write. A leaked bot or agent token could post `success` for Lint, Build and Molecule on its own branch. Not tested on this server. -- **Why accepted:** a compromised bot or agent token is defended by cheap measures only - (ADR 0001, actors). -- **Trigger:** none set. -- **Planned reduction:** none planned. +- **Why accepted:** a compromised bot or agent token gets cheap measures only (ADR 0001). +- **Trigger and planned reduction:** none; accepted as is. ### Agent-side hooks are a convenience, not a control - **Risk:** agent-side hooks bind only Claude Code and can be switched off locally. -- **Why accepted:** server-side controls (branch protection, CI) hold the rules; the hooks - only catch mistakes earlier. -- **Trigger:** none set. -- **Planned reduction:** none planned. +- **Why accepted:** server-side controls (branch protection, CI) hold the rules. +- **Trigger and planned reduction:** none; accepted as is. ### Release assets and tags @@ -83,10 +77,9 @@ reduction. A later decision that accepts a risk adds an entry here. 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. This is why tag protection alone does not guard releases once a release token exists. -- **Why accepted:** artifact signing is not done; consumers who need more pin the git route - to a commit. -- **Trigger:** none set. -- **Planned reduction:** none planned. +- **Why accepted:** no artifact signing; consumers who need more pin the git route to a + commit. +- **Trigger and planned reduction:** none; accepted as is. ### Release tarball file modes @@ -94,8 +87,7 @@ reduction. A later decision that accepts a risk adds an entry here. Collection metadata, but not file modes. A writer who swaps the release tarball can change a file's exec bit undetected. - **Why accepted:** the Collection ships roles only. -- **Trigger:** none set. -- **Planned reduction:** none planned. +- **Trigger and planned reduction:** none; accepted as is. ### A push onto a Renovate pull request that has a scheduled merge @@ -105,4 +97,4 @@ reduction. A later decision that accepts a risk adds an entry here. approval, which a push dismisses; every account that can push there already reaches every secret. There is no `renovate/*` push allowlist. - **Trigger:** a token that can push here but cannot reach the secrets. -- **Planned reduction:** none planned. +- **Planned reduction:** none for now. diff --git a/docs/adr/0001-threat-model.md b/docs/adr/0001-threat-model.md index 7cbf078..2306cc3 100644 --- a/docs/adr/0001-threat-model.md +++ b/docs/adr/0001-threat-model.md @@ -5,19 +5,18 @@ Status: accepted ## Context This repository publishes Ansible roles that change the hosts they run on, built and tested by -CI that holds secrets. Contributors, many working with AI agents, push to it. The guardrails -defend first against mistakes and over-eager agents; against malice they take cheap measures -and write down what they leave undefended. +CI that holds secrets. Contributors, many working with AI agents, push to it. Its rules and +controls defend first against mistakes and over-eager agents; against malice they take cheap +measures and write down what they leave undefended. ## Decision -**Actors and how far each is defended.** Held by is control (a named check), review (a person -other than the one acting sees the change first) or aspirational (checked by nothing). +**Actors and how far each is defended.** | Actor | Defence | |---|---| | A contributor with write access who makes a mistake | Controls | -| A contributor's agent that overreaches (turns a check green, weakens a gate, adds a secret reference) | Controls | +| A contributor's agent that overreaches (turns a check green, weakens a control, adds a secret reference) | Controls | | An outsider's fork or AGit pull request | A human closes it without approving its runs and points to issues; never approved or merged | | Instructions injected through issue, pull request or repository text an agent reads | Cheap measures; the rest is accepted | | A malicious contributor, or a stolen contributor token | Cheap measures; the rest is accepted | @@ -35,29 +34,28 @@ repository is access to every secret this repository's workflows can reach. Leas limits a token's API scope and merge rights, not that reach: every write-capable token (humans, the agent account, Renovate, the release bot) can push a branch whose workflow reads them, before any review. Secrets live at repository level once a second repository joins the -organisation. When a writer is removed, or any write-capable token leaks, the maintainer -rotates every repository secret ([rotation list](../contributing/maintaining.md)). +organisation (aspirational). When a writer is removed, or any write-capable token leaks, the +maintainer rotates every repository secret ([rotation list](../contributing/maintaining.md)). -**Least-privilege targets.** Each bot or agent token does only its own job, and none owns the -organisation. Each agent account has exactly one accountable person, named in its profile, -and sits in a team with Actions read, so it cannot approve fork runs. The push allowlist -applies to `release/*` only. +**Least-privilege targets** (aspirational: settings no check reads). Each bot or agent token +does only its own job, and none owns the organisation. Each agent account has exactly one +accountable person, named in its profile, and sits in a team with Actions read, so it cannot +approve fork runs. The push allowlist applies to `release/*` only. -**Layers against a pull request that removes its own gate.** +**Layers against a pull request that removes its own control.** Held by is control (naming +the check), review (a person other than the one acting sees the change first) or aspirational. -- Code owners: gate files, `docs/adr/`, every `AGENTS.md` and `.claude/` need the - maintainer's approval (`CODEOWNERS`); held by control once branch protection requires it. - Secrets: each secret is referenced by exactly one workflow; held by code-owner review ([rule](../../.gitea/workflows/AGENTS.md)). - Judge scripts: a script that decides whether a pull request's own diff is allowed runs from - `main`'s copy, called from a workflow only the maintainer can change; a script that checks - content or the built artefact runs from the pull request's copy, and code-owner review - covers edits to it. + `main`'s copy, called from a workflow only the maintainer can change (CODEOWNERS); a script + that checks content or the built artifact runs from the pull request's copy. Both held by + code-owner review. - Agent instructions: committed skills and agents (`.claude/`) are owned like `AGENTS.md`, because a skill can grant itself tools, run shell commands and register hooks without a - trust prompt. -- Local runs: review the hook, script and agent-file changes of a branch you did not write - before running it; held by review ([rule](../contributing/reviewing.md)). + trust prompt; held by code-owner review. +- Local runs: review the hook and script changes of a branch you did not write before running + it; held by review ([rule](../contributing/reviewing.md)). **Every accepted risk is written down** with why it is accepted, its trigger and its planned reduction, in the [Accepted risks](../../SECURITY.md#accepted-risks) register. Later @@ -66,13 +64,11 @@ decisions add entries there, not here. ## Reason Branch protection controls what merges, never what runs: anyone who can push a branch runs -their own workflow with the secrets. So trust is drawn at write access, and the controls -aim at the likelier failure, a well-meant change that weakens a gate. +their own workflow with the secrets. So trust is drawn at write access, and the controls aim +at the likelier failure, a well-meant change that weakens a control. ## Not done - **Signed commits:** a signature proves which key signed, not who wrote the change. -- **CLA or DCO:** GPL-3.0-or-later and REUSE already settle licensing, and only trusted - contributors' changes merge. -- **Signing release artifacts:** the tag message's checksum covers what review can; the - remaining gap is an accepted risk. +- **CLA or DCO:** GPL-3.0-or-later and REUSE already settle licensing. +- **Signing release artifacts:** see the register entry on release assets and tags. From 8a785b95ae28676248b0ba15a37ce22b8c514afe Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 21 Nov 2026 22:10:59 +0000 Subject: [PATCH 7/7] docs(adr): word the secrets rule as at most one workflow Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- SECURITY.md | 2 +- docs/adr/0001-threat-model.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 211b30f..090c4fe 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -76,7 +76,7 @@ reduction. A later decision that accepts a risk adds an entry here. and recreate `v*` tags, because Gitea checks tag 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. This is why tag protection alone does - not guard releases once a release token exists. + not protect releases once a release token exists. - **Why accepted:** no artifact signing; consumers who need more pin the git route to a commit. - **Trigger and planned reduction:** none; accepted as is. diff --git a/docs/adr/0001-threat-model.md b/docs/adr/0001-threat-model.md index 2306cc3..4bd7bdf 100644 --- a/docs/adr/0001-threat-model.md +++ b/docs/adr/0001-threat-model.md @@ -45,7 +45,7 @@ approve fork runs. The push allowlist applies to `release/*` only. **Layers against a pull request that removes its own control.** Held by is control (naming the check), review (a person other than the one acting sees the change first) or aspirational. -- Secrets: each secret is referenced by exactly one workflow; held by code-owner review +- Secrets: each secret may be referenced by one workflow only; held by code-owner review ([rule](../../.gitea/workflows/AGENTS.md)). - Judge scripts: a script that decides whether a pull request's own diff is allowed runs from `main`'s copy, called from a workflow only the maintainer can change (CODEOWNERS); a script