Root-only remediation required on the agent host. The nightly backup unit runs root-owned /usr/local/sbin/agent-backup, but that script still resolves restic from /usr/local/bin/restic (owned by ubuntu) and sources /home/ubuntu/.hermes/.env with /home/ubuntu/.local/bin on PATH. An agent-writable binary or env is therefore root code execution through the backup timer.
Required root commands:
chown root:root /usr/local/bin/restic
remove /home/ubuntu/.local/bin from the root script's PATH
stop sourcing /home/ubuntu/.hermes/.env
remove the Hermes-python pip list diagnostic
systemctl daemon-reload
The restricted sudo policy deliberately does not grant these. The daily watchdog (82130f968506) alerts if the conditions regress. Until fixed, treat the backup timer as privileged.
Root-only remediation required on the agent host. The nightly backup unit runs root-owned `/usr/local/sbin/agent-backup`, but that script still resolves `restic` from `/usr/local/bin/restic` (owned by `ubuntu`) and sources `/home/ubuntu/.hermes/.env` with `/home/ubuntu/.local/bin` on `PATH`. An agent-writable binary or env is therefore root code execution through the backup timer.
Required root commands:
- `chown root:root /usr/local/bin/restic`
- remove `/home/ubuntu/.local/bin` from the root script's `PATH`
- stop sourcing `/home/ubuntu/.hermes/.env`
- remove the Hermes-python `pip list` diagnostic
- `systemctl daemon-reload`
The restricted sudo policy deliberately does not grant these. The daily watchdog (`82130f968506`) alerts if the conditions regress. Until fixed, treat the backup timer as privileged.
Status 2026-11-22 — four of the five items are already satisfied on the host; one remains, and it is root-only.
Verified now:
/usr/local/bin/restic is root:root, mode 755.
The script's PATH is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin — no /home/ubuntu/.local/bin.
It sources /etc/agent-backup.env only; there is no reference to the agent's .env.
The unit's drop-in points ExecStart at /usr/local/sbin/agent-backup, itself root:root 755, so no daemon-reload is outstanding.
Remaining: the manifest step still runs "$HERMES_DIR/tools/python-…/bin/python3" -m pip list as root. That is an agent-writable binary executed by a root unit — the same class of path this issue exists to remove, and the current watchdog did not catch it.
I prepared the fix at /tmp/agent-backup.proposed (mirrored at ~/.hermes/pending/agent-backup.proposed): the manifest's pip inventory is kept but now runs as ubuntu via runuser -u ubuntu --, so root no longer executes the agent-owned interpreter. bash -n clean; the root-trust watchdog accepts this form and still flags a direct root execution. It cannot be installed from the agent account (ubuntu): the restricted sudo policy deliberately does not grant install. The host's root-capable admin account is the one that runs it.
then optionally systemctl start agent-backup.service to confirm the nightly path still runs.
I also extended check_root_trust.py to flag any root backup step that executes a binary under .hermes/tools, so this cannot regress silently. It reports the current finding (expected) and passes against the proposed copy.
**Status 2026-11-22 — four of the five items are already satisfied on the host; one remains, and it is root-only.**
Verified now:
- `/usr/local/bin/restic` is `root:root`, mode 755.
- The script's `PATH` is `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin` — no `/home/ubuntu/.local/bin`.
- It sources `/etc/agent-backup.env` only; there is no reference to the agent's `.env`.
- The unit's drop-in points `ExecStart` at `/usr/local/sbin/agent-backup`, itself `root:root` 755, so no `daemon-reload` is outstanding.
**Remaining:** the manifest step still runs `"$HERMES_DIR/tools/python-…/bin/python3" -m pip list` as root. That is an agent-writable binary executed by a root unit — the same class of path this issue exists to remove, and the current watchdog did not catch it.
I prepared the fix at `/tmp/agent-backup.proposed` (mirrored at `~/.hermes/pending/agent-backup.proposed`): the manifest's pip inventory is kept but now runs as `ubuntu` via `runuser -u ubuntu --`, so root no longer executes the agent-owned interpreter. `bash -n` clean; the root-trust watchdog accepts this form and still flags a direct root execution. It cannot be installed from the agent account (`ubuntu`): the restricted sudo policy deliberately does not grant `install`. The host's root-capable admin account is the one that runs it.
Run from the host's root-capable admin account:
```
install -o root -g root -m 755 /tmp/agent-backup.proposed /usr/local/sbin/agent-backup
```
then optionally `systemctl start agent-backup.service` to confirm the nightly path still runs.
I also extended `check_root_trust.py` to flag any root backup step that executes a binary under `.hermes/tools`, so this cannot regress silently. It reports the current finding (expected) and passes against the proposed copy.
Installed from the root-capable admin account: /usr/local/sbin/agent-backup is root:root 755, md5 c46ad15cef4414ac225f34549ed1d96a.
The manifest's pip inventory is kept, but it no longer executes the agent-owned interpreter as root: it runs as ubuntu via runuser -u ubuntu --.
Exercised through the unit: systemctl start agent-backup.service → Result=success, snapshot 8c87c888 saved, and manifest.txt still carries the pip (hermes python) section.
check_root_trust.py now prints nothing; it accepts the runuser form and still flags a direct root execution of an agent-owned tool binary.
One related hardening item remains outside this issue's scope: root still opens backup.lock, backup-last.log and the staged SQLite paths inside directories the ubuntu user owns, so a symlink swap there is a root file-write primitive. I will track that separately rather than reopen this one.
**Fixed and verified 2026-11-22.**
- Installed from the root-capable admin account: `/usr/local/sbin/agent-backup` is `root:root 755`, md5 `c46ad15cef4414ac225f34549ed1d96a`.
- The manifest's pip inventory is kept, but it no longer executes the agent-owned interpreter as root: it runs as `ubuntu` via `runuser -u ubuntu --`.
- Exercised through the unit: `systemctl start agent-backup.service` → `Result=success`, snapshot `8c87c888` saved, and `manifest.txt` still carries the `pip (hermes python)` section.
- `check_root_trust.py` now prints nothing; it accepts the `runuser` form and still flags a direct root execution of an agent-owned tool binary.
One related hardening item remains outside this issue's scope: root still opens `backup.lock`, `backup-last.log` and the staged SQLite paths inside directories the `ubuntu` user owns, so a symlink swap there is a root file-write primitive. I will track that separately rather than reopen this one.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Root-only remediation required on the agent host. The nightly backup unit runs root-owned
/usr/local/sbin/agent-backup, but that script still resolvesresticfrom/usr/local/bin/restic(owned byubuntu) and sources/home/ubuntu/.hermes/.envwith/home/ubuntu/.local/binonPATH. An agent-writable binary or env is therefore root code execution through the backup timer.Required root commands:
chown root:root /usr/local/bin/restic/home/ubuntu/.local/binfrom the root script'sPATH/home/ubuntu/.hermes/.envpip listdiagnosticsystemctl daemon-reloadThe restricted sudo policy deliberately does not grant these. The daily watchdog (
82130f968506) alerts if the conditions regress. Until fixed, treat the backup timer as privileged.Status 2026-11-22 — four of the five items are already satisfied on the host; one remains, and it is root-only.
Verified now:
/usr/local/bin/resticisroot:root, mode 755.PATHis/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin— no/home/ubuntu/.local/bin./etc/agent-backup.envonly; there is no reference to the agent's.env.ExecStartat/usr/local/sbin/agent-backup, itselfroot:root755, so nodaemon-reloadis outstanding.Remaining: the manifest step still runs
"$HERMES_DIR/tools/python-…/bin/python3" -m pip listas root. That is an agent-writable binary executed by a root unit — the same class of path this issue exists to remove, and the current watchdog did not catch it.I prepared the fix at
/tmp/agent-backup.proposed(mirrored at~/.hermes/pending/agent-backup.proposed): the manifest's pip inventory is kept but now runs asubuntuviarunuser -u ubuntu --, so root no longer executes the agent-owned interpreter.bash -nclean; the root-trust watchdog accepts this form and still flags a direct root execution. It cannot be installed from the agent account (ubuntu): the restricted sudo policy deliberately does not grantinstall. The host's root-capable admin account is the one that runs it.Run from the host's root-capable admin account:
then optionally
systemctl start agent-backup.serviceto confirm the nightly path still runs.I also extended
check_root_trust.pyto flag any root backup step that executes a binary under.hermes/tools, so this cannot regress silently. It reports the current finding (expected) and passes against the proposed copy.Fixed and verified 2026-11-22.
/usr/local/sbin/agent-backupisroot:root 755, md5c46ad15cef4414ac225f34549ed1d96a.ubuntuviarunuser -u ubuntu --.systemctl start agent-backup.service→Result=success, snapshot8c87c888saved, andmanifest.txtstill carries thepip (hermes python)section.check_root_trust.pynow prints nothing; it accepts therunuserform and still flags a direct root execution of an agent-owned tool binary.One related hardening item remains outside this issue's scope: root still opens
backup.lock,backup-last.logand the staged SQLite paths inside directories theubuntuuser owns, so a symlink swap there is a root file-write primitive. I will track that separately rather than reopen this one.