forked from mtusi2026/mtusi2026lab7
Перенесён минимум lab6 (API без изменений), добавлена защита на границах доверия: - внешний HTTPS; обязательный mTLS LB -> API с allowlist identity и отзывом по serial; - TLS на всех связях: PostgreSQL verify-full, MinIO HTTPS, RabbitMQ AMQPS mTLS (EXTERNAL), Valkey TLS + ACL, Collector и хранилища телеметрии через mTLS с отдельными CA; - OpenBao в server mode: cert auth, токены 15 мин, политики только на свой путь; - роли БД, S3-политики и права брокера по принципу минимальных прав; - Argon2id с замером, rehash, общий лимит входа, бюджет защиты от login DoS; - hardening всех контейнеров, scan образов с разбором, модель угроз, матрица доверия; - отрицательные тесты: TLS-аудит (135 проверок), ACL, ротации, sealed OpenBao.
140 lines
18 KiB
Plaintext
140 lines
18 KiB
Plaintext
Container mtusi-lab7-worker-run-dcda01946f3d Creating
|
|
Container mtusi-lab7-worker-run-dcda01946f3d Created
|
|
PASS A LB -> api-1:8080 no client cert expect=reject rejected: closed without response
|
|
PASS A LB -> api-1:8080 foreign CA (claims lb identity) expect=reject rejected: closed without response
|
|
PASS A LB -> api-1:8080 same CA, identity intruder expect=reject rejected: closed without response
|
|
PASS A LB -> api-1:8080 same CA, identity worker expect=reject rejected: closed without response
|
|
PASS A LB -> api-1:8080 same CA, identity api expect=reject rejected: closed without response
|
|
PASS A LB -> api-1:8080 lb.client.messenger expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS A LB -> api-1:8080 plaintext client expect=reject server answered b''
|
|
PASS A LB -> api-2:8080 no client cert expect=reject rejected: closed without response
|
|
PASS A LB -> api-2:8080 foreign CA (claims lb identity) expect=reject rejected: closed without response
|
|
PASS A LB -> api-2:8080 same CA, identity intruder expect=reject rejected: closed without response
|
|
PASS A LB -> api-2:8080 same CA, identity worker expect=reject rejected: closed without response
|
|
PASS A LB -> api-2:8080 same CA, identity api expect=reject rejected: closed without response
|
|
PASS A LB -> api-2:8080 lb.client.messenger expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS A LB -> api-2:8080 plaintext client expect=reject server answered b''
|
|
PASS I client -> nginx:8443 trusted CA, hostname nginx expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS I client -> nginx:8443 untrusted CA in client trust store expect=reject rejected: server cert verify failed: unable to get local issuer certificate
|
|
PASS I client -> nginx:8443 wrong hostname (evil.example) expect=reject rejected: server cert verify failed: Hostname mismatch, certificate is not valid for 'evil.example'.
|
|
PASS I client -> nginx:8443 plaintext client expect=reject server answered b'HTTP/1.1 400 Bad Request'
|
|
PASS B svc -> postgres:5432 plaintext (sslmode=disable) expect=reject OperationalError: connection failed: connection to server at "172.22.0.9", port 5432 failed: FATAL: pg_hba.co
|
|
PASS B svc -> postgres:5432 foreign CA as root (verify-full) expect=reject OperationalError: connection failed: connection to server at "172.22.0.9", port 5432 failed: SSL error: certif
|
|
PASS B svc -> postgres:5432 hostname mismatch (IP, verify-full) expect=reject connection failed: connection to server at "172.22.0.9", port 5432 failed: server certificate for "postgres" (
|
|
PASS B svc -> postgres:5432 TLS verify-full + app_api password expect=accept connected
|
|
PASS B svc -> postgres:5432 wrong password expect=reject connection failed: connection to server at "172.22.0.9", port 5432 failed: FATAL: password authentication fai
|
|
PASS B app_worker privileges SELECT count(*) FROM users expect=deny InsufficientPrivilege
|
|
PASS B app_worker privileges SELECT count(*) FROM messages expect=deny InsufficientPrivilege
|
|
PASS B app_worker privileges SELECT count(*) FROM sessions expect=deny InsufficientPrivilege
|
|
PASS B app_worker privileges DELETE FROM attachments WHERE false expect=deny InsufficientPrivilege
|
|
PASS B app_worker privileges SELECT count(*) FROM attachment_jobs expect=allow executed
|
|
PASS B app_api privileges SELECT count(*) FROM users expect=allow executed
|
|
PASS B app_api privileges CREATE TABLE audit_probe (x int) expect=deny InsufficientPrivilege
|
|
PASS B app_api privileges ALTER ROLE app_worker PASSWORD 'x' expect=deny InsufficientPrivilege
|
|
PASS B app_api privileges SELECT count(*) FROM schema_migrations expect=deny InsufficientPrivilege
|
|
PASS C svc -> minio:9000 foreign CA as trust anchor expect=reject SSLError
|
|
PASS C svc -> minio:9000 plaintext http:// expect=reject ConnectionClosedError
|
|
PASS C worker S3 rights PUT attachments/* expect=allow ok
|
|
PASS C worker S3 rights GET attachments/* expect=deny AccessDenied
|
|
PASS C worker S3 rights DELETE attachments/* expect=deny AccessDenied
|
|
PASS C worker S3 rights PUT staging/* expect=deny AccessDenied
|
|
PASS C worker S3 rights LIST bucket expect=deny AccessDenied
|
|
PASS C worker S3 rights PUT outside prefixes expect=deny AccessDenied
|
|
PASS C api S3 rights PUT staging/* expect=allow ok
|
|
PASS C api S3 rights PUT attachments/* (only worker publishes) expect=deny AccessDenied
|
|
PASS C api S3 rights GET attachments/* expect=allow ok
|
|
PASS C api S3 rights LIST bucket (reconciler) expect=allow ok
|
|
PASS C api S3 rights create bucket expect=deny AccessDenied
|
|
PASS C api S3 rights cleanup audit objects expect=allow ok
|
|
PASS D svc -> rabbitmq:5672 plaintext client expect=reject connection failed: ConnectionRefusedError
|
|
PASS D svc -> rabbitmq:5671 no client cert expect=reject AMQPConnectionError Server communication error: SSLError(1, '[SSL: TLSV13_ALERT_
|
|
PASS D svc -> rabbitmq:5671 foreign CA (claims worker name) expect=reject AMQPConnectionError Server communication error: SSLError(1, '[SSL: TLSV1_ALERT_U
|
|
PASS D svc -> rabbitmq:5671 same CA, unknown identity intruder expect=reject ProbableAuthenticationError ACCESS_REFUSED - Login was refused using authentication mech
|
|
PASS D svc -> rabbitmq:5671 same CA, identity lb expect=reject ProbableAuthenticationError ACCESS_REFUSED - Login was refused using authentication mech
|
|
PASS D api AMQP rights publish to exchange attachments expect=allow ok
|
|
PASS D api AMQP rights consume attachments.process expect=deny ChannelAccessRefused ACCESS_REFUSED - read access to queue 'attachments.process' in vhost '
|
|
PASS D api AMQP rights declare a queue (configure) expect=deny ChannelAccessRefused ACCESS_REFUSED - configure access to queue 'audit-probe' in vhost 'mes
|
|
PASS D api AMQP rights publish via default exchange expect=deny ChannelAccessRefused ACCESS_REFUSED - write access to exchange 'amq.default' in vhost 'mess
|
|
PASS D worker AMQP rights consume attachments.process expect=allow ok
|
|
PASS D worker AMQP rights publish to exchange attachments expect=deny ChannelAccessRefused ACCESS_REFUSED - write access to exchange 'attachments' in vhost 'mess
|
|
PASS D worker AMQP rights declare a queue (configure) expect=deny ChannelAccessRefused ACCESS_REFUSED - configure access to queue 'audit-probe' in vhost 'mes
|
|
PASS E svc -> otel-collector:4318 no client cert expect=reject rejected: after handshake: TLSV13_ALERT_CERTIFICATE_REQUIRED
|
|
PASS E svc -> otel-collector:4318 foreign CA expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS E svc -> otel-collector:4318 root CA identity lb (not ingest CA) expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS E svc -> otel-collector:4318 root CA identity api (not ingest CA) expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS E svc -> otel-collector:4318 telemetry CA (not ingest CA) expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS E svc -> otel-collector:4318 ingest CA api.otel expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS E svc -> otel-collector:4318 ingest CA worker.otel expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS F -> prometheus:9090 no client cert expect=reject rejected: after handshake: TLSV13_ALERT_CERTIFICATE_REQUIRED
|
|
PASS F -> prometheus:9090 foreign CA expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> prometheus:9090 root CA identity api expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> prometheus:9090 ingest CA (apps cannot bypass collector) expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> prometheus:9090 telemetry CA collector.out expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS F -> prometheus:9090 telemetry CA grafana.out expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS F -> prometheus:9090 telemetry CA operator expect=accept accepted: HTTP/1.1 200 OK
|
|
PASS F -> loki:3100 no client cert expect=reject rejected: after handshake: TLSV13_ALERT_CERTIFICATE_REQUIRED
|
|
PASS F -> loki:3100 foreign CA expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> loki:3100 root CA identity api expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> loki:3100 ingest CA (apps cannot bypass collector) expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> loki:3100 telemetry CA collector.out expect=accept accepted: HTTP/1.1 503 Service Unavailable
|
|
PASS F -> loki:3100 telemetry CA grafana.out expect=accept accepted: HTTP/1.1 503 Service Unavailable
|
|
PASS F -> loki:3100 telemetry CA operator expect=accept accepted: HTTP/1.1 503 Service Unavailable
|
|
PASS F -> tempo:3200 no client cert expect=reject rejected: after handshake: TLSV13_ALERT_CERTIFICATE_REQUIRED
|
|
PASS F -> tempo:3200 foreign CA expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> tempo:3200 root CA identity api expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> tempo:3200 ingest CA (apps cannot bypass collector) expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F -> tempo:3200 telemetry CA collector.out expect=accept accepted: HTTP/1.1 503 Service Unavailable
|
|
PASS F -> tempo:3200 telemetry CA grafana.out expect=accept accepted: HTTP/1.1 503 Service Unavailable
|
|
PASS F -> tempo:3200 telemetry CA operator expect=accept accepted: HTTP/1.1 503 Service Unavailable
|
|
PASS F collector -> tempo:4317 (gRPC) no client cert expect=reject rejected: after handshake: TLSV13_ALERT_CERTIFICATE_REQUIRED
|
|
PASS F collector -> tempo:4317 (gRPC) ingest CA expect=reject rejected: after handshake: TLSV1_ALERT_UNKNOWN_CA
|
|
PASS F collector -> tempo:4317 (gRPC) telemetry CA collector.out expect=accept accepted: |