feat(diag): extend read-only channel to web-02 fw guest microVM #91
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!91
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/88"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Extends the read-only
diagchannel (ADR-0005) into the web-02 fw guest microVM, so the dev agent can SSH in read-only to diagnose its services (Invidious + companion, Matrix synapse + mautrix bridges, MAS, n8n, phpldapadmin, mcp-forgejo, lab) instead of always falling back to a human.The original channel only covered the bare-metal fleet; web-02 authorised root only (via
utils/ssh-keys.nix) and had nodiaguser, so the agent's key was refused. The network path already worked (fw permitsdev → vm-*, web-02 runs sshd on :22, split-horizon DNS resolvesweb-02.cloonar.comfrom dev) — only authorisation was missing.Changes
hosts/fw/vms/web/default.nix— import the sharedutils/modules/diagmodule. Reuses the already-committed diag pubkey, so no new SOPS secret is added (the private key already lives on dev at/run/secrets/diag-ssh-key).utils/home-manager/diag-ssh.nix— addweb-02/web-02.cloonar.comto both matchBlocks sossh web-02from dev usesUser diag+ the diag identity rather than offering the agent's personal key.utils/modules/diag/wrapper.sh— widen the denylist so thecat/head/tail/lsallowances can't read web-02's on-disk secrets:/var/lib/{matrix-synapse,mautrix-*,mas,n8n,zammad}(joining the existing/var/lib/postgresql) and the SSH host private keys at their real/persist/etc/ssh/ssh_host_*_keylocation — web-02 keeps host keys under the impermanence/persisttree, which the bare/etc/ssh/...rule misses. Deny still wins over allow; bare-metal behaviour is unchanged (additive denies only).docs/adr/0005-…— dated amendment recording the extension and that thesystemd-journal/admjournal-read tradeoff now also covers web-02's sensitive services.Verification (done)
utils/→ shared path), including fw, which builds web-02 with the diag module and dev with the updated client config.nixpkgs-fmt --checkclean on both changed.nixfiles.wrapper.sh: the new paths (synapse, every mautrix bridge, mas, n8n, zammad, the/persisthost keys) reject with exit 2; existing denies (/etc/ssh/ssh_host_*_key,/run/secrets/*,/var/lib/postgresql) still reject;*.pub,/etc/hostname,systemctl status, andjournalctl -u invidiousremain allowed.Post-merge manual check (agent can't self-perform — prod SSH is human-gated)
After this deploys to web-02, from dev confirm read-only access works and secrets/mutations are refused:
Closes #88