Holdbay Back to holdbay.dev

From docs/backup-vault.md in the Holdbay repository. This page is rebuilt from that file on every deploy.

Backup Vault: security design

Status: draft v0.1, 2026-11-26. Design only, nothing is built. Backup Vault does not take money until every gate in section 6 is met. Threats referenced (T28 to T33) are in threat-model.md.

Backup Vault is Holdbay's first paid product: managed offsite storage for the backups Holdbay already makes (Postgres base backups and WAL, Valkey snapshots, volumes). It holds the one thing users cannot get back if we fail, so its security has to hold even when Holdbay itself is the attacker or the victim.


1. The promise

What a user can rely on, stated so it can be tested:

  1. We cannot read your backups. They are encrypted on your server with a key that never leaves your servers or your recovery kit.
  2. Nobody can delete or change a backup before its retention ends. Not an attacker with root on your server, not an attacker inside Holdbay, not Holdbay staff, not you by accident.
  3. You can prove a backup is complete and restorable. Every backup is signed and chained, and restores from the Vault are tested on a schedule.
  4. You can restore without us. Backups use open formats and standard tools; the steps are documented and tested.
  5. Losing your key means losing your backups. We cannot reset it. We make it hard to lose and say this plainly in the UI before you start.

2. Who we defend against

Adversary What they want Main defence
Ransomware or an attacker with root on the user's server (A5, A6) Delete or encrypt the backups too, so the user must pay Servers can only add backups, never delete or shorten retention; objects are locked in compliance mode (3.2)
Attacker inside Holdbay's Vault or Cloud infrastructure, or a malicious insider (A9, A11) Read customer data, or destroy it Client-side encryption (3.1); compliance-mode locks that even our storage account cannot lift (3.2); Vault separated from Cloud (3.4)
The storage provider, or someone who breaches it Read, roll back or corrupt data Encryption (3.1); signed, chained manifests that make a missing or swapped backup visible (3.3)
Someone who takes over the user's Holdbay account Shorten retention or switch the key, then wait Passkey, 7-day delay, notifications, and existing locks are never affected (3.5)
Another customer (A2) Reach someone else's backups Separate credentials and storage prefix per organization, short-lived and bound to the server's identity (3.4)
Time Bit rot, silent corruption Scrubbing and scheduled restore tests from the Vault (3.3)

3. Design

3.1 Encryption happens on the user's server

  • Backups are encrypted before they leave the server, using formats with independent implementations: restic repositories for volumes and snapshots (AES-256 in counter mode with Poly1305-AES, content-defined chunking and deduplication), and WAL-G's built-in libsodium encryption for Postgres.
  • The Vault key is generated on the user's server with a CSPRNG and kept by the same KeyProvider as other secrets (spec F8). It is never sent to Holdbay, and it is not stored in the Holdbay Cloud control plane even when the panel is hosted by us.
  • Recovery kit: when the Vault is turned on, Holdbay shows the key once as a recovery kit (words plus a QR code, printable) and does not continue until the user confirms they saved it, the same pattern as setup recovery codes.
  • Optional passphrase escrow: the user may let Holdbay keep a copy of the key encrypted with a passphrase only they know (age, scrypt with a high work factor). We then hold a blob we cannot open. It is off by default and the UI says what it does and does not protect against.

3.2 Immutable storage

  • Backups are written to S3-compatible object storage with Object Lock in compliance mode. Until an object's retention date passes, no one can delete or overwrite it, including the storage account's root user.
  • Servers can only add. Each server receives short-lived credentials limited to its organization's prefix that allow writing new objects and reading for restore. They cannot delete objects or change retention. Expired backups are removed by the Vault service after retention ends, never by a user's server.
  • Default retention is 30 days. Plans may offer longer.
  • Deleting an account does not delete locked backups early; they expire at the end of their retention. A user who needs data gone sooner destroys their key, which makes it unreadable (crypto-shredding). The UI states this before the account is closed.

3.3 Integrity you can check

  • Every backup run writes a manifest: the list of objects with their hashes, the source (organization, server, add-on), time, and the hash of the previous manifest. The server signs it with its own Ed25519 key, held by the KeyProvider.
  • On every list and restore the user's server checks the signatures and the chain. A missing, reordered or swapped backup breaks the chain and raises an alert. The Vault cannot hide a gap.
  • Scrubbing: the Vault service re-reads stored objects on a schedule and compares them with the manifests, and reports any mismatch to the user.
  • Restore tests from the Vault: weekly, the user's server downloads a backup from the Vault into a throwaway container, decrypts it locally, and runs the same checks as the local restore test (spec F10). The result is signed and shown as "Last restore from Vault: passed". A failure is a red alert.

3.4 Isolation and access

  • Each organization has its own storage prefix and its own credentials. Credentials are short-lived (minutes) and issued only to a server that proves its identity with its agent certificate (mTLS, threat model T7). No long-lived storage key ever sits on a user's server.
  • The Vault service is separate from Holdbay Cloud: separate infrastructure, credentials, deploy pipeline and on-call access. A breach of the Cloud control plane gives no Vault credentials, and the reverse.
  • Staff access: hardware security keys only, no standing access to production, two people to approve any production change or access, and every access recorded in an append-only log. Staff never handle user keys, and the data is encrypted anyway.
  • Optional second region, with its own provider and its own locks, for users who want a copy in another jurisdiction.

3.5 Account and settings changes

These actions weaken protection, so each one needs a passkey, waits 7 days, notifies every admin by email and in the panel, and can be cancelled during the wait:

  • shortening retention (applies to new backups only; locked ones keep their date)
  • replacing the Vault key
  • turning the Vault off
  • closing the account

3.6 Transparency and exit

  • This document is public and is updated before any change to the design ships.
  • An external security review of the design and the code happens before the first paid customer, and a summary of the findings is published.
  • A public bug bounty starts at paid launch.
  • Incidents are disclosed to affected users within 72 hours, with a public post-mortem.
  • Exit without Holdbay: a user can download every object at any time and restore with the standard restic and wal-g tools and their recovery kit. The steps are in the docs and tested in CI (section 6).

4. What we will never do

  • Hold keys that can decrypt customer backups.
  • Offer "reset my key". It cannot exist in this design, and the UI says so.
  • Let a user's server, a Holdbay employee, or an API call delete a locked backup early.
  • Use backup contents for anything: there is nothing we can read.

5. Costs of this design, said honestly

  • A lost key with no recovery kit and no escrow means the backups are gone. The recovery kit step cannot be skipped.
  • Compliance-mode locks cannot be lifted, not even for a user who wants their data deleted at once. Crypto-shredding is the answer, and it is explained before signup.
  • Locked storage costs us for the full retention period even after a customer leaves. This is priced in.

6. Gates before Backup Vault takes money

  • [ ] External security review of this design and its implementation, with every critical and high finding fixed.
  • [ ] End-to-end test in CI: back up, destroy the server, restore on a new server using only the recovery kit and standard restic and wal-g.
  • [ ] Ransomware test in CI: with the server's own Vault credentials, attempts to delete, overwrite or shorten retention on locked backups all fail.
  • [ ] Chain test: removing or swapping a stored backup is detected and alerted.
  • [ ] Separate Vault infrastructure and access controls in place (3.4), and on-call with an incident process (blueprint section 9).
  • [ ] Threat model T28 to T33 marked implemented with tests.

7. Open questions

  • Storage provider: must support S3 Object Lock in compliance mode, have regions in Europe and Asia, and a price that fits the plan. To verify per candidate before choosing.
  • Retention options per plan, and whether a longer default is worth the cost.
  • Whether passphrase escrow should be offered at launch or later.