Files

29 lines
1.8 KiB
Markdown

# Host connector: what a target host needs
- An unprivileged account (`archie`) whose `authorized_keys` holds the public
half of the machine credential the connector is accepted with.
- `df`, `du`, `find`, `sort` and `head` (GNU coreutils and findutils).
- For lookups to see files the account can't read, run `install.sh` as root.
It installs two helpers under `/usr/local/libexec/archie` and a sudo rule
allowing exactly those, and then set `"helpers": true` on the host in the
connector's `hosts` setting. The helpers only read, check every argument,
and run fixed commands: sudo can't safely allow `du` or `find` themselves,
since `find` can delete and execute.
- The host's public key, as `ssh-keyscan` prints it, in the `hosts` setting.
- The roots lookups may look under, as `paths` in the `hosts` setting (for
example `["/tmp", "/var/tmp"]`). Lookups run no guards and may read as root,
so any path outside them is refused.
- For actions, the helpers read two root-owned allow-lists, created empty by
`install.sh`: `/etc/archie/delete-roots` (one directory per line; `delete_files`
as root only reaches directories that resolve into one) and `/etc/archie/timers`
(one unit name per line; the only timers `enable_timer` and `disable_timer`
can touch). They repeat the connector's own settings, so a compromised
connector can't widen them. Timers need `"helpers": true`.
- Without helpers, `delete_files` runs as the account, which can delete only
what it owns or has group access to. `set_config_key` always runs as the
account: the file must be a plain file it owns, and the directory writable.
- Per-host settings in `hosts`: `environment` (declared on every action's
target), `disposable` (temp and cache directories inside `paths`; deleting
there is recoverable), `timers` (unit names) and `config_files` (absolute
paths).