Skip to main content

Facility Service — Security Model

Status: populated Owner: TBD Last updated: 2026-04-17 Companion: 13 Security/Compliance/Tenancy · 14 Extended Compliance

1. Authentication

FlowMechanism
Edge clientsJWT from identity-service validated against JWKS
Service-to-servicemTLS + service JWT with svc: prefix scopes
Platform adminJWT with platform:admin scope

2. Authorization

All write operations authorised via POST /internal/access/evaluate on access-policy (no local evaluation).

2.1 RBAC baseline

RoleReadWrite hierarchyWrite locationWrite bed statusImport/export
tenant.viewer
tenant.facility_user✓ (own location)
tenant.facility_admin✓ (tenant scope)
tenant.admin
platform.admin✓ (all tenants)

2.2 ABAC

AttributeSourceUsed by
tenantIdJWT tidEvery query via RLS
subjectNodeIdsaccess-policy contextLimit bed operations to user's node subtree
purposeOfUseheader X-PurposeAudit
moduleKeyehr.facilityLicensing Service gate

2.3 Scopes

ScopePurpose
facility:readAll GET endpoints
facility:writeNon-admin mutations
facility:adminProfile default, location deactivate force, import/export
internal:any-service/internal/providers/:id/context

3. Encryption

LayerTechClass
At restPostgres TDE (AES-256)N/A (no PHI here)
In transitTLS 1.3N/A
FieldNone — no PII/PHI stored

Facility data is organisational. If a deployment stores PII (addresses, phone) the contact_info JSON column is classified internal.

4. Audit Events

EventWhen
facility.audit.node.createdCreate node
facility.audit.node.deactivatedDeactivate
facility.audit.profile.updatedAny profile change
facility.audit.location.force_deactivatedforce=true override on deactivate
facility.audit.bed.status_overrideAdmin-forced bed status
facility.audit.import.completedBulk import
facility.audit.export.downloadedSnapshot export

All audit events forwarded to audit-service with full actor / target / reason metadata.

5. GDPR Participation

facility-service stores no patient PII under normal operation. It participates in the GDPR erasure saga only if a tenant's own admin contact info was retained — it acknowledges gdpr.subject_request.received.v1 with no_data unless such rows exist, in which case it nulls the contact JSON fields.

6. Data Residency

  • Data is stored in the tenant's residency region (country). See 14 Extended Compliance §Residency.
  • AFG tenants: data in region af-central-1.
  • UAE tenants: data in region ae-central-1.
  • Cross-tenant federation (shared MoPH region nodes) defers to M3+ with explicit data-sharing agreements.

7. Rate Limits & Abuse

AbuseControl
Bulk import DoSMax 10,000 nodes per dry-run; rate limit 1/hour/tenant
Cycle-probing brute force on edgesRate limit 200 write rps/tenant
Admin context lookup floodsPer-service 5,000 rps budget; circuit breaker on Redis