security: root-only backup credentials, internal-only key feed, corrected cadence

This commit is contained in:
inference-admin committed 2026-11-19 23:41:16 +00:00
1 parent d106f7cf01
commit 5ad233c612
3 files changed
+22 -14

No files matched your search

+9 -4
View File
@@ -87,10 +87,15 @@ having failed.
### Other mechanics
- Weekly `restic check` on Sundays (repo metadata); full data check monthly.
- The passphrase (`RESTIC_PASSWORD`) lives in `~/.hermes/.env` **and** the co-op
Vault. A backup whose key exists only on the backed-up box is not a backup.
- S3 credentials come from `SWB_S3_ACCESS_KEY` / `SWB_S3_SECRET_KEY` (mapped to
`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` in the script).
- Backup credentials (`RESTIC_PASSWORD`, `RESTIC_REPOSITORY`,
`SWB_S3_ACCESS_KEY`, `SWB_S3_SECRET_KEY`) live in **root-only
`/etc/agent-backup.env`** (0600) and in the co-op Vault — never in the
steward agent's `~/.hermes/.env`. The systemd timer runs as root; the agent
can run the backup but cannot read or delete its credentials.
- **Append-only is not configured.** The Swiss Backup S3 bucket has no object
lock / immutability policy enabled, so stolen S3 keys can still delete
snapshots. This remains an open item; the root-only split only reduces who
holds them.
## 2. Cloudron app backup
+12 -9
View File
@@ -34,15 +34,18 @@ exposure window is bounded by how fast misuse would show.
## What is in place instead (2026-11-05)
1. **Access logging on the route**: every fetch logs a WARNING line
`librechat key feed served: N member key(s) to <ip> (ua=…)`. Count only —
never key material, never member emails (the portal's log redactor strips
emails anyway).
2. **Daily-digest watch** (cron job 95e5b8fece86, §7 anomaly list): the
sandbox polls ~every 10 min (~144 serves/day expected). The digest counts
`librechat key feed served` lines and flags (a) a rate far above that
cadence, or (b) any 401 burst on the route — either is a suspected token
misuse and becomes a decision item.
1. **Internal-network restriction**: `/admin/librechat/keys` refuses any
request whose last `X-Forwarded-For` hop is a public address (`403 Internal
network only`). A stolen sync token used from the internet no longer looks
like the sandbox.
2. **Access logging on the route**: every fetch logs a WARNING line
`librechat key feed served: N member key(s) to <ip>`. Count and client
address only — never key material, never member emails.
3. **Daily-digest watch** (cron job 95e5b8fece86, §7 anomaly list): the
sandbox polls **every minute (~1,440/day) by design**; the old ~144/day
baseline was stale. The digest flags (a) a rate far above ~1/min, (b) any
401/ERROR burst, or (c) any `REFUSED for non-internal address` line —
either is suspected token misuse and becomes a decision item.
## What a real fix looks like (if ever needed)
+1 -1
View File
@@ -75,7 +75,7 @@ needed to restore are inside the thing being restored.
the *secret* must be in hand before the window — get it from the Infomaniak console
and store it with the passphrase, off-box.
- [x] The **restic** passphrase is safe: `~/.hermes/scripts/backup.sh` documents that
`RESTIC_PASSWORD` lives in the agent host's `.env` **and** the co-op Vault. The agent
`RESTIC_PASSWORD` lives in root-only `/etc/agent-backup.env` **and** the co-op Vault. The agent
host is not being migrated, so the agent-side backup stays recoverable. (The Vault,
however, is an app on the box being migrated — so the Vault copy alone is not
off-box until it is exported.)