ЛР7: доказательства проверок чистого clone

This commit is contained in:
Ivan Melnikov
2026-12-06 19:29:04 +03:00
parent 0def11cc24
commit 8169241da5
+48
View File
@@ -0,0 +1,48 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
python3 tests/smoke.py --base-url "https://localhost:8547" --ca-file "/Users/ivanmuller/Desktop/oh_my_life/highload/lab7/.clean-clone.lab7/.local-secrets/pki/edge-ca.crt"
PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.
python3 tests/security.py --base-url "https://localhost:8547" --ca-file "/Users/ivanmuller/Desktop/oh_my_life/highload/lab7/.clean-clone.lab7/.local-secrets/pki/edge-ca.crt"
PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening.
python3 student-tests/tls-matrix.py --base-url "https://localhost:8547" --ca-file "/Users/ivanmuller/Desktop/oh_my_life/highload/lab7/.clean-clone.lab7/.local-secrets/pki/edge-ca.crt"
PASS: client -> LB: trusted CA + hostname localhost -> 200
PASS: client -> LB: empty trust store -> certificate verification error
PASS: client -> LB: trusted CA but wrong hostname -> verification error
PASS: LB -> API: client CN lab7-lb -> 200
PASS: LB -> API: no client certificate -> rejected
PASS: LB -> API: certificate from edge CA (not the service CA) -> rejected
PASS: LB -> API: trusted CA but CN lab7-rogue -> rejected
PASS: LB -> API: revoked certificate serial -> rejected by CRL
PASS: API -> broker: allowed identity + ACL -> PONG
PASS: worker -> broker: distinct allowed identity -> PONG
PASS: rogue CA-signed identity -> broker gateway rejected
PASS: certificate from another CA -> broker gateway rejected
PASS: API -> S3: PUT staging/<id> allowed
PASS: API -> S3: PUT attachments/<id> denied
PASS: worker -> S3: GET staging/<id> allowed
PASS: worker -> S3: DELETE attachments/<id> denied
PASS: rogue CA-signed identity -> S3 gateway rejected
PASS: API -> Collector: allowed identity can POST /v1/logs
PASS: rogue CA-signed identity -> OTLP gateway 403
PASS: no client certificate -> OTLP gateway rejected
PASS: Grafana -> telemetry backends: allowed identity -> 200
PASS: API identity -> telemetry gateway 403
PASS: service CA verifies OpenBao server certificate
PASS: wrong CA -> OpenBao server verification fails
PASS: 24 TLS/mTLS/identity cases
{"cases": [{"case": "client -> LB: trusted CA + hostname localhost -> 200", "result": "PASS"}, {"case": "client -> LB: empty trust store -> certificate verification error", "result": "PASS"}, {"case": "client -> LB: trusted CA but wrong hostname -> verification error", "result": "PASS"}, {"case": "LB -> API: client CN lab7-lb -> 200", "result": "PASS"}, {"case": "LB -> API: no client certificate -> rejected", "result": "PASS"}, {"case": "LB -> API: certificate from edge CA (not the service CA) -> rejected", "result": "PASS"}, {"case": "LB -> API: trusted CA but CN lab7-rogue -> rejected", "result": "PASS"}, {"case": "LB -> API: revoked certificate serial -> rejected by CRL", "result": "PASS"}, {"case": "API -> broker: allowed identity + ACL -> PONG", "result": "PASS"}, {"case": "worker -> broker: distinct allowed identity -> PONG", "result": "PASS"}, {"case": "rogue CA-signed identity -> broker gateway rejected", "result": "PASS"}, {"case": "certificate from another CA -> broker gateway rejected", "result": "PASS"}, {"case": "API -> S3: PUT staging/<id> allowed", "result": "PASS"}, {"case": "API -> S3: PUT attachments/<id> denied", "result": "PASS"}, {"case": "worker -> S3: GET staging/<id> allowed", "result": "PASS"}, {"case": "worker -> S3: DELETE attachments/<id> denied", "result": "PASS"}, {"case": "rogue CA-signed identity -> S3 gateway rejected", "result": "PASS"}, {"case": "API -> Collector: allowed identity can POST /v1/logs", "result": "PASS"}, {"case": "rogue CA-signed identity -> OTLP gateway 403", "result": "PASS"}, {"case": "no client certificate -> OTLP gateway rejected", "result": "PASS"}, {"case": "Grafana -> telemetry backends: allowed identity -> 200", "result": "PASS"}, {"case": "API identity -> telemetry gateway 403", "result": "PASS"}, {"case": "service CA verifies OpenBao server certificate", "result": "PASS"}, {"case": "wrong CA -> OpenBao server verification fails", "result": "PASS"}], "passed": 24}
./scripts/run-openbao-policy.sh
PASS: OpenBao health: initialized, unsealed, file-backed stand
PASS: API and worker authenticate with distinct AppRole identities
PASS: API policy: read secret/data/lab7/api -> allowed
PASS: API policy: read secret/data/lab7/worker -> 403
PASS: API policy: write secret/data/lab7/api -> 403
PASS: API policy: policy administration -> 403
PASS: worker policy: read secret/data/lab7/worker -> allowed
PASS: worker policy: read secret/data/lab7/api -> 403
PASS: AppRole token: policies=['api'], ttl=1200s, renewable=true, no default policy
PASS: API policy: token creation -> 403
PASS: 10 OpenBao policy cases
{"cases": [{"case": "OpenBao health: initialized, unsealed, file-backed stand", "result": "PASS"}, {"case": "API and worker authenticate with distinct AppRole identities", "result": "PASS"}, {"case": "API policy: read secret/data/lab7/api -> allowed", "result": "PASS"}, {"case": "API policy: read secret/data/lab7/worker -> 403", "result": "PASS"}, {"case": "API policy: write secret/data/lab7/api -> 403", "result": "PASS"}, {"case": "API policy: policy administration -> 403", "result": "PASS"}, {"case": "worker policy: read secret/data/lab7/worker -> allowed", "result": "PASS"}, {"case": "worker policy: read secret/data/lab7/api -> 403", "result": "PASS"}, {"case": "AppRole token: policies=['api'], ttl=1200s, renewable=true, no default policy", "result": "PASS"}, {"case": "API policy: token creation -> 403", "result": "PASS"}], "passed": 10}