Complete lab7 grade 4 implementation
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+20
-16
@@ -1,19 +1,23 @@
|
||||
# Модель угроз — заполнить
|
||||
# Модель угроз
|
||||
|
||||
## Активы и акторы
|
||||
Активы: password hashes, Bearer sessions, messages and attachments, PKI keys, OpenBao
|
||||
tokens and telemetry. Actors: chat member, outsider, a client with a certificate from the
|
||||
local CA, compromised worker and operator. Public boundary is HTTPS nginx; each compose
|
||||
service and OpenBao are separate trust boundaries. The exact links are in the trust matrix.
|
||||
|
||||
TODO: пользовательские credentials/сессии, сообщения/вложения, service identities, CA/secrets, telemetry. Акторы: участник чата, посторонний пользователь, внешний клиент, скомпрометированный сервис, оператор. Опишите доступ атакующего и границы учебного стенда.
|
||||
| Threat / path | Invariant and control | Reproducible negative check | Residual risk |
|
||||
| --- | --- | --- | --- |
|
||||
| outsider reads another chat or attachment | membership check before metadata/content/S3 stream | smoke ACL cases and `tests/attachments_negative.py` | authorised member may copy content |
|
||||
| forged `X-User-Id` changes principal | principal comes only from hashed Bearer session | request with forged header stays denied | stolen Bearer token works until expiry/logout |
|
||||
| password database leak enables cheap cracking | Argon2id (19 MiB, t=2, p=1), salt/params in PHC hash | inspect new `password_hash` prefix `$argon2id$` | parameters should be raised on stronger hardware |
|
||||
| login flood exhausts Argon2 CPU | Redis-wide 10/min/user budget, 429 + Retry-After | 11 bad logins across both replicas → 429 | distributed source/usernames can still consume capacity |
|
||||
| a trusted non-LB certificate calls API | API TLS requires client cert and filter allows only DNS SAN `lb` | no cert, foreign CA, and `api-otel` cert fail | active LB credential compromise |
|
||||
| compromised worker reads API credentials | separate Bao policy, RabbitMQ/S3 identities and ACLs | worker token reading `kv/.../api` is deny | worker's own scoped assets remain exposed |
|
||||
| telemetry leaks content/token | structured logs only, session keys hashed, no bodies | inspect Collector/Loki records after smoke | third-party agent upgrade needs review |
|
||||
| malicious image consumes worker resources | pixel, CPU/RAM and job-time limits; non-root worker | oversized/malformed upload negative tests | valid expensive images occupy bounded worker capacity |
|
||||
|
||||
## Границы доверия
|
||||
|
||||
TODO: схема и ссылка на заполненную contracts/trust-matrix.md; публичные/внутренние интерфейсы, процессы, секреты и их выдача.
|
||||
|
||||
| Угроза и конкретный путь | Нарушаемый инвариант | Контроль | Отрицательный тест | Остаточное ограничение |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| TODO | TODO | TODO | TODO | TODO |
|
||||
|
||||
На 4 минимум 6 конкретных угроз. Не заменяйте сценарии словами «SQL injection», «безопасный Docker», «mTLS включён» без пути и проверки.
|
||||
|
||||
## Lifecycle и инциденты
|
||||
|
||||
TODO: bootstrap, expiry/renewal, revoke/rotation, компрометация identity, sealed OpenBao и восстановление. Указать владельца CA/unseal и способ защиты bootstrap credentials. Сопоставить scan findings с реальной применимостью и исправлением/остаточным риском.
|
||||
Lifecycle: CA key and unseal shares stay with the operator and are never committed. AppRole
|
||||
tokens renew/re-auth before 15-minute expiry. A sealed Bao makes new secret reads fail closed;
|
||||
already-open connections continue only until their bounded credential/session lifetime. Scan
|
||||
findings are triaged by reachability, fixed image version and runtime exposure rather than CVE
|
||||
count alone; `scripts/scan.sh` records the command and reviewed findings without secrets.
|
||||
|
||||
Reference in New Issue
Block a user