docs: hardening Hermes 2026-06-15

This commit is contained in:
bolbol 2026-06-15 19:42:55 +00:00
parent 4933f772ce
commit d2c2ed5a9f
1 changed files with 35 additions and 0 deletions

View File

@ -92,3 +92,38 @@ chown -R 1026:100 hermes-<inst>/data
# $D tag 882e06b1ad23 nousresearch/hermes-agent:latest
$D compose up -d --force-recreate hermes-agent-<inst>
```
---
## Hardening 2026-06-15 (suite MAJ)
Audit post-MAJ + corrections. **Config STAGED, sans recreate** : les blocs 3,4,6,7,9
prennent effet au prochain `docker compose up -d --force-recreate` (agent par agent).
Les conteneurs ont continue de tourner sur l ancienne config pendant l operation.
| Bloc | Action | Ou / commit |
|------|--------|-------------|
| 1 | Compose par instance + .env instances neutralises (.disabled) | mv local ; rename API Gitea hermes-nyora/perso (tt absent du repo) |
| 2 | `docker image prune -f` + note maintenance | ports-registry |
| 3 | Pin images par digest (agent sha256:474477ad..., workspace sha256:2d2ba9aa...) | hermes-platform 3f0db0a |
| 4 | Secrets Telegram (x3) + SESSION_SECRET (x3, perso ajoute) sortis du compose vers .env | hermes-platform 3f0db0a |
| 5 | ports-registry : agents 8650/8660/8670 = internes uniquement (non publies) | nas-runbooks 4933f77 |
| 6 | Healthcheck sur les 3 workspaces (curl http://localhost:3000/) | hermes-platform 3f0db0a |
| 7 | mem_limit 2G agents / 1G workspaces (deploy.resources.limits) | hermes-platform 3f0db0a |
| 8 | scripts/cleanup-backups.sh (garde 2 derniers jeux de data.bak) | hermes-platform 5949a70 |
| 9 | Cle NVIDIA dediee Nyora (etait identique a TT) corrigee dans .env | .env gitignore, pas de commit |
### Application des changements (a faire ensuite, avec accord)
```
cd /volume1/docker/hermes-platform
/usr/local/bin/docker compose up -d --force-recreate hermes-agent-tt # puis nyora, perso
# verifier : stat -c %u:%g data = 1026:100 ; health = healthy ; UI 200
```
### Pieges rencontres (hardening)
- `.env` est root:root, non writable par Best0f, et pas de sudo : l editer via un
conteneur jetable root : `docker run --rm -v /volume1/docker/hermes-platform:/wd alpine sh -c sed -i ... /wd/.env`.
- `git` absent du NAS (host + containers) : tous les commits via API Gitea (basic auth bolbol).
- Les compose par instance reutilisent les memes container_name -> collision (origine de b7f6e6ac8bbf_). Neutralises.
- Le prune supprime l ancienne image agent 882e06b1ad23 : rollback image = re-pull, pas retag local.