Author SHA1 Message Date
Defame1297 ac1a63d5f3 Merge pull request 'docs(adr): record credential boundary setup decisions in ADR-0032' (#202) from docs/adr-0032-boundary-amendments into main
Reviewed-on: #202
2026-11-22 19:13:23 +00:00
Defame1297andClaude Opus 5.5 0c775805d2 docs(adr): record credential boundary setup decisions in ADR-0032
Setting up the boundary in ansible-homelab-mono changed four things.
Test paths leave the protected file patterns, since protecting them
blocks the test author; the CI test-path check guards them. The Flux PR
dry run is an offline rendered diff, because a live flux diff needs
write RBAC. The pre-merge Ansible --check --diff is reopened, as check
mode runs PR-controlled code with production credentials. Root agent
sessions and same-repo branches reaching repo secrets are accepted risks.

Refs: #184, #200, #201

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
2026-11-22 17:54:46 +00:00
Defame1297 dfb762ada9 Merge pull request 'docs(adr): mark Copilot CLI untested in ADR-0031' (#197) from docs/adr-0031-copilot-untested into main
Reviewed-on: #197
2026-11-22 16:39:50 +00:00
Defame1297andClaude Opus 5.5 d890f345a4 docs(adr): mark Copilot CLI untested in ADR-0031
Refs: #173

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
2026-11-22 16:28:20 +00:00
2 changed files with 37 additions and 10 deletions

No files matched your search

@@ -35,6 +35,9 @@ approved) are human-set tracker state. `mattpocock`'s thinking tools (`wayfinder
- *Amended 2026-11-22 (holocron#173): QA ran on the pushed branch before the PR opened, and CI was - *Amended 2026-11-22 (holocron#173): QA ran on the pushed branch before the PR opened, and CI was
required on branch push as well as PR; both moved to the draft PR, and acceptance checks were required on branch push as well as PR; both moved to the draft PR, and acceptance checks were
added.* added.*
- Claude Code and Copilot CLI are the tested targets; other runtimes are best effort. - Claude Code is the tested target; Copilot CLI is written to its documented behaviour but untested
until an account exists; other runtimes are best effort.
- *Amended 2026-11-22 (holocron#173): Copilot CLI was a tested target; with no account to test on,
it is supported from its documentation only.*
- Infra applies happen by merge (GitOps for Flux, Ansible and OpenTofu alike), so the PR gate is the - Infra applies happen by merge (GitOps for Flux, Ansible and OpenTofu alike), so the PR gate is the
apply gate; the operator verifies and opens revert PRs, never reverting on its own. apply gate; the operator verifies and opens revert PRs, never reverting on its own.
@@ -11,8 +11,10 @@ Code and Copilot CLI. Decided in holocron#172.
Every package skill classifies each command it drives into one tier: Every package skill classifies each command it drives into one tier:
- **Read** — lint, syntax check, dry run, diff, `kubectl get/describe/logs`, `flux get`, `flux diff`, - **Read** — lint, syntax check, dry run, diff, `kubectl get/describe/logs`, `flux get`, an offline
`kubectl diff`. Free. render or rendered diff (`kustomize build`, `flux build --dry-run`). Free. Live `kubectl diff` and
`flux diff` are server-side dry runs that need write RBAC, so they fail under the read-only
kubeconfig and are not used.
- **Propose** — branch, commit, push, open a PR, comment. Free. - **Propose** — branch, commit, push, open a PR, comment. Free.
- **Apply-by-merge** — every change to infrastructure. Happens only through an approved merge; the - **Apply-by-merge** — every change to infrastructure. Happens only through an approved merge; the
agent never runs it. agent never runs it.
@@ -30,8 +32,11 @@ Every package skill classifies each command it drives into one tier:
Agents never decrypt Ansible Vault or Sealed Secrets and never read the material that would. Stage Agents never decrypt Ansible Vault or Sealed Secrets and never read the material that would. Stage
sessions use a kubeconfig bound to the built-in `view` ClusterRole (which excludes Secrets) plus a sessions use a kubeconfig bound to the built-in `view` ClusterRole (which excludes Secrets) plus a
read-only aggregated role for `SealedSecret` objects. Ansible stage work runs only what succeeds with read-only aggregated role for `SealedSecret` objects. Ansible stage work runs only what succeeds with
a placeholder vault password (`--syntax-check`, `ansible-lint`, inventory reads); a real a placeholder vault password (`--syntax-check`, `ansible-lint`, inventory reads). A real
`--check --diff` runs in CI, which holds the password. `--check --diff` before merge is reopened: check mode still runs PR-controlled code (lookups,
`delegate_to: localhost`, `check_mode: false` tasks, plugins) with the production credentials, so
running it in CI on a bot PR hands the bot those credentials. Decided in
[Pre-merge Ansible dry run without exposing production credentials](https://git.rkdr.net/Mortis/Holocron/issues/200).
## Enforcement layers ## Enforcement layers
@@ -42,13 +47,19 @@ a placeholder vault password (`--syntax-check`, `ansible-lint`, inventory reads)
4. **Credential boundary** in each consuming repo — the real control: 4. **Credential boundary** in each consuming repo — the real control:
- agents act as a dedicated Gitea bot user; - agents act as a dedicated Gitea bot user;
- branch protection: approvals allowlist of humans only, dismiss stale approvals, bot off the - branch protection: approvals allowlist of humans only, dismiss stale approvals, bot off the
merge allowlist, protected file patterns for agent config, AGENTS.md, CI workflows and tests; merge allowlist, protected file patterns for agent config, AGENTS.md and CI workflows; test
- every PR carries the dry run (`--check --diff`, `flux diff`, later `tofu plan`) as a required paths stay out, because protecting them would block the test author's own commits;
status and a PR comment; apply happens after merge; - every PR carries the dry run as a required status and a PR comment; apply happens after merge.
Flux's is an offline rendered diff of base and head that holds no cluster credential; a live
`flux diff` needs write RBAC, because Kubernetes authorises dry-run requests like real ones, so
it is not used. Ansible's pre-merge `--check --diff` is reopened (see Secrets); later
`tofu plan`;
- stage leads start only when a user on the human allowlist in `docs/agents/delivery.md` set the - stage leads start only when a user on the human allowlist in `docs/agents/delivery.md` set the
gate label, checked against the issue timeline; gate label, checked against the issue timeline;
- a CI check fails if test paths changed after the test author's commit; the implementer hands - a CI test-path check, run from `main`'s copy, fails if a commit after the test author's
disputed tests back instead of editing them. (trailer `Delivery-Stage: test-author`) touches the globs in `.gitea/test-paths`; this check,
not file protection, guards tests. The implementer hands disputed tests back instead of editing
them.
5. Pre-commit and CI in the consuming repo are the deterministic backstop. 5. Pre-commit and CI in the consuming repo are the deterministic backstop.
## Considered Options ## Considered Options
@@ -73,3 +84,16 @@ a placeholder vault password (`--syntax-check`, `ansible-lint`, inventory reads)
starting it, keeping untrusted text out of it, and answering each ask. starting it, keeping untrusted text out of it, and answering each ask.
- Headless sessions running repo-controlled config are not addressed here; launching from pinned - Headless sessions running repo-controlled config are not addressed here; launching from pinned
config is part of run mode. config is part of run mode.
- **Accepted risk:** agent sessions run as root on the dev box until [Agent unix user for delivery sessions](https://git.rkdr.net/Mortis/Holocron/issues/201) is
done. Root can read the vault password, the host SSH key and the admin kubeconfig, so on that
machine the credential boundary is a guardrail only. Partial mitigation: delivery sessions export
`KUBECONFIG` to a read-only kubeconfig, so accidental cluster writes fail.
- **Accepted risk:** same-repo branches reach repo secrets. The bot (the existing `Claude` Gitea
user) pushes same-repo branches; Gitea runs a `pull_request` workflow from the PR branch's own copy
and gives same-repo PRs the repo secrets, so a bot branch can read them. Protected file patterns
block the merge, not the run.
- *Amended 2026-11-22 ([Credential boundary setup in ansible-homelab-mono](https://git.rkdr.net/Mortis/Holocron/issues/184)): test paths left
the protected file patterns for the test-path check; the Flux dry run became an offline render,
and live `kubectl diff` left the Read tier;
the CI `--check --diff`, and with it the rejection of gated vault-touching check runs, were
reopened; the root-session and same-repo-branch risks were accepted.*