Security & HIPAA
Counslr SOS handles emergency routing for telehealth sessions. This page defines the data classification, HIPAA compliance model, and security controls.
Data Classification
| Data | Classification | Storage | HIPAA Applicability |
|---|---|---|---|
| PSAP numbers and addresses | Public | Aurora (PostGIS) | No — public records |
| Session metadata (IDs, timestamps) | Internal | Aurora | No — opaque identifiers only |
| Crisis audit trail (who, when, what) | Internal | Aurora | No — non-PHI metadata |
| Patient location during SOS | PHI | In-memory only | Yes — transient, discarded after lookup |
| Crisis event logs | PHI | TrueVault | Yes — requires BAA |
| API keys, JWT secrets | Confidential | Secrets Manager + Aurora | No — operational data |
Location Data Handling
Patient location is the most sensitive data. The on-demand capture model ensures location is never at rest:
- Patient grants geolocation permission at session start (SDK holds permission, does not transmit)
- Counselor triggers SOS → server pushes
location_requestto patient via WebSocket - Patient SDK captures GPS coordinates → submits via
POST /v1/platforms/{platformId}/sessions/{sessionId}/sos/location(TLS) - Lambda holds location in process memory only
- Lambda queries PostGIS for nearest PSAPs using the coordinates
- PSAP results returned to both SDKs
- Location variable goes out of scope and is garbage collected
- Crisis event logged to TrueVault records the event but not the coordinates
At no point is the patient’s latitude/longitude written to Aurora, DynamoDB, CloudWatch, or any persistent store.
Encryption
At Rest
| Store | Encryption | Key Management |
|---|---|---|
| Aurora Serverless v2 | AES-256 | AWS KMS (customer-managed, auto-rotation) |
| TrueVault | AES-256 | TrueVault managed |
| Secrets Manager | AES-256 | AWS KMS |
| DynamoDB | AES-256 | AWS owned key |
In Transit
- TLS 1.2+ on all REST API endpoints
- WSS (WebSocket Secure) for real-time communication
- TLS for Aurora connections (
sslmode=require) - TLS for TrueVault API calls
Access Controls
- JWT tokens scoped per platform, per session, per role (patient/counselor)
- API keys follow Stripe model: publishable (client-safe) and secret (server-only)
- Role-based access: patient (location submission), counselor (SOS trigger), platform server (session management)
- Session expiry prevents stale location data
Audit Logging
- Crisis audit trail (Aurora): Tamper-evident HMAC-SHA256 hash chain for all crisis lifecycle events. Contains non-PHI metadata only
- Crisis event logs (TrueVault): PHI-adjacent crisis details stored under BAA. Never includes location coordinates
- Application logs (CloudWatch): Structured JSON via
log/slog. No PHI in any log statement - AWS CloudTrail: All API-level AWS access
- API Gateway access logs: All HTTP requests
Network Isolation
- Aurora deployed in private subnets (no public internet access)
- Lambda functions run inside VPC
- Security groups restrict traffic: Lambda → Aurora TCP 5432 only
- Lambda outbound: HTTPS to TrueVault and API Gateway management endpoints
Business Associate Agreements
| Vendor | Service | BAA Required | Reason |
|---|---|---|---|
| AWS | Aurora, Lambda, API Gateway, Secrets Manager | Yes | Infrastructure hosting |
| TrueVault | Crisis event log storage | Yes | Stores PHI (crisis logs) |