security: document restricted sudo policy and root-owned backup path

This commit is contained in:
inference-admin committed 2026-11-20 00:25:31 +00:00
1 parent e2879dbdc2
commit 5d1c2a5158
2 files changed
+27 -2

No files matched your search

+3 -2
View File
@@ -21,8 +21,9 @@ app) that all three draw on — the agent host runs no gateway of its own.
### Who is who (do not conflate them) ### Who is who (do not conflate them)
- **Inferencebot** is the **steward** and the fleet administrator: full Cloudron - **Inferencebot** is the **steward** and the fleet administrator: full Cloudron
token, gateway master key, member-data plumbing. It is NOT a member-facing chat token, gateway master key, member-data plumbing. Root access is restricted to
persona. the docs/backup service commands in `maintenance/host-access.md`; it is NOT a
member-facing chat persona.
- **infrastructure-bot** is a **lower-privileged** infrastructure agent. Per its - **infrastructure-bot** is a **lower-privileged** infrastructure agent. Per its
own SOUL it has **no sudo, no Cloudron admin token, and no member data**; when a own SOUL it has **no sudo, no Cloudron admin token, and no member data**; when a
task needs more privilege it hands up to the steward rather than working around task needs more privilege it hands up to the steward rather than working around
+24
View File
@@ -0,0 +1,24 @@
# Agent host root access
The steward agent (`ubuntu`) does **not** have passwordless root for arbitrary commands. The cloud-init `ubuntu ALL=(ALL) NOPASSWD:ALL` rule was removed on 2026-11-20.
## What `ubuntu` may run without a password
`/etc/sudoers.d/90-inferencebot-restricted` allows only:
- `systemctl start|stop|restart docs-deploy-poll.service`
- `systemctl start|restart agent-backup.service`
- `systemctl start|restart agent-backup.timer`
- `journalctl -u docs-deploy-poll.service ...`
Everything else — package installs, user management, file writes under `/etc`, arbitrary shells — requires operator credentials or a new root-owned helper. Do not re-add `NOPASSWD:ALL` to make a task convenient.
## Root-owned execution paths
- The docs publisher is split: `/usr/local/sbin/docs-poll` and `/usr/local/sbin/docs-publish` are root-owned; the build runs as `docsbuild` without credentials.
- 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`.
## 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.