ЛР 7: mTLS, OpenBao и проверка компрометации worker
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
{"concurrency":1,"runs":25,"p50_ms":91,"p95_ms":110,"p99_ms":208,"elapsed_ms":2404,"cpu_ms":1817,"max_rss_mib":111}
|
||||
{"concurrency":2,"runs":50,"p50_ms":91,"p95_ms":136,"p99_ms":152,"elapsed_ms":2504,"cpu_ms":3543,"max_rss_mib":111}
|
||||
@@ -0,0 +1,5 @@
|
||||
PASS outsider: metadata, bytes and reuse of foreign attachment denied
|
||||
PASS expired and logged-out sessions rejected
|
||||
PASS successful scrypt login rehashes to Argon2id
|
||||
PASS ingress rejects an incorrect hostname
|
||||
PASS shared login budget {"codes": {"401": 26, "429": 38}, "requests": 64, "concurrency": 4, "seconds": 0.93, "401_p50_ms": 101.2, "401_p95_ms": 170.7}
|
||||
@@ -0,0 +1,5 @@
|
||||
OpenBao: seal OK
|
||||
PASS sealed OpenBao, both replicas expired and ingress returned 503 after 44.7s
|
||||
OpenBao unsealed
|
||||
OpenBao: unseal OK
|
||||
PASS both replicas recovered after 48.7s from seal
|
||||
@@ -0,0 +1,4 @@
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
@@ -0,0 +1,3 @@
|
||||
python3 student-tests/alternate_failover.py --replica 1
|
||||
stopped /messenger-lab7-api-1 (5bdde5a69ba7)
|
||||
PASS api-1: 122 successful writes, 0 failures, recovery 3.171s
|
||||
@@ -0,0 +1,5 @@
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "secrets/tls/service-ca/ca.crt"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 122, "failed_attempts": 0, "first_recovery_seconds": 3.275}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
stopped /messenger-lab7-api-2 (789f75a2d4d6)
|
||||
@@ -0,0 +1,4 @@
|
||||
PASS /messenger-lab7-api-1 non-root, read-only, tmpfs, no capabilities, CPU/RAM limits, no published ports
|
||||
PASS /messenger-lab7-api-2 non-root, read-only, tmpfs, no capabilities, CPU/RAM limits, no published ports
|
||||
PASS /messenger-lab7-worker-1 non-root, read-only, tmpfs, no capabilities, CPU/RAM limits, no published ports
|
||||
PASS /messenger-lab7-worker-2 non-root, read-only, tmpfs, no capabilities, CPU/RAM limits, no published ports
|
||||
@@ -0,0 +1,20 @@
|
||||
PASS api allow
|
||||
PASS api deny
|
||||
PASS api tls-deny
|
||||
PASS api tls-deny
|
||||
PASS api tls-deny
|
||||
PASS rabbitmq allow
|
||||
PASS rabbitmq deny
|
||||
PASS rabbitmq tls-deny
|
||||
PASS rabbitmq tls-deny
|
||||
PASS otel-collector allow
|
||||
PASS otel-collector deny
|
||||
PASS otel-collector tls-deny
|
||||
PASS otel-collector tls-deny
|
||||
PASS otel-collector tls-deny
|
||||
PASS prometheus allow
|
||||
PASS prometheus tls-deny
|
||||
PASS loki allow
|
||||
PASS loki tls-deny
|
||||
PASS tempo allow
|
||||
PASS tempo tls-deny
|
||||
@@ -0,0 +1,20 @@
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "https://localhost:8443" --ca-file "secrets/tls/service-ca/ca.crt"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
Container StartedAt before → after (volumes preserved)
|
||||
lb 2026-11-13T01:15:11.257385463Z -> 2026-11-13T01:20:10.547301092Z
|
||||
api 2026-11-13T01:15:50.908917222Z -> 2026-11-13T01:20:04.090599786Z
|
||||
api 2026-11-13T01:15:57.172061993Z -> 2026-11-13T01:20:04.636345266Z
|
||||
worker 2026-11-13T01:18:50.289037895Z -> 2026-11-13T01:20:04.088323125Z
|
||||
worker 2026-11-13T01:18:50.641455405Z -> 2026-11-13T01:20:04.571768822Z
|
||||
reconciler 2026-11-13T01:15:50.899418247Z -> 2026-11-13T01:20:04.079800985Z
|
||||
postgres 2026-11-13T00:55:15.413332805Z -> 2026-11-13T01:19:36.476215277Z
|
||||
s3 2026-11-13T01:17:38.625759439Z -> 2026-11-13T01:19:41.274651051Z
|
||||
rabbitmq 2026-11-13T01:17:38.618089156Z -> 2026-11-13T01:19:37.531654708Z
|
||||
otel-collector 2026-11-13T01:17:38.608424136Z -> 2026-11-13T01:19:36.638172339Z
|
||||
collector 2026-11-13T01:17:40.256329957Z -> 2026-11-13T01:19:42.679961375Z
|
||||
prometheus 2026-11-13T00:55:15.184395701Z -> 2026-11-13T01:19:36.261421478Z
|
||||
loki 2026-11-13T01:16:17.793235632Z -> 2026-11-13T01:19:36.783945489Z
|
||||
tempo 2026-11-13T00:55:13.64505991Z -> 2026-11-13T01:19:36.429086463Z
|
||||
grafana 2026-11-13T00:59:58.501910653Z -> 2026-11-13T01:19:42.904075477Z
|
||||
openbao 2026-11-13T00:57:09.723084442Z -> 2026-11-13T01:19:37.422278275Z
|
||||
@@ -0,0 +1,2 @@
|
||||
promtool test rules /etc/prometheus/tests/alerts.test.yml
|
||||
SUCCESS
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 tests/security.py --base-url "https://localhost:8443" --ca-file "secrets/tls/service-ca/ca.crt"
|
||||
PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening.
|
||||
@@ -0,0 +1,5 @@
|
||||
Trivy 0.76.2, messenger-lab7-app:dev, linux/arm64, 2026-11-13
|
||||
npm audit --omit=dev: 0 vulnerabilities
|
||||
messenger-lab7-app:dev (alpine 3.24.3): 1 findings
|
||||
CVE-2026-4738 zlib MEDIUM 1.3.2-r1 1.4-r0
|
||||
Node.js: 0 findings
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "secrets/tls/service-ca/ca.crt"
|
||||
PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,8 @@
|
||||
PASS 1 trace 39bd5ebcd3c5fb3c8289d0fd05f0d332: server span POST /api/v1/chats/{chat_id}/messages (3 SQL), лог request_id=3f633f88-ab37-44df-ad6a-18616b504fb6
|
||||
PASS 2 404 request_id=33b40a88-0173-4364-828c-18d8d3810b53 → лог → trace 01e968716000024fe5e64908a92f9059
|
||||
PASS 3 trace f68deeca64cc65ace6a2821019036d0b: upload → publish → process (39 spans), лог job.ready в том же trace
|
||||
PASS 4 trace d172c7ac2a5c5b7b8f9b8a3970d1b8d4: publish#1 → process#1 (retry, S3 timeout) → publish#2 → process#2 (ready)
|
||||
PASS 5 метрики: 14 обязательных есть; 119 labels без id/URL; 10 шаблонов http_route
|
||||
PASS 6 секреты/контент не найдены в 8 ответах Tempo/Loki и во всём Loki за 30 мин
|
||||
PASS 7 dashboard «Messenger lab6»: 35 панелей, 57/60 запросов с данными (пусто: ['Потери telemetry (элементов/с)'])
|
||||
PASS: сигналы lab6 (traces, logs, metrics, связь через очередь, retry, отсутствие секретов, dashboard)
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"queued": 6,
|
||||
"done": 6,
|
||||
"variants": 18,
|
||||
"attempts": 6,
|
||||
"lost": 0,
|
||||
"sha256_verified": 6,
|
||||
"seconds_from_rotation_to_verification": [
|
||||
84.48,
|
||||
84.6,
|
||||
84.64,
|
||||
84.67,
|
||||
84.7,
|
||||
84.74
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
PASS operator seeds staging/private and reads private
|
||||
PASS OpenBao own read; cross-role read, write and policy update denied; TTL 45s
|
||||
PASS PostgreSQL TLS; job select/update allowed; users, messages, delete and DDL denied
|
||||
PASS S3 staging read; variants/originals write; private read/write/copy and bucket list denied
|
||||
PASS RabbitMQ worker consumes attachments.process; publish and queue creation denied
|
||||
PASS 6 заданий queued и подтверждены брокером до ротации
|
||||
OpenBao: revoke-worker OK
|
||||
PostgreSQL: SCRAM credentials настроены
|
||||
OpenBao: replace-worker OK
|
||||
Worker identity и credentials заменены
|
||||
PASS old leaf denied by OpenBao, AMQP and OTLP; old DB password and S3 key denied
|
||||
PASS {"queued": 6, "done": 6, "variants": 18, "attempts": 6, "lost": 0, "sha256_verified": 6, "seconds_from_rotation_to_verification": [84.48, 84.6, 84.64, 84.67, 84.7, 84.74]}
|
||||
Reference in New Issue
Block a user