feat(terra): pass-broker for Telegram-approved Proton Pass access

A Rust daemon running as its own system user holds terra's only pass-cli
session, an agent PAT scoped to the HomeLab vaults. `pass-broker get` asks
it for an item; per-item rules decide auto/ask/deny, and "ask" sends a
Telegram prompt that only darman's account can approve (10-min grant for
darman@*/root@*). Requests whose client is gone are dropped or withdrawn,
and the client gives up after 30s without an answer.

scripts/deploy uses the broker exclusively when its socket exists. Covered
by checks.pass-broker (fake pass-cli + Telegram). Secrets added for all
hosts; only terra runs the broker so far.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 01:48:46 +02:00
co-authored by Claude Opus 5.5
parent e6ceacb63b
commit 3dccafe2b8
22 changed files with 2645 additions and 13 deletions
+11 -1
View File
@@ -18,7 +18,8 @@
# at ~/.config/homelab/<config>/ssh_host_ed25519_key. Runs from a non-NixOS host too.
#
# Password prompts auto-fill from the "HomeLab" Proton Pass vault, keyed by
# <config> not <host> (darman@<config> for sudo, root@<config> for ssh).
# <config> not <host> (darman@<config> for sudo, root@<config> for ssh), via
# pass-broker (Telegram-approved) where it runs, else your own pass-cli session.
# Override with HOMELAB_PASS_ITEM / HOMELAB_PASS_ROOT_ITEM / HOMELAB_PASS_VAULT.
set -euo pipefail
shopt -s nullglob
@@ -386,6 +387,15 @@ require_tracked() {
# real on darman@neptun, which had both an Active and a Trashed copy).
proton_pass_password() {
local title="$1" vault="${HOMELAB_PASS_VAULT:-HomeLab}" id pw
# Where pass-broker runs (services/identity/pass-broker.nix), it is the only
# source: a refused tap must not fall through to someone's own session.
if [ -S /run/pass-broker.sock ] && command -v pass-broker >/dev/null 2>&1; then
pass-broker get --vault "$vault" --item "$title" \
--reason "scripts/deploy ${SCRIPT_ARGS[*]}" || true
return 0
fi
command -v pass-cli >/dev/null 2>&1 || return 0
# Lines look like: - [ITEM_ID]: the title (state=Active)