Explore documentation

Security Overview

How Esus protects health data, layer by layer

Security Layers in Esus

Each request passes through several independent checks. This section explains each one and what it does not cover.

LayerWhat Esus does
AuthenticationConsole JWT sessions (15 min access token + refresh token), API keys (X-API-Key), and SMART on FHIR tokens
Tenant isolationEach organization’s data is isolated with PostgreSQL Row-Level Security; a token from one organization cannot see another’s data
AuthorizationPermissions (Resource.action) plus resource policies (ABAC); patient consent is checked for PHI
Audit loggingPHI access and denied requests are recorded in a hash-chained audit log
EncryptionSelected PHI fields (names, contact details, identifiers, clinical free text) are encrypted with AES-256-GCM before storage
IntegrityResource versions, optional If-Match (412 on conflict), and _history
ResourceUse in Esus
ConsentAn active consent with scope treatment unlocks PHI access for non-admin users
ProvenanceRecords where data came from. Your app creates it; Esus does not generate it automatically
CapabilityStatementGET /fhir/metadata describes what the server supports

Esus does not expose the audit log as a FHIR AuditEvent resource. Query it through the admin API: see Audit Logging.

Headers

Authenticate each request with one of these headers:

Authorization: Bearer <token>
X-API-Key: <clientId>:<secret>

For FHIR request bodies, use Content-Type: application/fhir+json; application/json is also accepted.

Transport Protections

  • HTTPS only. The API sends Strict-Transport-Security with preload.
  • Console session cookies are httpOnly, Secure, and SameSite=Lax, and use the __Host- prefix.
  • A request that changes data with a session cookie also needs X-Requested-With: XMLHttpRequest, Authorization, or X-API-Key. This protects against CSRF.
  • Rate limits are applied by IP. Login endpoints have stricter limits. When exceeded, the API returns 429 with Retry-After.

Threat Model

ThreatMitigationLimitation
Unauthorized accessAuthentication, RLS, ABACA valid credential grants everything its permissions allow: protect it
Database leakField encryption + HMAC indexesNot every column is encrypted (for example, codes and numeric values)
Log tamperingKeyed HMAC chain over each rowTampering is detected, not prevented
Access without consentConsent check on PHIDoes not apply to admins, API keys, or emergency override