Skip to main content

Analytics Service — Security Model

Status: populated Owner: Platform Engineering + Security Last updated: 2026-04-18 Companion: 13 Security

1. Authentication

No public-facing API. All callers are internal cluster services.

  • Service mesh mTLS enforced on port 3030 (Istio/Linkerd PeerAuthentication: STRICT).
  • AuthorizationPolicy permits ingress only from: admin-dashboard, customer-portal namespaces.
  • No Kong route → no JWT validation required.

2. Authorization

EndpointPermitted callers
/v1/internal/analytics/summaryadmin-dashboard
/v1/internal/analytics/operators/:id/performanceadmin-dashboard
/v1/internal/analytics/accounts/:id/usagecustomer-portal, admin-dashboard
/v1/internal/analytics/throughputadmin-dashboard
/v1/internal/analytics/delivery-breakdownadmin-dashboard

Account-scoped endpoint: /analytics/accounts/:id/usage — service validates that the accountId in the path matches the X-Account-Id header (set by customer-portal from authenticated session). Admin-dashboard can query any account.

3. Data Sensitivity

Data classPresent in analytics?Notes
MSISDN (destination phone)NoNever stored; DLR events carry messageId, not to
Message bodyNoNot included in billing or DLR events
Cost / billing amountsYesAggregated only; individual transaction not exposed
Account identityYesaccountId in per-account queries
Operator identityYesoperatorId in per-operator queries

No PII in any analytics table. GDPR erasure request has no effect on analytics tables (no personal data stored).

4. Encryption

ClassMechanism
In-flightmTLS (service mesh)
At rest (PG)Transparent disk encryption
SecretsVault-injected env vars at pod start

5. Threat Model

ThreatControl
Unauthorized account data accessaccountId scope validated in GetAccountUsageUseCase; caller cannot query another account
Data inflation via event replayprocessed_events dedup table prevents double-counting
Backfill abuse (replay old events to inflate metrics)Only ops team can seek durable consumer; requires cluster access
PG injection via date paramsParameterized queries (Prisma); date params strictly parsed as ISO 8601
ClickHouse exfiltrationClickHouse not network-accessible from outside cluster; accessed only by anlyt-etl job