Ротация secret и leaf certificate, отзыв identity и границы OpenBao
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
| Связь | Endpoint / порт | Протокол и server trust | Client identity и минимальные права | Lifecycle | Проверяемый отказ / доказательство | Статус |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| Клиент → nginx | `https://localhost:8443` | TLS 1.2/1.3; `secrets/pki/public-ca/ca.crt`; SAN `localhost`; hostname verification | Public registration/health, Basic login, Bearer business API; `X-User-Id` не identity | Session 3600 s, максимум 3 активных; logout/replacement/expiry revoke access; leaf 30 d | `make test-security`, `make test-session-expiry`, `scripts/measure-login-dos.ps1 -SourceBudget`; пустой trust store → certificate error; revoked/expired token → 401; login burst → 429 + Retry-After; rehash и dummy hash — unit tests | **PASS** для внешнего TLS/auth/session/rate-limit контракта |
|
||||
| nginx → API replicas | `https://api:8443` | mTLS; service CA + SAN `spiffe://hla-lab7/api`; API доверяет отдельному LB client CA | nginx SAN `spiffe://hla-lab7/lb`; точный URI SAN до auth проверяет `TrustedClientCertificateFilter`; API port не публикуется | Leaf 30 d, local regeneration/restart | `scripts/test-mtls.ps1` обращается к каждой реплике отдельно: no cert и foreign CA отклоняются handshake; trusted cert SAN `.../worker` получает 403; LB cert → health 200; прямой published port отсутствует | **PASS** |
|
||||
| nginx → API replicas | `https://api:8443` | mTLS; service CA + SAN `spiffe://hla-lab7/api`; API доверяет отдельному LB client CA | nginx SAN `spiffe://hla-lab7/lb`; точный URI SAN и deny-list DER SHA-256 до auth проверяет `TrustedClientCertificateFilter`; API port не публикуется | Leaf 30 d, rotation/revocation без rebuild; unreadable deny-list fail-closed | `scripts/test-mtls.ps1` проверяет каждую реплику: no cert и foreign CA отклоняются handshake; trusted cert SAN `.../worker` получает 403; `scripts/test-rotated-leaf.ps1`: старый LB leaf → 403, новый → 200; прямой published port отсутствует | **PASS** |
|
||||
| API → PostgreSQL | `postgres:5432` | TLS `verify-full`; service CA + SAN `DNS:postgres`; plaintext rejected by `pg_hba.conf` | `messenger_api`: runtime CRUD без superuser/DDL/role management | Static stand secret, rotate/reconnect; dynamic credentials remain extension | Wrong CA/hostname fails; DDL/role management denied | **PASS (уровень 3)** |
|
||||
| Worker → PostgreSQL | `postgres:5432` | TLS `verify-full` | `messenger_worker`: jobs/attachments/variants; нет users password/session/membership | Отдельный secret | `SELECT password_hash`, update membership denied; job transitions allowed | **PASS (уровень 3)** |
|
||||
| API → MinIO | `https://minio:9000` | TLS verify-full; service CA + SAN `DNS:minio` | `messenger-api`, policy `messenger-attachments-api`: list разрешённых prefixes, read/delete final objects, write/delete только staging; без admin | Credential рендерит API AppRole; отдельно от root/worker | Anonymous/admin/final-object write denied; staging write succeeds | **PASS** |
|
||||
@@ -33,6 +33,16 @@
|
||||
| Operator → MinIO admin | Не публикуется; bootstrap внутри сети | TLS verify | Root/operator отдельно; API/worker его не получают | Rotate after bootstrap/exposure | API/worker `mc admin info` denied | **PARTIAL:** port закрыт/policy test есть; HTTP и root env у init |
|
||||
| Replication channels | N/A: все stateful services single-node | N/A | N/A | N/A | При добавлении replicas матрица пересматривается | **N/A** |
|
||||
|
||||
### Ротация, отзыв и обновление доверия
|
||||
|
||||
| Контроль | Реализация | Проверка | Статус |
|
||||
| --- | --- | --- | --- |
|
||||
| Leaf rotation без rebuild | `scripts/rotate-pki-leaf.ps1` выпускает новый leaf тем же service CA, архивирует старый комплект и записывает только его DER SHA-256 в `/run/pki/revoked-client-sha256.txt`; image ID не меняется | `scripts/test-rotated-leaf.ps1`: 2 реплики → old 403 / new 200; `scripts/test-mtls.ps1` остаётся PASS | **PASS** |
|
||||
| Отзыв старой identity | `TrustedClientCertificateFilter` сверяет отпечаток client leaf с deny-list при каждом запросе; отсутствие/нечитаемость файла при явной конфигурации отзывает все identity | unit test на revoked fingerprint; runtime probe старого LB leaf → 403 | **PASS** |
|
||||
| Ротация рабочего secret | `scripts/rotate-grafana-admin-password.ps1` меняет пароль через Grafana API, обновляет `.env`, пересоздаёт только контейнер, проверяет old/new и не печатает значения | `evidence/rotation-renewal.txt`: old rejected, new accepted, image unchanged | **PASS** |
|
||||
| Bootstrap trust | Operator init создаёт 3 Shamir shares (порог 2) и root token вне репозитория; `bootstrap-openbao.ps1` создаёт scoped policies/AppRoles/KV и записывает RoleID/SecretID только в `secrets/` | `scripts/test-openbao-policies.ps1`, `scripts/test-openbao-runtime-boundaries.ps1`, `scripts/check-security-lifecycle.ps1` | **PASS** |
|
||||
| Renewal и sealed/expiry | Service token 15 min/max 1 h, Agent auto-auth и template 5 min, `exit_on_retry_failure=false`; sealed OpenBao не снимает уже выданные runtime credentials; fresh startup без rendered file завершается по таймауту | `scripts/test-openbao-rotation-boundaries.ps1`: agents Up, health 200, fail-closed за 2.8 c при лимите 2 c | **PASS** |
|
||||
|
||||
### Пароли, сессии и login DoS
|
||||
|
||||
| Контроль | Реализация | Проверка | Статус |
|
||||
|
||||
Reference in New Issue
Block a user