Let Hermes' gateway reach only a Matrix server you've allowed

Ports CoreDesktop's e991264, 05b13b2 and d974b91.

configure agents allowed Hermes' gateway the host in MATRIX_HOMESERVER
from ~/.hermes/.env, which Hermes can write from inside its sandbox, so
it could open the way out to any host it chose. The allowed server is
now in ~/.config/federated-connector/sandbox/hermes.json, which no
sandbox can write. configure hermes is to do while Hermes names a server
you haven't allowed, and asks about only that; configure agents says so.
Only a plain host name counts, so it can't be a wildcard or carry escape
codes into the question. sandbox/agent no longer reads
FEDERATED_SANDBOX_DOMAINS. The server an old drop-in allows is carried
over, read from the drop-in itself, when the gateway starts and when
configure agents rewrites it, so a working gateway keeps working.

Agents could read ~/.config/federated-connector, which has the Core's
domain and user name; base.json now hides it.

edit_json treats an empty settings file like a missing one: jq reads no
JSON from an empty file and writes nothing back, so configure ai-servers
said a server was added while the sandbox still blocked it.

agent_path joined the last folder on PATH to ~/.local/bin, so an agent
there wasn't found when ~/.local/bin wasn't on PATH (e.g. in a service).

Smoketest: 55-hermes-homeserver, and 50-sandbox checks that an agent
can't read the connector's settings. PLAN.md drops what's done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-28 18:55:37 -07:00
co-authored by Claude Opus 5.5
parent cf31ffc929
commit 1445ad7bb1
12 changed files with 210 additions and 37 deletions
+14 -9
View File
@@ -48,12 +48,21 @@ git -C ../coredesktop log --oneline <marker>..HEAD -- configure configure.d sand
Since `4a4a3bd`, to look at:
- [ ] `16e5a9c` Find storage and AI servers on the tailnet, not only over mDNS
- [ ] `e991264` Let Hermes' gateway reach only a Matrix server you've allowed
- [ ] `d974b91` configure: treat an empty settings file like a missing one
- [ ] `05b13b2` Test the agent sandbox from inside, and hide CoreDesktop's settings
- [ ] `05b13b2` Test the agent sandbox from inside: port
`smoketest/scenarios/60-security.sh`, which runs a script through
sandbox/bin's wrappers and checks what it can't read, write or reach,
and its later checks from `d5925fa` (what root runs is root's alone) and
`53c6c8b` (the install path). Hiding the connector's settings from
agents is done.
- [ ] `4fb3539` Claude notifications: clicking one brings back the app Claude runs in
- [ ] `9dc5eb1` Upgrade safeguards, hardware setup, sign-in options and Taildrop:
Taildrop is likely to apply; the rest is probably Arch-only
- [ ] `9dc5eb1` Upgrade safeguards, hardware setup, sign-in options and Taildrop.
To port: `configure security-key` and `configure fingerprint` (through
`pam-auth-update` and fprintd on Pop!_OS, not by editing PAM files),
Taildrop's service that saves files sent here to Downloads (COSMIC Files
has no Scripts menu for sending), keeping the computer awake during
`update`, and the captive portal script that pauses a Tailscale exit
node. Arch only: the pacman guard, unowned files, `hardware.sh`
(System76 does its own).
- [ ] `ffbaf71` Keep other machines on the network from reaching Docker
containers: only if the connector ever installs Docker
@@ -61,10 +70,6 @@ Arch or GNOME only, nothing to port: `e14a345` and `ba4dc17` (login screen
logo), `1e2581d` (kernel modules), `d456e31` (initramfs), `5d7db2c` (reboot
after update: Pop!_OS' own updates handle this).
- [ ] CoreDesktop's PLAN.md still plans to merge Pop!_OS support into its
`configure` and archive this repo ("Merge Pop!_OS support into
configure"). Update it there to say this project stays separate.
## Pop!_OS-specific
- [ ] The manual checks in [TEST.md](TEST.md) on a real Pop!_OS 24.04 machine,