From 3d4fac124dcebf647318292ab1266ddb57bc7888 Mon Sep 17 00:00:00 2001 From: Inferencebot Date: Fri, 20 Nov 2026 00:31:09 +0000 Subject: [PATCH] security: record residual root-trust gap in the backup timer --- maintenance/host-access.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/maintenance/host-access.md b/maintenance/host-access.md index f1c7680..5e13b14 100644 --- a/maintenance/host-access.md +++ b/maintenance/host-access.md @@ -19,6 +19,17 @@ Everything else — package installs, user management, file writes under `/etc`, - The nightly backup runs as root from **`/usr/local/sbin/agent-backup`** via an `agent-backup.service` drop-in. The script is root-owned; the agent's `~/.hermes/scripts/backup.sh` is no longer executed by the unit and must not be treated as root code. - Backup credentials live in root-only `/etc/agent-backup.env`. +## Residual root-trust gap (operator root required) + +The root-owned backup script still resolves `restic` from `/usr/local/bin/restic`, which is owned by `ubuntu`, and it still sources `/home/ubuntu/.hermes/.env`. An agent-writable binary or `PATH` line there is therefore a root code-execution path through the nightly backup timer. Until root fixes it: + +- `chown root:root /usr/local/bin/restic` (or install a root-owned copy and call it absolutely) +- remove `/home/ubuntu/.local/bin` from the root script’s `PATH` +- stop sourcing `/home/ubuntu/.hermes/.env` from the root script +- remove the Hermes-python `pip list` diagnostic + +This requires root outside the agent; the restricted sudo policy does not grant it. Treat the backup timer as privileged until fixed. + ## Recovery (operator only) The pre-change cloud-init sudoers file is preserved at `/root/sudoers-cloud-init.bak` (0600). Restoring it requires root access outside the agent, e.g. the provider console. Do not expose it to the agent.