Private Data Store Access
Problem
Data stores (Cosmos DB event stores, PostgreSQL projections, Azure SQL, Redis, Storage accounts, Key Vault) hold the platform’s most sensitive assets. Two failure modes must be prevented by design, not policy:
- Public data-plane exposure — a misconfigured firewall rule or public IP puts the store on the internet.
- Shared credentials — connection strings, keys, or SAS tokens copied across services / repos / environments.
Every data store in ION must be reachable only from inside the ION network and only by an identity that has been explicitly granted access.
Solution
Combine network exposure control with Managed Identity + data-plane RBAC. Network exposure control is executed in two phases per ADR-0025; the identity + RBAC layer is unchanged across phases.
1. Network exposure control
Phase 1 — current V3 posture (ZPA-enforced ACLs).
- Store keeps
public network access = enabledbut the resource firewall / NSG must not contain0.0.0.0/0(ADR-0025). - Allowlist is limited to:
- ZPA App Connector public IPs for the target environment
(sourced from shared
tf-modules/data sourceszpa1/zpa2). - Azure service tags required for control-plane /
resource-to-resource flow (e.g.
AzureCloud.switzerlandnorth,AppService,AzureActiveDirectory). - Known Azure IP ranges where service tags are insufficient (Switzerland North function-app outbound IPs, APIM public IP).
- ZPA App Connector public IPs for the target environment
(sourced from shared
- VNet integration, service endpoints, and Private Link are strongly recommended wherever feasible and are enabled opportunistically as a stepping stone to Phase 2.
Phase 2 — target end-state (private endpoints).
- Every data store deployed with a private endpoint in the ION spoke VNet (Network Security, ADR-0016).
public network access = disabledat the resource level.- Private DNS zones resolve the store’s FQDN to the private endpoint IP.
- Engineers reach the resulting private estate through ZPA (not eliminated by Phase 2 — required by it).
- Access from outside the VNet blocked at the network layer, not just by ACL.
2. Managed Identity + data-plane RBAC (identity)
- Callers authenticate via User-Assigned Managed Identity (ADR-0013).
- Data-plane roles (Cosmos DB Data Contributor / Reader, PostgreSQL AAD roles, Key Vault Secrets User) granted per-service, per-store.
- No connection strings, no keys, no shared secrets in configuration.
- AAD auth on the data plane — token acquired from IMDS, presented to the store.
3. Least-privilege scoping
- Grant the narrowest role that satisfies the caller’s use — Reader vs. Contributor, per container / database / secret vault.
- Service producer UAMI: Contributor on
events+snapshotscontainers only. - Projection consumer UAMI: Reader on the same.
- Break-glass admin access via Entra PIM, audited.
4. Encryption
- At rest: CMK where data classification requires; MMK otherwise.
- In transit: TLS 1.2+ enforced.
- Both are prerequisites, not a substitute for network + identity isolation.
When to use
- Every ION data store, in every environment above Alpha.
- Alpha may relax the network layer further for cost; Beta / Prod must at minimum meet the Phase 1 posture today and move to Phase 2 per the ADR-0025 rollout plan.
Consequences
Positive
- Data plane never reachable from the internet.
- No secrets to rotate, leak, or copy.
- Access audit-able per identity, per action.
- Consistent posture across store technologies.
Negative
- Networking + private DNS is a fixed cost.
- Every new caller requires an IaC PR to grant a role.
- Local dev cannot reach the store; test doubles required.
Failure modes
0.0.0.0/0left in the resource firewall — nullifies the entire pattern in both phases. Enforced by sharedtf-modules/review.- Per-team hard-coded ZPA / APIM IPs instead of the shared data sources — IPs drift when the App Connector cluster is redeployed.
- Shared UAMI across services — one compromise blast-radius spans multiple services.
Contributorat account level granted for “convenience” — least-privilege violated.- Missing private DNS zone entry (Phase 2) — service resolves to public IP, degrades silently.
References
references/Design Pattern- Private Data Store Access.md- ADRs: 0013 — Service-to-service auth model, 0016 — Hub-spoke networking and private access, 0025 — Remote access via ZPA.
- Capabilities: Identity, Network Security, Data Protection.
- Related: Auth / AuthZ.
Applied in
- All Cosmos event stores (Incident, Investigation, Ticket, Customer Collaboration)
- PostgreSQL reporting store
- Azure SQL projections
- Redis caches
- Key Vault (secrets, CMK keys)
- Storage accounts (audit blobs, cold archive)