Security
Secure by Default, Not by Checklist.
There is no unauthenticated mode. Every request outside a short public list needs credentials, refusals are audited, and everything on disk is encrypted with a key only you hold.
Sixteen Permissions, Any Combination
Built-in roles cover the usual cases (reader, writer, owner, operator, auditor, ai, admin). Custom roles pick from the same sixteen permissions.
| Permission | Allows | Scope |
|---|---|---|
| read | Get, list, query, count, aggregate, the change feed; consume streams | per tessellation |
| write | Insert, replace, patch, delete; publish to streams | per tessellation |
| manage | Delete tessellations; manage indexes, schemas and advice; configure streams | per tessellation |
| upload | Upload files and new versions; create files tessellations (with write) | per tessellation |
| delete | Move files to the trash and delete them from it | per tessellation |
| restore | Restore files from the trash and earlier versions of files | per tessellation |
| status | Server status, metrics, storage and lattice details | global |
| logs | The server log | global |
| audit | The audit trail | global |
| plugins | Plugins and their delivery state | global |
| maintenance | Flush, compact and back up | global |
| ai | Run prompts through the lattice's AI provider, within its budget | global |
| chat | Ask the AI chat about the data you can read, within the chat limits | global |
| share | Make sharing links to files and folders you can read | global |
| detokenize | Read the real values behind vault tokens (audited) | per tessellation |
| admin | Everything: users, roles, settings, configuration, functions, schedules, joining hexes | global |
Grants, in One Request
A grant names a role and the tessellations it applies to. Streams use the resource name stream:<name>. A grant on * covers everything.
# A grant names a role and the tessellations it applies to
curl -X POST http://localhost:7700/users -H "Content-Type: application/json" -d '{
"login": "ada", "password": "correct horse battery staple",
"roles": [{ "name": "writer", "tessellations": ["orders", "customers"] },
{ "name": "reader", "tessellations": ["*"] }] }'
# Custom roles from any set of permissions
curl -X POST http://localhost:7700/roles \
-d '{ "name": "analyst", "permissions": ["read", "status"] }'Row Filters, Hidden and Masked Fields
A role can be restricted per tessellation: a filter that limits which documents it sees and writes, using the caller's login, email or attributes, fields it can never see or change, and fields it sees masked, with at most the first 6 and last 4 characters showing, as PCI DSS allows for card numbers.
# A role that only sees and writes its own region, never sees cost or margin,
# and sees card numbers as ************1111
curl -X POST http://localhost:7700/roles -H "Content-Type: application/json" -d '{
"name": "regional", "permissions": ["read", "write"],
"restrictions": { "orders": { "filter": { "region": { "$user": "attributes.region" } },
"hide": ["cost", "margin"],
"mask": { "card": { "show_last": 4 } } } } }'
curl -X PATCH http://localhost:7700/users/ada -d '{ "attributes": { "region": "EU" } }'
# Queries, counts, aggregations, GraphQL and the change feed all see only matching documents (a delete event carries only the ID).
# Filtering or sorting on a hidden or masked field is refused, so values can't be probed.- • Responses carry nosniff, DENY framing, a no-referrer policy and a Content Security Policy.
- • Other sites can't read responses unless their origin is listed in
cors.allowed_origins, and credentials never cross origins. Cookie-authenticated changes must be same-origin (CSRF protection). - • TLS is two settings away, with HSTS, Secure cookies and HTTPS replication between hexes.
Compliance
Built for PCI DSS, HIPAA and SOC 2.
The controls these standards ask a database for are built into HexDB, in every edition: encryption at rest, field masks, least-privilege roles, multi-factor sign-in, an audit trail, backups and failover. Here is what each requirement maps to.
PCI DSS
For card numbers and the systems that store them.
- 3.4.1 Mask PAN when displayed
- Field masks: a role reads a card number as ************1111, never more than the first 6 and last 4.
- 3.5.1 Render stored PAN unreadable
- AES-256-GCM on the stored data (documents, files, indexes and the write-ahead log), with a key only you hold.
- 3.6, 3.7 Key management
- Keys rotate without downtime; a hex without the key refuses to start rather than discard anything.
- 4.2.1 Strong cryptography in transit
- TLS for clients, HTTPS replication between hexes, and sealed file chunks.
- 7.2 Access by need to know
- Roles per tessellation, row filters, hidden and masked fields.
- 8.3.4, 8.4 Lockout and MFA
- Sign-in locks after 5 failures; TOTP multi-factor authentication with backup codes.
- 10.2 Audit logs
- Sign-ins, changes to accounts, roles and structure, and every refused request, with who, what, when and from where.
HIPAA
For protected health information, under the Security Rule's technical safeguards.
- 164.312(a) Access control
- A unique account or API key per person and per app, with roles, row filters and field masks.
- 164.312(a)(2)(iv) Encryption
- AES-256-GCM at rest, on every hex, for documents, files, indexes and the write-ahead log.
- 164.312(b) Audit controls
- An audit trail of sign-ins, refused requests, and changes to accounts, roles, settings and structure.
- 164.312(c) Integrity
- Authenticated encryption and BLAKE3 hashes on every fragment; damaged copies are repaired.
- 164.312(d) Authentication
- Passwords with lockout, and TOTP multi-factor authentication.
- 164.312(e) Transmission security
- TLS to clients and between hexes.
- 164.308(a)(7) Contingency plan
- Online backups, every document on at least two hexes, and automatic failover.
SOC 2
For the Trust Services Criteria a SOC 2 report examines.
- CC6.1 Logical access
- Encryption at rest, roles, MFA, and no unauthenticated mode.
- CC6.7 Data in transit
- TLS and authenticated hex-to-hex traffic.
- CC7.2 Monitoring
- The audit trail, request logs, and metrics history in the admin UI.
- CC8.1 Change management
- Versioned schemas checked before they apply, with rollback, and versioned lattice configuration.
- A1.2 Recovery
- Online backups, replicas that take over in seconds, and crash recovery from the write-ahead log.
- PI1 Processing integrity
- Schema validation on every write, and atomic transactions.
What This Is, and Isn't
HexDB hasn't been through a PCI DSS assessment, a HIPAA audit or a SOC 2 examination. Compliance covers your whole system and how you run it, and an assessor or auditor checks that. HexDB gives that system a database whose controls map to the requirements above, so there is less to build around it.
Three Settings to Tighten
Some defaults are gentler than these standards ask for:
security.audit_retention_days = 365PCI DSS keeps audit logs for a year (the default is 90 days).security.lockout_minutes = 30PCI DSS locks an account for at least 30 minutes (the default is 15).[tls]Every standard here wants encryption in transit; HexDB Enterprise serves HTTPS already.
