Rivergate

Backup and recovery

A backup is only recoverable when the database and the keys that unlock it come back together. Plan and rehearse both.

You operate your backups

Rivergate does not automate backups or restores. The procedures below describe what a correct recovery requires so you can build and test your own.

What needs backing up

StateWhere it livesHow to protect it
DatabasePostgreSQL: tenants, encrypted secret versions, wrapped keys, policies, identities, audit records and checkpoints.Encrypted base backups plus WAL/PITR where you need it. Record the schema version and restore point.
Root keysVersioned key files outside PostgreSQL.Separate, access-controlled recovery copies in a different storage boundary. Record key IDs, never key material, in your manifest.
Audit signing keysWorker key file.Back up independently of the root keys. Keep public keys and exported signed checkpoints outside Rivergate’s database.
ConfigurationDeployment and config versions.Version non-secret configuration; keep credentials in your secret system.
KubernetesCRDs and delivered Secrets.Back up CRDs and deployment config. Backups of delivered Secrets contain plaintext: encrypt them, restrict access and bound retention.
RedisShort-lived sign-in state.Not a backup source. Users simply restart sign-in.

Restore sequence

  1. Declare the incident. Suspend key destruction, retention purges and rotation jobs that could complicate recovery. Preserve evidence and use a trusted recovery environment.
  2. Restore the keys. Bring back the exact root-key versions, and confirm the signing key and public verification keys are available. Never place keys in images or logs.
  3. Restore PostgreSQL into an isolated environment. Verify integrity, schema and migration level, the backup manifest, and organization and project key record counts.
  4. Verify the key hierarchy on a sample across organizations and projects: the root unwraps organization keys, organization keys unwrap project keys, project keys unwrap data keys, and GCM tags and context validate. Do not expose traffic until this passes.
  5. Verify the audit chains against the latest independently retained signed checkpoints. Report missing, altered or un-checkpointed ranges. Never silently reset or regenerate a chain.
  6. Rotate credentials. Restore or rotate identity-provider and service credentials, and revoke any suspected compromised.
  7. Reconnect Redis. In-flight sign-ins can simply be restarted.
  8. Resume the worker. It continues checkpointing and resumes any in-progress jobs from their stored position.
  9. Return to service only after authentication and secret access are validated in the isolated environment.
  10. Record the actual recovery point and time, integrity results, key versions restored, any data gaps, and who was notified.

A backup is not “recoverable” until the key hierarchy and representative secret versions decrypt in an isolated restore exercise. A successful backup job is not evidence.

Key loss

Key compromise

  1. Scope it. Identify the compromised key and version, and whether the attacker could also reach application memory, key files, provider credentials, database backups or signing keys.
  2. Contain. Restrict use of the affected key while preserving evidence. Don’t delete old versions until recovery and rewrap scope are understood.
  3. Create a new key version through a controlled ceremony. A compromised root means every key beneath it may be exposed; an organization or project key narrows the scope accordingly.
  4. Rewrap affected child keys under the new parent (see Rotation). This protects the stored representation going forward. It does not revoke copies or undo disclosure that already occurred.
  5. Re-encrypt if data keys or plaintext may be exposed. Affected values need fresh data keys; this goes beyond rewrapping.
  6. Rotate the actual credentials — passwords, API tokens, certificates, leased credentials — whose values may have been exposed. Key rotation alone does not change what the secrets contain.
  7. Replace the audit signing key separately if it was affected, verify checkpoints with unaffected public keys, and export fresh checkpoints to an independent location.
  8. Validate rewrap counts, samples, permissions, audit evidence and restore points before declaring containment complete.

Before you go live

Decide and write down, for your deployment: recovery point and time objectives, backup retention, geographic scope, who owns failover, who holds key recovery copies, checkpoint cadence and destination, and what you and your users are responsible for. Then run an isolated restore exercise covering the database, the keys and audit verification together, and repeat it on a schedule.