Skip to main content

Interop Service — Security Model

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 03 platform-services · 02 DDD


1. Authentication Layers

LayerMechanism
External FHIR clientsBearer JWT (Keycloak JWKS); SMART on FHIR scopes
External HL7 v2 MLLPPer-connector: client certificate (mutual TLS) or shared secret
Internal service callsJWT service account; bypasses ABAC patient-level check
Bulk export file downloadSigned URLs (MinIO presigned) with TTL

2. RBAC Matrix

RoleScopesCapabilities
interop:fhir:readSMART user/*.readFHIR resource reads through gateway
interop:fhir:writeSMART user/*.writeFHIR resource creates/updates
interop:adminsvc:interop:adminConnector management, routing rules, message log
interop:bulksvc:interop:bulk-exportInitiate bulk $export
interop:importsvc:interop:bulk-importInitiate bulk $import (admin only)
platform:adminAllPlatform-wide

3. ABAC at FHIR Boundary

All FHIR read/write operations for patient-linked resources:

  1. Resolve tenantId from JWT.
  2. Call access-policy-service ABAC check with resourceType, patientId, actorId, tenantId.
  3. On denial → OperationOutcome 403 with security issue.
  4. Internal service calls (from other platform services) skip patient ABAC; use X-Internal-Service header + validated service JWT.

4. HL7 v2 Security

ControlDetail
MLLP transportTLS 1.2+ required for all production connectors
Client certificatesPreferred auth for external LIS/HIS; signed by enterprise CA
Shared secretsFallback; rotated on security events
IP allowlistingPer-connector source IP ranges allowed at Kong/firewall layer

5. Sensitive Data Controls

DataControl
Connector auth_configAES-256 column-level encryption at application layer; key in KMS
HL7 raw payloadsPHI; stored encrypted at rest; access logged
Bulk export NDJSON filesPresigned URLs with 1-hour TTL; files deleted after 24 hours
Message logPHI; RLS enforced; accessed only by admin roles

6. Audit Events

EventWhenFields
interop.fhir.readFHIR resource readactorId, resourceType, resourceId, patientId?, tenantId
interop.fhir.writeFHIR resource create/updateactorId, resourceType, operation, tenantId
interop.hl7v2.receivedHL7 message ingestedconnectorId, messageType, tenantId
interop.bulk_export.started$export initiatedactorId, groupId, tenantId
interop.connector.activatedConnector enabledactorId, connectorId, tenantId

7. GDPR / Data Residency

  • FHIR gateway routes data to owning services; no PHI stored in the gateway itself.
  • HL7 message log contains PHI; subject to retention policies per jurisdiction.
  • Afghanistan tenants: data residency enforcement prevents routing to non-AFG services.
  • Bulk export files stored in MinIO within the tenant's designated region.

8. AFG-Core Profile Enforcement

All FHIR writes from external partners are validated against the AFG-Core profile extensions (patient national ID, facility codes, encounter classification). Profile violations return 422 OperationOutcome.