forked from mtusi2026/mtusi2026lab7
feat: audit the whole trust matrix in one command and complete the threat model
- make security_audit runs the existing negative checks per trust-matrix row plus an ingress TLS probe and prints one summary - close the threat model TODOs and stale references - re-take the coverage exclusion evidence on the lab 7 stand Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
# Кэш карточки чата
|
||||
|
||||
- Команды: `make test_isolated KEEP_TEST_DB=1` (ключи временной базы), затем `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8443 cache-check --require-test-keys`
|
||||
- Дата: 2026-12-02; `make test_isolated` 03:39:12–03:41:50 UTC, `cache-check` 03:41:52–03:42:18 UTC, код выхода `cache-check` 0
|
||||
- Код выхода `make test_isolated` 2 и только по одной причине: `test_exclusion_evidence_exists` (этого файла и соседних исключений лабы 7 ещё не было: `evidence/` в новую лабу не переносится); публичный `make test` в нём — код 0, набор — 1 failed, 227 passed, 7 skipped. Снятие файла этой команды требует её прогона, поэтому поменять порядок нельзя
|
||||
- Commit: `bb20855` (ветка `feat/lab7-final`); рабочее дерево — правки последнего шага, часть 2 (аудит матрицы, документы, файлы `evidence/`), код образа = `HEAD`
|
||||
- Стенд: проект compose `mtusi-lab7`, две реплики за HAProxy по mTLS, внешний HTTPS `https://localhost:8443` с CA стенда, телеметрия включена, собран `make run_docker` из рабочего дерева; кэш Valkey — по TLS пользователем ACL `api`; пользователи и чат синтетические
|
||||
- Спеки: `chat-cache`, «Чтение из кэша», «Срок записи», «Временная база» (исключения сверки покрытия: по HTTP ответ из кэша не отличить от ответа из PostgreSQL)
|
||||
- Перед прогоном Valkey перезапускался (возврат контроля аудита, `evidence/security/security-audit.md`): ключи рабочей базы — только созданные после него
|
||||
|
||||
Итог: на 50 чтений карточки через LB — одно чтение таблицы `chats` (первое, ключ перед этим удалён), +49 попаданий и +1 промах Valkey; срок ключа не больше настроенного (3600 с), чтения его не продлевают; ключи рабочей и временной базы — под разными префиксами (1 и 171).
|
||||
|
||||
```text
|
||||
users alice_… (creator) and bob_… (reader), chat d80c50f6-79f8-45df-997f-8c2a9fe209cf
|
||||
key messenger:v1:messenger:chat:d80c50f6-79f8-45df-997f-8c2a9fe209cf
|
||||
right after 201: EXISTS 1, TTL 3600 s (configured [cache] chat_ttl_seconds 3600 s in the replica); value keys ['created_at', 'id', 'member_ids', 'title'], member_ids in creation order: yes
|
||||
DEL key: the first read is a miss; waiting 11 s
|
||||
50 × GET /api/v1/chats/{id} by the reader through LB: 50 equal to the creation response; by replica 169929a788d4880a 25, a207ff38444c7f43 25
|
||||
after 11 s: reads of table chats (seq_scan + idx_scan) +1, keyspace_hits +49, keyspace_misses +1
|
||||
TTL 3588 s, then 10 more reads, TTL 3588 s: reads do not extend the key
|
||||
keys messenger:v1:messenger:chat:*: 1
|
||||
keys messenger:v1:test_messenger:chat:*: 171
|
||||
PASS: one read of chats, the rest from Valkey; TTL is bounded; temporary database: 171 keys under its own prefix
|
||||
```
|
||||
Reference in New Issue
Block a user