Documentation

Back up and restore

Heliast does not back anything up for you. There is no backup job, no snapshot call and no restore tool in the product today, and no recovery target is promised. This page says what holds state, what to protect, how to restore, and the hazards that are specific to a tamper-evident ledger. The ledger hazards were checked by Heliast's engineers against a test PostgreSQL database; none of this has been run in a real estate or on a real cluster.

What to protect

ItemWhere it livesBack it up?How
The ledger and the virtual keysThe PostgreSQL database (a single replica on a persistent volume). The ledger tables are audit_events and chain_state; the keys are virtual_keys and virtual_key_events, in the same databaseYes, togetherA logical dump (pg_dump -Fc, restored with pg_restore --no-owner) or a volume snapshot. Heliast names no tool; use your own database backup
The signed anchorsThe audit service's anchor directory (AUDIT_ANCHOR_DIR, files named anchor-<sequence>.json). In the chart it is its own volume, <release>-audit-anchors, mounted at /var/lib/audit-anchorsYes, off the cluster, and keep every fileCopy the directory (rsync or cp of anchor-*.json) to storage the database's administrators cannot write to. No copy-out job exists
The anchor signing keyA Secret your security team owns, mounted read-only (audit.anchorKey.existingSecret). On a first install without one, anchor.key on the audit service's data volumeYes, kept apart from the ledger backupKeep it in your secret store. If the key is missing when the audit service starts, the service refuses to start; it does not make a new key
The anchor public keyGiven to the verifier with SOVEREIGN_ANCHOR_PUBLIC_KEY or -anchor-public-keyRecord it, and its fingerprint, with your compliance recordsIt is your estate's own key (see "Whose key signs the anchor" below)
The write-ahead bufferA volume on the audit service (wal.log, wal.checkpoint, and quarantine.jsonl)OptionalIt holds only events not yet written to the database, and is emptied once they are. It is not a backup of the ledger
Your policyYour own Git repositoryGit is the backupMirror the repository. A policy rollback is a Git revert (get and update Heliast)
Your catalogue records and your own models' recordsFiles you keep in Git; the hook reads them from a ConfigMap or directoryGit is the backupKeep them in your repository
Secrets (database connections, the admin, query, intake and hook tokens)Created outside the chart, in your secret storeYour secret store's backupNone of them is in Git
Helm values, and the Terraform stateYour own Git, and local to the machine that runs TerraformYesTerraform's modules ship with no remote backend, so the state is local; configure your own backend
Model weightsThe weights volumeNoPull them again and check them by digest (using an admitted model). A snapshot only saves time
The licence fileWherever you keep itKeep the file Heliast issuedlicence-validate -file <file> checks it offline
Compare resultsThe console's results directory (UI_COMPARE_RESULTS_DIR)Yes, if you keep run historyCopy the directory
The vector store, only if you turn on the optional knowledge path (off by default)Its own volumeYes, if you use itUse its snapshots

Virtual key secrets are not stored anywhere: only a fingerprint is kept, and the secret is shown once at issue.

Whose key signs the anchor

The anchor key is not the key Heliast uses to sign verdicts, and it is not Heliast's at all. It signs the head of your own ledger, inside your estate, every interval. It must be yours, for two reasons: a severed estate has to sign anchors without reaching Heliast, and a vendor who held the key could forge your audit evidence.

How it works:

  • Your security team generates the key in your estate, with licence-issue keygen -kind anchor -out <a file outside Git>. Store it in a Secret they own, for example:

`` kubectl create secret generic heliast-anchor-key --from-file=anchor-key=<the file> ``

Set the chart's audit.anchorKey.existingSecret to that Secret's name, and audit.anchorKey.publicKey to its hex public key. The key is mounted read-only into the audit service.

  • The people who administer the ledger database do not hold it. The anchor's whole value is that the database's owner cannot rewrite it.
  • The audit service refuses to start if the key is missing, or if its public key is not the one set in publicKey. It never makes a new key on its own.
  • On a very first install only, you may set audit.anchorKey.createOnFirstInstall: true. The service then writes a new key to its data volume and logs its public key. Copy the key into a Secret straight away, set existingSecret and publicKey, and turn the setting off.
  • Anchors are written to their own volume. The verifier checks every anchor in the directory, not only the latest.
  • The anchor-export call (POST /internal/anchor) needs the intake token.

Upgrading an install from before the anchor-key change

Releases before the anchor-key change kept the key at /var/lib/audit/wal/anchor.key and the anchors at /var/lib/audit/anchors, both on the write-ahead volume. The new chart looks for the key in a Secret, or at /var/lib/audit/anchor.key. It writes new anchors to their own volume. So an upgrade without these steps leaves the audit service refusing to start, and leaves your old anchors behind.

  1. Before you upgrade, copy the key out of the running audit service.

`` kubectl exec <audit pod> -- cat /var/lib/audit/wal/anchor.key > anchor.key ``

Find its public key in the pod's log line "anchor signer public key".

  1. Make the Secret from the file and set audit.anchorKey.existingSecret and audit.anchorKey.publicKey in your values. Then remove the local file.
  2. Copy the old anchors out of /var/lib/audit/anchors, to your off-cluster copy and to a working directory.
  3. Upgrade. Then copy the old anchor-*.json files into the new anchors volume (/var/lib/audit-anchors), so the verifier keeps checking them.
  4. Verify with audit-verify -anchor-dir <the anchors> -require-anchor -anchor-public-key <hex>.

Do not turn on createOnFirstInstall for an upgrade: it would make a new key that your existing anchors do not match. This upgrade path has not yet been run on a live install.

Restore, in order

  1. Put the anchor key back first. Restore the Secret, or anchor.key on a first-install setup, before the audit service starts. Without it the audit service refuses to start, which is deliberate: a new key would sign anchors that your pinned key refuses.
  2. Restore the database into an empty database. Then check the database roles: the audit writer role must have only the insert and select rights the ledger's schema gives it.
  3. Restore the secrets, then start the audit service, the hook and the router. The audit service refuses to start without its intake token.
  4. Restore the anchors directory, then verify the ledger against it:

`` audit-verify -anchor-dir <the restored anchors> -require-anchor -anchor-public-key <hex> ``

It reads the database from SOVEREIGN_DB_DSN or SOVEREIGN_AUDIT_DSN. Always give -anchor-dir and -require-anchor: without them the check passes and silently skips the anchor. Exit 0 means the chain verified. Every failure exits 2, a divergence included.

  1. Run the reconcile job (auditd reconcile) and read the audit service's /metrics for sovereignai_audit_completeness_ratio and sovereignai_audit_wal_*.
  2. Check the virtual keys. See the last hazard below.

Ledger hazards

A ledger that detects tampering also reports a restore as tampering. Know these before you need them.

  • Restoring a snapshot older than the latest anchor fails verification. If the anchor covers row 10 and you restore a database that stops at row 5, audit-verify exits 2 with "anchored row seq 10 is missing" and "ledger head seq 5 is below the anchored watermark 10: rows after the anchor were deleted". It cannot tell a restore from deletion, and it says "deleted". That is the correct and expected result. Write down that you restored, why, and the sequence numbers involved.
  • Keep every anchor. audit-verify checks every anchor in the directory you give it, so an older anchor still catches a lost tail after newer traffic has passed it. That only works if the older files are there: never prune the anchor directory or its off-cluster copy.
  • Events that arrived after the snapshot are lost. The write-ahead buffer is emptied once events reach the database, so it cannot refill a restored database. It helps only with events not yet drained. Replaying the buffer onto a restored database does not duplicate events already present: the append is idempotent on the event id.
  • A lost anchor key stops the audit service. It refuses to start rather than make a new key. If someone forces a new key anyway, audit-verify reports "signed by ..., not the pinned key" for every new anchor and exits 2.
  • Do not run a restored copy beside the live one. Both would hold the same anchor key and sign competing anchors. The chart runs the audit service as one replica for this reason.
  • Gaps lower the completeness metric. A restore that leaves gaps in the sequence trips AuditLedgerCompletenessBreach, even where audit-verify stays green, because it checks the hash links and not that the numbers are contiguous.
  • An older snapshot also reverts virtual keys. The keys are in the same database. A key you revoked after the snapshot becomes valid again, and keys issued after it are gone. After any restore, list the keys and revoke again what should be revoked.

Retention

The ledger's retention period is a setting (2,555 days in the reference configuration). There is no supported way to prune old rows: the database blocks deletes, and a verifier cannot start from a pruned beginning. Anchors do not help with pruning. Plan storage for the whole retention period. Heliast never deletes an anchor.

What is not covered

  • No recovery time or recovery point is promised. A disaster recovery design (streaming replication of the ledger database) exists on paper only; it is not built.
  • Where the external anchor copy goes is your choice: object storage with a retention lock, or a volume your security team owns.
  • The audit service's anchor-export call (POST /internal/anchor) is on the intake port; keep that port reachable only from inside the cluster (network and ports).