Docs menu

Compliance

Ready, not certified

dotwire is compliance-ready software. It is not, and cannot be, "SOC 2 compliant," "ISO 27001 certified," or "HIPAA compliant" on its own. Certifications and attestations attach to a deployment and the organization running it, not to a piece of open-source software.

dotwire's job is to ship the technical controls a host needs and to be clear about which controls it can't provide. Nothing in these docs claims that dotwire itself is compliant or certified.

Technical controls

  • At-rest encryption with AES-256-GCM in both JetStream and Postgres, on by default. See Encryption and retention.
  • TLS in transit. Client and inter-service traffic is expected to run over TLS. TLS termination and certificate management are a host deployment concern.
  • Hash-chained, append-only audit log with logged audit access, daily checkpoints, and a verify endpoint. Every admin mutation writes an ids-only event. See Audit log.
  • Role cross-check and membership authorization. See Auth.
  • Redaction that physically removes a message from both stores. It answers 409 when a legal hold, the keep period or a write-once setting protects the message. See Redaction.
  • Emergency deletion for an admin with a reason code (illegal_content or court_order). It's the only path that bypasses a hold or keep period, and it's audited as message.redacted.emergency.
  • Legal holds on a room or a user. While a hold is active, redaction and erasure of held data answer 409 legal_hold, and retention is paused. See Legal holds and erasure.
  • Account erasure that revokes a user's access and then anonymizes or deletes their messages in both stores, waiting for any hold or keep period to end. See Legal holds and erasure.
  • Erasure notices. A signed, durable webhook that lists the exact messages each redaction and erasure removed, so you can delete your own copies.
  • Opt-in access log. With Dotwire:AccessLog:Enabled=true, an append-only, ids-only record of each member's live windows and history reads. See Access log.
  • DSAR export of a user's messages, memberships, role, audit references and access-log rows. See DSAR export.
  • Configurable retention for content and metadata. See Retention.
  • Key rotation for both key systems. See Two key systems.
  • Operational metrics without identifiers. OpenTelemetry metrics over OTLP, on by default, carry no room, message, user or sender ids, no subjects, no SQL text and no content. Traces are off by default. When on, they keep only method, route template, status, error type, RPC and database-operation tags, and spans with exception events are dropped. See Observability.

Control mappings

These mappings are a starting point for your own auditor conversation, not a substitute for one. Frameworks are satisfied by an organization's full control environment, of which dotwire's technical controls are one input.

SOC 2 (trust services criteria)

Framework requirementdotwire mechanismHost obligation
CC6.1 / CC6.6 — logical access controlsJWT signature/claims verification + role cross-check pipeline against user_roles and room_membersManage who holds admin/auditor roles; issue and scope host-side JWTs correctly
CC6.7 — transmission and at-rest protectionTLS in transit + AES-256-GCM at-rest encryptionTerminate and manage TLS; supply and custody the encryption key in production
CC7.2 / CC7.3 — system monitoring and incident detectionHash-chained audit log, including self-logging of audit access; OpenTelemetry metrics for writer lag against the ROOMS max age, audit backlog against its cap, audit-writer presence, and audit 503sMonitor the audit log and the metrics operationally, and alert on the suggested thresholds; define and run an incident response process
CC8.1 — change managementNo dotwire mechanismHost owns change management for its deployment: release approval, testing, and rollout process for dotwire and its configuration

ISO 27001 Annex A (2022)

Framework requirementdotwire mechanismHost obligation
A.5.15 — access controlRole cross-check pipeline (dw:role vs. user_roles) + room membership check against room_membersDefine the organizational access-control policy; grant/revoke roles and memberships correctly
A.8.10 — information deletionRedact/delete message API + configurable retention (content and metadata)Choose and enforce a retention policy; invoke redaction/DSAR endpoints as part of an operational process
A.8.12 — data leakage preventionAES-256-GCM at-rest encryption; audit events never contain message content, only idsPrevent leakage in host-side systems (logs, backups, exports) outside dotwire's boundary
A.8.15 — loggingHash-chained, append-only audit log of admin, auditor and compliance actions. With the access log on, an append-only, ids-only record of member live windows and history reads (GET /audit/access). With it off (the default), member reads and live deliveries are not logged.Ship/retain logs per organizational policy; turn on the access log or record in the risk analysis why it's off; review the audit and access logs periodically
A.8.24 — use of cryptographyBoth key systems: AES-256-GCM at-rest encryption keys and RS256 JWT signing keysCustody and rotate the encryption key and JWT private key; document key management procedures

HIPAA technical safeguards (§164.312)

Framework requirementdotwire mechanismHost obligation
§164.312(a) — access controlRole cross-check + membership authorization pipelineAssign unique user identities on the host side; manage emergency access procedures
§164.312(b) — audit controlsCovered when the access log is on, subject to its limitations below (our reading; confirm with counsel). The audit log records admin, auditor and compliance actions. The access log records each member's live windows (who, which room, hub or SSE, when opened and closed, and why) and each history page served (who, which room, seq range, count, when). With the access log off (the default), member activity isn't recorded anywhere.Turn on the access log, review its output as part of an operational compliance program, and set its retention; or record in the risk analysis why it's off, and record access to ePHI in chat by other means
§164.312(c)(1) — integrityHash chain (hash = SHA-256(prev_hash ‖ canonical_event)) with daily checkpoint anchors and a GET /audit/verify endpoint, enabling tamper detection via chain verificationAct on integrity-verification failures; archive audit_checkpoints rows to independent cold storage on a regular cadence so a verification anchor survives even if the live database is compromised, and retain checkpoint verification records
§164.312(e) — transmission securityTLS in transit + AES-256-GCM at-rest encryption for content that traverses JetStreamTerminate and configure TLS correctly for the deployment's network topology
Not addressed by dotwire—Business Associate Agreement (BAA), and all administrative and physical safeguards, are entirely host obligations — dotwire is software, not a covered entity or business associate

GDPR

Framework requirementdotwire mechanismHost obligation
Art. 15 — right of accessDSAR export endpoint (decrypted messages, memberships, roles, audit references, and access-log rows where the user is the subject or the actor)Authenticate and fulfill the data subject's request through the endpoint within the legal deadline
Art. 17 — right to erasureRedaction and account erasure (anonymize or delete). Holds and keep periods are respected, and a blocked erasure finishes on its own when they end. JetStream copies are deleted. The hash chain survives because audit events carry ids only, never contentDelete the identity in your own user table; review identifying free text, which anonymization doesn't remove; choose delete for DMs and small rooms; erase host-side copies, using the erasure notices
Art. 17(3) — exceptions to erasureLegal holds block erasure of held data. The audit log and the access log keep the erased user's sub (our reading: Art. 17(3)(b) and (e); confirm with counsel)Record which exceptions you rely on and for which data; use an opaque sub, so the retained ids identify no one once your identity row is gone
Art. 25 — data protection by design and by defaultAES-256-GCM at-rest encryption on by defaultKeep encryption enabled; document the design choice in the host's own DPIA/records
Art. 30 — records of processing activitiesHash-chained audit log as an input to the host's processing-activity recordsCompile and maintain the actual Art. 30 record; the audit log is a source, not the record itself
Art. 32 — security of processingAES-256-GCM at-rest encryption + TLS in transit + hash-chain integrityPerform the host's own risk assessment and select organizational measures beyond dotwire's boundary

Shared responsibility

dotwire providesHost must do
AES-256-GCM at-rest encryption, on by default, both storesCustody and back up the encryption key (external secret in production; dotwire won't start without one)
TLS-capable transportTerminate TLS and manage certificates
Hash-chained, append-only audit log with self-logged audit accessCustody and rotate the host's RS256 JWT private key; set the token TTL policy
Role cross-check + membership authorization pipelineGrant and revoke roles/memberships correctly via the admin API; keep user_roles and room_members accurate
Redact/delete message API (GDPR Art. 17 mechanism)Choose and enforce retention policy (content and metadata) for both Postgres and JetStream
DSAR export endpoint (GDPR Art. 15 mechanism)Operate the org-level compliance program: policies, security training, DPAs, BAAs, DPIAs, consent management
Configurable retention, applied consistently to content and metadataEncrypt and secure backups; dotwire's at-rest encryption does not automatically cover backup storage the host controls
Documentation mapping controls to common frameworksHarden the surrounding infrastructure: host OS, network, container runtime, secrets store

Legal holds. POST /admin/holds places a hold on a room (roomId) or a user (userId), with an opaque matterRef you use to find it again. While any hold is active:

  • Redacting or erasing held messages answers 409 legal_hold.
  • Retention for messages and the access log is paused, and the pause survives restarts and policy changes. GET /admin/retention reports it as paused.
  • Only emergency deletion bypasses it.

DELETE /admin/holds/{id} releases a hold, and GET /admin/holds?active=false lists released ones. Placing and releasing each write an ids-only audit event. matterRef never enters the audit log.

Account erasure. POST /admin/users/{userId}/erase revokes the user's memberships and role at once, exactly like deleting their role. A background worker then processes their messages in one of two modes:

  • anonymize (the default) re-encrypts each message with dotwire:erased as its sender. The content stays, so conversations keep their shape.
  • delete removes each message from Postgres and JetStream, like a redaction.

Pass mode per request, or set the default with Dotwire:Compliance:Erasure:Mode. The mode is final for that erasure. Messages a hold, the keep period (MinimumKeepDays) or AllowChanges=false protects stay in place, and the erasure finishes on its own once they become eligible. GET /admin/erasures/{id} reports the status (in_progress, waiting with what blocks it in blockedBy, or completed) and the messages left.

While an erasure is open, role changes, member adds and admin injections for that user answer 409 erasure_open. After it completes, the id can be granted again, but reusing a sub for a different person attaches new data to the old audit trail. Use opaque, never-reused ids.

Anonymization isn't anonymity. In a direct message or a small room, the other participants and the message content can still identify the erased user. Choose delete for those, and review identifying free text either way.

Erasure notices. When Dotwire:Webhooks:Erasure:Url is set, every redaction and every erasure pass sends a signed notice listing the exact (roomId, seq) pairs affected. Delivery is at least once through a durable JetStream queue, so receivers must deduplicate. Notices carry ids only. A notice not delivered within Nats:ErasureNoticesMaxAgeHours (168 by default) expires silently, so alert on dotwire.webhook.erasure.failed. If you keep copies of messages anywhere (search indexes, archives, postsend consumers), delete them when a notice arrives.

The settings are config-only. AllowChanges, MinimumKeepDays and Erasure:Mode live under Dotwire:Compliance and are validated at startup. No API can change them, so a stolen admin token can't weaken them. GET /admin/compliance reads them. See Configuration.

Access log

The access log is off by default. With Dotwire:AccessLog:Enabled=true, dotwire records, in its own append-only table:

  • Live windows. Each hub subscribe or SSE stream a member opens, and its close with a reason: left, disconnected, revoked or error.
  • History reads. Each history page served over REST or SSE replay, with its seq range and count.

Rows carry ids only: room, user, role, transport and, when set, the dw:actor that made the call on the member's behalf. Auditors query them with GET /audit/access (from is required; filter by roomId or userId), and each query is itself audited as access_log.read.

The log fails closed. An open or a read it can't record is refused rather than served unlogged: 503 access_log_unavailable on REST and SSE, AccessLogUnavailable on the hub. Turning it on therefore makes reads depend on NATS, which is why startup requires Nats:Enabled=true. It also requires Auth:MaxTokenLifetimeMinutes above 0, because a token's expiry is the upper bound for a window whose close was lost.

Set Dotwire:AccessLog:RetentionDays to bound how long rows are kept (0, the default, keeps them). It must be 0 or at least MinimumKeepDays, and a legal hold pauses it like message retention. Keep Enabled and the token cap the same on every node: each node records its own traffic, and each node's access_log.config audit event shows its setting at startup.

Whether to turn it on is your decision. Record it in your risk analysis either way.

Approving admin actions

dotwire runs an admin call as soon as a valid admin token makes it. It has no approval step of its own. To require one or more approvers for admin decisions, put the approval step in your own application:

  1. Keep admin tokens in your backend. People never receive an admin token. They request an action in your app, and only your backend signs admin tokens and calls dotwire.
  2. Approve, record, then call once. Before the backend makes the call, record the requester, each approver, the time, the reason and the target ids (roomId, seq, userId, hold id). Make the call only after the required approvals.
  3. Cover every admin decision, not only the destructive ones. Each action below writes an audit event with its target ids:
Admin actionEndpointAudit event
Grant or change a rolePUT /admin/users/{userId}/rolerole.set.<role>
Remove a roleDELETE /admin/users/{userId}/rolerole.deleted
Add room membersPOST /admin/rooms/{roomId}/membersmember.added (and role.set.member when ensureMemberRole creates the role)
Remove a room memberDELETE /admin/rooms/{roomId}/members/{userId}member.removed
Inject a messagePOST /admin/rooms/{roomId}/messagesmessage.injected
Redact a messageDELETE /admin/rooms/{roomId}/messages/{seq}message.redacted
Emergency deletionPOST /admin/rooms/{roomId}/messages/{seq}/emergency-deletemessage.redacted.emergency
Change retentionPUT /admin/retentionretention.set
Export a person's dataGET /admin/users/{userId}/exportdsar.exported
Place a legal holdPOST /admin/holdshold.placed
Release a legal holdDELETE /admin/holds/{id}hold.released
Erase an accountPOST /admin/users/{userId}/eraseuser.erasure.requested, then user.erased when it completes
  1. Reconcile the audit log against the approvals. Using the auditor identity, regularly match every audit event in the table to an approval record. An event without one means someone called dotwire outside your approval step, for example with the JWT signing key, a leaked admin token, or the dotwire_app database credentials.

The approval step stops mistakes and abuse by people who go through your app. Reconciliation catches calls that bypass it. Neither stops someone who holds the signing key, so key custody remains the control everything else rests on.

Calls your code makes on its own, such as adding a member who joined with an invite code or posting a system message, follow your application's rules instead of a per-call approval. Review those code paths like any other code, and expect their audit events in the reconciliation.

The actor in each audit event is the sub of the admin token that made the call. If your backend uses one service identity for every call (the SDKs default to host-admin), dotwire's log can't tell operators apart, and your approval record is the only record of who decided. To have dotwire's log name the operator who executed each action, sign admin tokens per operator (adminUserId in @dotwire/host, AdminUserId in Dotwire.Host), and give each of those ids the admin role in dotwire.

Accepted limitations

Read these before you map a control to dotwire.

  • Member activity isn't recorded while the access log is off. With Dotwire:AccessLog:Enabled=false (the default), a member subscribing to a room, reading its history or receiving its live messages isn't recorded anywhere, so dotwire can't answer "who read this conversation, and when". Sends are stored with their sender and time, but they aren't audit events. Regimes that expect access logging, such as HIPAA's audit controls, need the access log on or another record.

  • Access-log closes are best-effort. A close waits in an in-memory queue (10,000 events) and is tried three times. A full queue, a failed publish or a shutdown that doesn't drain within 5 seconds drops it, counted as dotwire.access_log.close_dropped. A window whose close was dropped reads as open until its expiresAt (the token's exp), which is its upper bound, not its real end.

  • The access log errs toward recording too much. A publish that times out may still have been stored. A failed open gets a compensating error close, but a history read answered 503 can still leave a history.read row.

  • dw:actor only covers calls that carry it. Both host SDKs set it on their own member calls. Tokens you mint for end users don't carry it unless you pass actor, so a member's own client is logged without an actor.

  • Denials, participant reads and client IPs aren't in the access log. A request refused before its window opens, GET /rooms/{id}/participants, and the client's IP address and user agent aren't recorded. A window that opens and then fails the membership re-check shows as an open with a revoked close.

  • Lowering the token cap can hide older windows. The query looks back Auth:MaxTokenLifetimeMinutes from from, so after you lower the cap, windows opened under the old, longer cap can be missed near the change.

  • Ids are kept after erasure. Erasure doesn't delete audit or access-log rows, so they keep the erased user's sub. Our reading is that GDPR Art. 17(3)(b) and (e) cover keeping them, and that with an opaque sub and your identity row deleted they identify no one. Confirm this with counsel.

  • JetStream copies of held messages still expire. A hold pauses Postgres retention, but the ROOMS stream keeps its max age (Nats:RoomsMaxAgeHours, 48 by default). Postgres is the record.

  • The postsend webhook is best-effort, not an archive feed. Its queue lives in memory: a full queue drops the newest message, a delivery that fails MaxAttempts times (3 by default) is dropped, and a restart loses everything still queued. Each drop is counted as dotwire.webhook.postsend.dropped. Admin-injected messages skip it unless IncludeAdminSends is set. seq rises within a room but isn't contiguous, so you can't spot a missing message from a gap. If you must archive every message, page each room's history after the last archived seq on a schedule, as a room member, and treat postsend only as the fast path.

  • Settings apply to the whole deployment. Retention, keep period and write-once apply to every room. If one regime needs write-once records and another needs erasure, run a separate deployment for each.

  • Admin actions have no built-in second approver. Any admin can run any admin action. Two-person control is yours to build, with audit review as the check. See "Approving admin actions" above.

  • The runtime role can call erasure and retention functions directly. redact_message (the unchecked form the emergency path uses), redact_message_checked, reattribute_message, set_message_retention, get_message_retention and sync_retention_schedule are SECURITY DEFINER functions granted to dotwire_app, and they emit no audit event themselves. The hold and erasure tables also accept INSERT from dotwire_app. The API audits before it calls them. Anyone holding the dotwire_app credentials can bypass that, so treat those credentials as privileged and monitor database access.

  • The audit chain is unkeyed. It detects edits only relative to an anchor an attacker can't rewrite. Export audit_checkpoints to WORM or other independent storage on a schedule, and alert on DDL against the audit tables. See Audit log.

  • Audit events are published before the database commit. A failed commit can leave an event for a change that didn't happen. The chain never misses a change that did happen.

  • DSAR export bypasses room membership by design. It's audited as dsar.exported. Admin reads of role and membership metadata aren't individually audited.

  • Revocation of live connections is eventually consistent. A lost NATS broadcast is caught by the gateway membership sweep, within Dotwire:MembershipSweepSeconds (60 by default) plus any read-replica lag.

  • Applied migrations are checksummed. Startup fails if an already-applied migration file changed, so schema drift from edited history is visible.

  • Third-party processors are your choice. dotwire ships no moderation classifier. If yours sends message content to an outside service, such as an LLM or a moderation API, that vendor becomes your subprocessor, and your DPA, records of processing and DPIA must cover it.

  • The bundled Compose files and HAProxy config are development topologies. They are plain HTTP and bound to loopback, not a TLS deployment. JWKS and webhook URLs must be https unless you explicitly override that.

What dotwire doesn't do

dotwire is not an org-level compliance product. It has:

  • No policy management. Security policy documents live wherever you already manage policy.
  • No consent tracking. Consent for data processing is a host application concern.
  • No DPIA tooling. The mappings above are an input to a Data Protection Impact Assessment, not a substitute for one.
  • No compliance dashboards. dotwire ships APIs and audit data. You build or buy the reporting UI.
  • No end-to-end encryption. The server must read message content to fan it out.
  • No metadata encryption. Who messaged whom and when stays in plaintext columns so queries work. Use a short, enforced retention window to limit how long it exists.