forked from mtusi2026/mtusi2026lab7
lab7: исправления по независимому ревью
This commit is contained in:
@@ -11,7 +11,8 @@ Default leaf TTL — 1h, максимум PKI role — 1h; host-side `make renew
|
||||
выпускает новые leaf каждые 30 минут и синхронизирует CRL; исследовательский renewal/expiry
|
||||
использует 20s. Cert-auth tokens: 60s, max/explicit max300s. KV freshness у Go
|
||||
приложения — 60s, независимо от срока leaf и token; admission закрывается за1s
|
||||
до ближайшего deadline. Backend KV passwords/SigV4 keys статические и живут до
|
||||
до ближайшего deadline (наблюдаемое закрытие при sealed Bao: 60.5–61.7s с учётом
|
||||
1s cadence watchdog). Backend KV passwords/SigV4 keys статические и живут до
|
||||
явной ротации — это не динамические60s credentials. Session TTL3600s;
|
||||
server хранит только SHA-256 token hash.
|
||||
|
||||
@@ -20,9 +21,9 @@ server хранит только SHA-256 token hash.
|
||||
| Клиент → ingress/LB | `https://localhost:8443`, TLS, Bearer | DNS SANlocalhost; без clientcert. LB заменяет forwarding headers и удаляет X-User-Id | LB leaf; пользовательская session3600s/logout/expiry | `make test test-security`; `public_ca_hostname`, `http_acl_logout_expiry_bounds`, `shared_rate_limit` |
|
||||
| LB → все API-реплики | `api-replica:8080`, native mTLS | LB проверяет SANapi-replica/CA/CRL; Go server требует точный URI`spiffe://mtusi/lb` | Atomic leaf/CRL reload Go; trust changes restart; tickets/cache off | `mtls_and_telemetry_acl`: lb200; absent/wrongCA/wrongURI TLS拒绝; `make test-pki` oldLB revoke/retire |
|
||||
| API/worker/relay → PostgreSQL | `postgres:5432`, native TLS+SCRAM, verify-full | Раздельные messenger_api/worker/relay roles; no superuser/DDL. Worker/relay не читают users/sessions/messages | Статический password в ownKV; connection lifetime30s; credentials change → bounded restart | `database_privileges`: SQLSTATE42501; `make integration-test` actual nativeTLS DB suites |
|
||||
| API/worker → S3 | `https://seaweedfs:8333`, native TLS+SigV4 | API stagingRead/Write, finalRead; worker managed-prefixRead/Write+bucketList; foreign prefixes/buckets403 | Static keys until explicitrotation; role-specific ownKV. No claim of required clientcert on S3HTTP | `s3_prefix_acl`: GET/PUT/DELETE/COPY+fullreadback; `make test-presign test-queue`; workerkeyrotation inPKIstudy |
|
||||
| API/worker → S3 | `https://seaweedfs:8333`, native TLS+SigV4 | API stagingRead/Write, finalRead; worker managed-prefixRead/Write+bucketList; foreign GET/PUT/DELETE/COPY/bucket 403, worker bucket-level LIST returns managed metadata (documented limitation) | Static keys until explicitrotation; role-specific ownKV. No claim of required clientcert on S3HTTP | `s3_prefix_acl`: GET/PUT/DELETE/COPY+fullreadback; `make test-presign test-queue`; workerkeyrotation inPKIstudy |
|
||||
| Relay/API outbox/worker → broker | `broker:5671`, native mTLS/EXTERNAL-only | API commits DBoutbox, relay publishes onlyattachments.jobs; worker consumes onlyattachment.process.v1. First DNS SAN principal, anchored broker ACL | Leaf+broker user permissions; nativeprincipal revoke distinct from serial CRL | `broker_external_acl`: positive relaypublish/workerconsume; opposite/topology/wrongDNS403, no-cert/wrongCA TLS rejection |
|
||||
| API/worker/relay → Collector | `otel-collector:4318`, mTLS gateway → loopback14318 | Exact CNapi/worker/relay and POST/v1/{traces,metrics,logs}; unknownCN/verb/path denied | Gateway loads CA/CRL atstartup; revoke/rollover reloads and drains | `mtls_and_telemetry_acl`: api200, lb403, missing/wrongCA rejection; full `make test-observability` |
|
||||
| API/worker/relay → Collector | `otel-collector:4318`, mTLS gateway → loopback14318 | Exact CNapi/worker/relay and POST/v1/{traces,metrics,logs}; unknownCN/verb/path denied | Gateway loads CA/CRL atstartup; revoke/rollover restarts gateways; app pools are not claimed drained | `mtls_and_telemetry_acl`: api200, lb403, missing/wrongCA rejection; full `make test-observability` |
|
||||
| Collector → telemetry backends | Loki`https://loki:3100`; TempoGRPCS`tempo:4437` | CollectorCN onlylogpush/OTLP; no dataquery. Native hops127.0.0.1:13100/14317 | Distinct collectorleaf; fixedsingletenantfake | `mtls_and_telemetry_acl` collectorquery403; actual traces/logs in `make test-observability` |
|
||||
| Grafana → data sources | Prometheus9090/Loki3100/Tempo3200, HTTPS/mTLS | GrafanaCN query allowlist; push/delete/admin/reload forbidden; CA+hostname verified | Ownleaf in secureJsonData rendered outsideGit; rotation rerenders/restarts | `mtls_and_telemetry_acl` forbiddenwrite403; Grafana/dataSources/TraceQL correlation intelemetrygate |
|
||||
| API/worker/relay → OpenBao | `https://openbao:8200`, verifiedTLS+cert-auth | Authrole checks CN+URI; ownsecret/data/<role> and ownpki/issue/<role> only; no root/defaultpolicy | Token60s/max300s; cert reauth; KVfresh60s; independentleafdeadline | `bao_api_policy`: ownKV200, foreignKV/issuer/policyadmin403; `make test-pki` renewal/expiry/recovery |
|
||||
@@ -63,7 +64,9 @@ by apps, `observability` by telemetry, `edge` by their TLS owners.
|
||||
4. `make pki-renew ROLE=api CERT_TTL=1h` and `renew-watch` use owncert-auth. Token
|
||||
renewal cannot renew theleaf. Missing/expired/revoked material fails closed.
|
||||
5. `securityctl.py revoke ROLE --serial SERIAL`: publishes issuer-signed CRLs,
|
||||
updates BaoauthCRLs, thenreloads/drains nativeCRL-consumingHAProxy gateways.
|
||||
updates BaoauthCRLs, then restarts native CRL-consuming HAProxy gateways.
|
||||
Existing application TLS/DB/S3/broker pools are not claimed to be drained;
|
||||
only fresh/resumption attempts are measured.
|
||||
Go verifies currentCRLs onfreshconnections. Principalcompromise also requires
|
||||
backendcredential/token/authrole disable; RabbitMQ EXTERNAL user/connection
|
||||
revocation is separate and not falsely represented by CRLfileupdate.
|
||||
|
||||
Reference in New Issue
Block a user