Files
mtusi2026lab7/evidence/lab7/app-security.json
T

248 lines
8.4 KiB
JSON

{
"captured_at": "2026-11-26T15:56:33Z",
"checks": [
{
"actual": "$argon2id$v=19$m=32768,t=2,p=1",
"category": "password_storage",
"description": "Stored password uses Argon2id PHC with m>=19456 KiB, t>=2, p>=1",
"evidence": {
"m": 32768,
"p": 1,
"password_hash_prefix": "$argon2id$v=19$m=32768,t=2,p=1",
"t": 2
},
"expected": "argon2id v=19, m>=19456, t>=2, p>=1",
"id": "APP-1-ARGON2-PHC",
"passed": true
},
{
"actual": "live_login_median_ms=53.5",
"category": "password_storage",
"description": "Empirical Argon2id wall-clock benchmark captured on live stand",
"evidence": {
"in_container_benchmark": {
"configs": [
{
"iterations": 2,
"label": "floor_19MiB_t2_p1",
"max_ms": 26.16,
"median_ms": 24.23,
"memory_kib": 19456,
"parallelism": 1,
"samples_ms": [
23.35,
23.68,
24.23,
26.16
]
},
{
"iterations": 2,
"label": "default_32MiB_t2_p1",
"max_ms": 44.32,
"median_ms": 43.04,
"memory_kib": 32768,
"parallelism": 1,
"samples_ms": [
42.55,
42.56,
43.04,
44.32
]
},
{
"iterations": 3,
"label": "heavy_64MiB_t3_p1",
"max_ms": 132.56,
"median_ms": 124.82,
"memory_kib": 65536,
"parallelism": 1,
"samples_ms": [
123.68,
124.35,
124.82,
132.56
]
}
],
"rss_mib": 104.6
},
"live_https_login_ms": [
53.5,
51.5,
55.6
]
},
"expected": "benchmark completed",
"id": "APP-2-ARGON2-BENCHMARK",
"passed": true
},
{
"actual": "password_rehashed=True, after_prefix=$argon2id$v=19$m=32768,t=2,p=1",
"category": "password_storage",
"description": "Login with weak Argon2id (m=4096,t=1) transparently upgrades DB hash to active params",
"expected": "upgraded to m>=32768, t>=2",
"id": "APP-3-REHASH-WEAK-ARGON2",
"passed": true
},
{
"actual": "password_rehashed=True, after_prefix=$argon2id$v=19$m=32768,t=2,p=1",
"category": "password_storage",
"description": "Login with legacy $scrypt$ hash transparently upgrades DB hash to Argon2id",
"expected": "upgraded from $scrypt$ to $argon2id$",
"id": "APP-4-REHASH-LEGACY-SCRYPT",
"passed": true
},
{
"actual": "[{\"method\": \"GET\", \"path\": \"/api/v1/chats/dc2ef497-c1f9-4b75-9761-cc96091af29d\", \"status\": 404}, {\"method\": \"GET\", \"path\": \"/api/v1/chats/dc2ef497-c1f9-4b75-9761-cc96091af29d/messages\", \"status\": 404}, {\"method\": \"POST\", \"path\": \"/api/v1/chats/dc2ef497-c1f9-4b75-9761-cc96091af29d/messages\", \"status\": 404}, {\"method\": \"GET\", \"path\": \"/api/v1/attachments/74239f9b-637d-4c40-99fa-1ab60cdcfb12\", \"status\": 404}, {\"method\": \"GET\", \"path\": \"/api/v1/attachments/74239f9b-637d-4c40-99fa-1ab60cdcfb12/content\", \"status\": 404}, {\"method\": \"GET\", \"path\": \"/api/v1/attachments/74239f9b-637d-4c40-99fa-1ab60cdcfb12/content\", \"status\": 404}, {\"method\": \"POST\", \"path\": \"/api/v1/chats/b76d74fe-3696-4551-988c-3f875468471f/messages\", \"status\": 404}, {\"method\": \"POST\", \"path\": \"/api/v1/chats/d81f2a3c-3496-4d99-8669-76ea7028aa9e/messages\", \"status\": 404}]",
"category": "acl",
"description": "Outsider chat/messages/attachment metadata & content and cross-chat attach return 403/404",
"expected": "all 8 probes 403/404",
"id": "APP-5-ACL-NEGATIVE",
"passed": true
},
{
"actual": "no_auth=401, forged_me=40f25363-a650-440f-8a6d-1bc0d6cfc72f",
"category": "acl",
"description": "Forged X-User-Id rejected without Bearer (401) and ignored with Bearer",
"expected": "no_auth=401, forged_me=40f25363-a650-440f-8a6d-1bc0d6cfc72f",
"id": "APP-6-FORGED-X-USER-ID",
"passed": true
},
{
"actual": "key_exists=True, all_sha256=True, raw_token_in_redis=False, count=18",
"category": "session_security",
"description": "Redis stores ONLY session:sha256:* keys with zero raw Bearer tokens in keys or values",
"expected": "key_exists=True, all_sha256=True, raw_token_in_redis=False",
"id": "APP-7-HASHED-REDIS-SESSIONS",
"passed": true
},
{
"actual": "logout=204, after_logout=401, expired=401",
"category": "session_security",
"description": "Logout immediately revokes session (204->401) and expired session returns 401",
"expected": "logout=204, after_logout=401, expired=401",
"id": "APP-8-LOGOUT-AND-EXPIRY",
"passed": true
},
{
"actual": "status=413 code=payload_too_large",
"category": "request_limits",
"description": "Oversized JSON body (>64 KiB) rejected with 413 payload_too_large",
"expected": "HTTP 413 payload_too_large",
"id": "APP-9-JSON-BODY-LIMIT",
"passed": true
},
{
"actual": "bytes=413 (10489856B), pixels=413 (7000x7000, 6034B)",
"category": "request_limits",
"description": "Oversized binary (>10 MiB) and pixel bomb (>40M px) rejected with 413",
"expected": "bytes=413, pixels=413",
"id": "APP-10-UPLOAD-SIZE-AND-PIXELS",
"passed": true
},
{
"actual": "instances=['rep-281d8876bc1e', 'rep-e06c496c3b80'], first_429=10, retry_after=60, code=rate_limited, opaque=True",
"category": "rate_limit",
"description": "Shared Redis login rate limit triggers 429+Retry-After across >=2 opaque API replicas",
"expected": "instances>=2, first_429<=11, Retry-After>=1, code=rate_limited, opaque X-Instance-Id",
"id": "APP-11-SHARED-RATE-LIMIT",
"passed": true
},
{
"actual": "login_codes={401: 36}, auth_p95_ms=516.0, oom=False, restarts_unchanged=True",
"category": "dos_protection",
"description": "Parallel login burst stays bounded under Argon2id semaphore with 0 OOMKill and unaffected /users/me",
"evidence": {
"auth_latencies_ms": [
380.4,
406.6,
469.0,
471.8,
474.4,
490.5,
496.0,
500.9,
516.0,
643.9
],
"login_codes": {
"401": 36
},
"shed_retry_ok": true
},
"expected": "0 OOMKill, 0 restarts, all auth=200, valid 401/429+Retry-After",
"id": "APP-12-LOGIN-DOS-BUDGET",
"passed": true
},
{
"actual": "leaks=0, loki_checked=True (213 logs), tempo_checked=True (3 traces)",
"category": "redaction",
"description": "Zero secret/token/password/Argon2/body leaks in HTTP errors, Loki logs, and Tempo traces",
"evidence": {
"leaks": []
},
"expected": "0 leaks, loki_checked=True",
"id": "APP-13-TELEMETRY-AND-ERROR-REDACTION",
"passed": true
}
],
"failed_count": 0,
"failed_ids": [],
"passed": true,
"passed_count": 13,
"started_at": "2026-11-26T15:56:21Z",
"suite": "lab7-app-security",
"summary": {
"argon2_benchmark": {
"configs": [
{
"iterations": 2,
"label": "floor_19MiB_t2_p1",
"max_ms": 26.16,
"median_ms": 24.23,
"memory_kib": 19456,
"parallelism": 1,
"samples_ms": [
23.35,
23.68,
24.23,
26.16
]
},
{
"iterations": 2,
"label": "default_32MiB_t2_p1",
"max_ms": 44.32,
"median_ms": 43.04,
"memory_kib": 32768,
"parallelism": 1,
"samples_ms": [
42.55,
42.56,
43.04,
44.32
]
},
{
"iterations": 3,
"label": "heavy_64MiB_t3_p1",
"max_ms": 132.56,
"median_ms": 124.82,
"memory_kib": 65536,
"parallelism": 1,
"samples_ms": [
123.68,
124.35,
124.82,
132.56
]
}
],
"rss_mib": 104.6
},
"base_url": "https://localhost:8443"
},
"total": 13
}