Credential boundary setup in ansible-homelab-mono #184
Notifications
Due Date
No due date set.
Blocks
#189 delivery-repo-doc and the ansible-homelab-mono delivery.md
Mortis/Holocron
Reference: Mortis/Holocron#184
Reference in new issue
Block a user
Part of #166
Question
Set up, in
ansible-homelab-mono, the credential boundary that ADR-0032 (Credentials, not hooks, are the agent safety boundary) makes the real control. The destination test can't run safely without it. Produce a checklist and work through it with the human, since most of it needs admin rights the agent doesn't hold:main: an approvals allowlist of humans only, dismiss stale approvals, the bot kept off the merge allowlist, protected file patterns (agent config, AGENTS.md,.gitea/workflows/, tests), required status checks;--check --diff,flux diff) as a required status check plus a PR comment, and how much of it the existingprovision.ymlalready provides;view, plus an aggregated read-onlySealedSecretrole;docs/agents/delivery.md.The resolution records what was done and the resulting facts later tickets depend on: the bot username, the kubeconfig's location (not its contents), and the status-check names.
Working checklist (not the resolution)
Survey findings (2026-11-22)
/root/ansible/.ansible/vault-pass.txt), the SSH key (/root/.ssh/id_ed25519) and an admin kubeconfig thatKUBECONFIGalready points at (/root/ansible/.kube/config).kubectl auth can-i delete pods -Aandget secrets -Aboth answeryes. File contents were not read..gitea/workflows/molecule.yml:10-21documents that anyone who can push branches can readANSIBLE_VAULT_PASSWORDandSSH_PRIVATE_KEYthrough a workflow. Protected file patterns block the merge, not the run.provision.yml, each stage's--check --diffruns after merge, non-blocking (continue-on-error), in the apply job with the real secrets. Nothing runs before merge. Split out to Pre-merge Ansible dry run without exposing production credentials.Ansible Lint Validation / lint_ansible (pull_request)runs on every PR with no secrets. Whether branch protection requires it is unverified.sealed-secrets-backup/sealed-secrets-keys-backup.yamlis tracked but vault-encrypted (header only checked). It is a Never-tier read target.Decisions taken with the owner this session
KUBECONFIGpointing at the read-only kubeconfig, so accidental cluster writes fail.ClaudeGitea user (not a new account).Checklist (human = needs admin; agent = can draft)
Agent unix user: moved to Agent unix user for delivery sessions.Claudeis a Write collaborator ondefame1297/ansible-homelab-mono, not admin.write:repositoryandwrite:issue. Separate from the planning token so each can be revoked alone.main(human)Defame1297).Claudeexcluded..claude/**;.apm/**;apm.yml;apm.lock.yaml;AGENTS.md;CLAUDE.md;docs/agents/**;.gitea/**;.pre-commit-config.yamlAnsible Lint Validation / lint_ansible (pull_request): confirm it is required.flux build kustomization --dry-run(orkustomize build) at base and head, diffed, posted as a PR comment and a status.flux diffneeds write RBAC, because Kubernetes authorises dry-run requests like real ones, so it is rejected.main's copy (the same pattern as the Renovate guard inlint_validation.yml).Delivery-Stage: test-author.docs/agents/delivery.md.agent-readonly) bound toview.sealedsecrets-view(get/list/watchonbitnami.com/sealedsecrets) labelledrbac.authorization.k8s.io/aggregate-to-view: "true"./root/.kube/agent-readonly.config); delivery sessions exportKUBECONFIGto it.kubectl auth can-i get secrets -Agivesno,delete podsgivesno,list sealedsecrets -Agivesyes.Defame1297is the only human allowed to set gate labels; it is recorded fordocs/agents/delivery.md.Facts to fill in at resolution
Bot username (
Claude); kubeconfig path; exact status-check names; protected-file behaviour observed.Progress (2026-11-22)
Done, merged:
agent-readonlynamespace and ServiceAccount bound toview, plus thesealedsecrets-viewrole aggregated intoview.viewalready covered the Flux CRDs viaflux-view-flux-system. No token is kept in git.Flux Dry Run / flux_dry_run (pull_request)andTest Paths Frozen / test_paths_frozen (pull_request)..gitea/test-paths, not indocs/agents/delivery.md;delivery.mdshould point at that file.kubectl diffandflux diffout of the Read tier, because they are server-side dry runs that need write RBAC.Left (owner):
main, with the two new checks required, plus the protected-file-pattern merge behaviour observed.lint_ansibleis required./root/.kube/agent-readonly.config, and run the threecan-ichecks.Side finding: running holocron's
apm-audit-cipre-push hook from a linked git worktree with noapm_moduleschecked out old commits in that worktree and setcore.bare=truein the shared.git/config. That broke the main checkout. I reverted it by hand. Pushing from the main checkout works.Resolution
The agent side of the boundary is built and merged. The admin-only steps are deferred by the owner to Finish credential boundary admin setup in ansible-homelab-mono, which blocks only Destination test walk-through (Flux).
Decisions (owner, 2026-11-22):
ClaudeGitea user, pushing same-repo branches. Accepted risk: a bot branch can reach repo secrets through apull_requestworkflow.kubectl diffandflux diffare not Read tier, because they need write RBAC.Facts later tickets depend on:
Claude.Defame1297.agent-readonlyin namespaceagent-readonly, bound toview, withsealedsecrets-viewaggregated intoview(ansible-homelab-mono PR 928)./root/.kube/agent-readonly.config, outside the repo. It is not created yet; see the deferred ticket.Ansible Lint Validation / lint_ansible (pull_request)Flux Dry Run / flux_dry_run (pull_request)Test Paths Frozen / test_paths_frozen (pull_request).gitea/test-paths, read frommain.docs/agents/delivery.mdpoints at this file rather than restating the globs.Delivery-Stage: test-author.gitea-actionsand updates it in place (verified).