Security

Security at MedHook

Healthcare data is sacred. Security is not an afterthought — it is built into every layer of the MedHook architecture from day one.

Encryption at rest

All adapter credentials (EHR connection strings, API keys, SFTP passwords) are encrypted using AES-256-GCM before being stored in PostgreSQL.

Key derivation uses PBKDF2 with 100,000 iterations. Each credential is encrypted with a unique salt and IV. The master encryption key is supplied via environment variable and never stored in the database.

Authentication

Engine operators sign in with a password plus a one-time code (emailed or from an authenticator app), or with Google Workspace under your 2-Step Verification policy. Sessions end after 4 hours. Integrations use named API clients with a role and an expiry, whose tokens last 2 hours.

medhook.dev sign-in always uses two factors: a password (hashed with scrypt) plus a single-use 6-digit code emailed to you, or a Google Workspace account governed by your organization’s 2-Step Verification policy. TOTP authenticator apps can be added as a further factor. Sessions use secure, HTTP-only cookies. License keys are stored only as SHA-256 hashes — the plaintext is never retained.

Audit logging

Every change to workflows, adapter profiles, mappings, settings and users, every sign-in, and every message read or replay is written to the engine's audit log in PostgreSQL, with the actor and time and never message content. Rows are hash-chained, so tampering shows.

Audit records are retained for six years by default (AUDIT_LOG_RETENTION_DAYS=2190), matching the HIPAA documentation retention period. Customers can configure retention and export to their SIEM.

Self-hosted architecture

The MedHook Engine runs entirely within your infrastructure, and PHI stays in your cloud. The license is verified offline. The engine's only call to medhook.dev is an optional revocation check that sends the license ID, plus aggregate counts if you turn them on. Where our engineers have forward-deployed and support access to your environment, that access is governed by the Business Associate Agreement (BAA) we sign with you before any PHI is processed.

The engine is deployed from a versioned release into your own Google Cloud project (GKE, Cloud SQL, Cloud VPN), or with Docker Compose, Helm or Terraform elsewhere. Every image is pinned by version and digest. You control network boundaries, VPC configuration, and storage policies.

Access controls

Role-based access control (viewer, operator, admin) is checked on every request. Viewers never see message content, and admin-only actions such as VPN keys and settings need the admin role.

Custom JavaScript transforms run in isolated-vm sandboxes with 128 MB memory limits and 5-second execution timeouts, preventing runaway or malicious code.

Network security

SSRF protection refuses outbound REST, FHIR and storage requests to private IP ranges (RFC 1918), loopback and link-local addresses unless you allow a host. Site-to-site tunnels hand each pre-shared key over a one-time link, never in email.

Rate limiting is applied to authentication, license validation, and AI mapping endpoints. Content Security Policy headers are enforced on all medhook.dev responses.

Vulnerability disclosure

We take security reports seriously. If you discover a vulnerability in MedHook, please disclose it responsibly:

  1. Email security@medhook.dev with details of the vulnerability
  2. Include reproduction steps, impact assessment, and any proof-of-concept
  3. Allow us 90 days to investigate and remediate before public disclosure

We do not currently operate a paid bug bounty program, but we will publicly acknowledge researchers who report valid vulnerabilities (with their permission).