Confidentiality
Record encryption
Every user record is encrypted with AES-256-GCM before it is written to the backend database (SQLite, MySQL or PostgreSQL). The 32-byte key is made of two parts:- a 24-byte master key, supplied at startup through
DATABUNKER_MASTERKEY,DATABUNKER_MASTERKEY_FILEor--masterkey, and held only in memory - an 8-byte record key, generated randomly for each record and stored next to it
Hashed search index
Before encrypting a record, Databunker extracts the email address, phone number, login name and custom index, normalizes them, and stores a salted SHA-256 hash of each. Lookups by these values hash the query and match on the hash, so the index never holds plaintext.Encrypted audit trail
Audit events store the user token and the acting identity encrypted, and the record’s before and after states as ciphertext.Encryption in transit
Databunker serves HTTPS when the certificate files configured underssl in databunker.yaml exist, and falls back to plain HTTP when they do not:
databunker.yaml
No bulk export by default
The API call that lists all user records is disabled unless you setlist_users: true in databunker.yaml. An attacker who steals an access token still has to look up records one at a time, by a value they already know.
Secure session storage
Application sessions often hold personal data: an email, an IP address, browser details. The/v1/session API stores session objects in the same encrypted store, each with its own record key.
User schema validation
Setuser_record_schema to a JSON schema, and Databunker rejects create and update requests whose user record does not match it.
Integrity
Conflict-safe record updates
Two Databunker processes can update the same user record at the same time. To stop one silently overwriting the other, each record stores a checksum of its ciphertext, and the SQLUPDATE only applies when that checksum still matches the version the process read.
The checksum is MD5. It detects concurrent changes, not tampering, and is never used to protect data. Encryption and index hashing use AES-256-GCM and SHA-256.
Token-based API access
Every API request carries anX-Bunker-Token header. Databunker resolves the token to a role, checks its permissions, and rejects anything the role is not allowed to do.