Office docsRun it
Secrets and rotation
What the installation encrypts, what you must encrypt on the host, and which secrets you can rotate without reinstalling.
What is encrypted
| Data | Protection |
|---|---|
| Backups | Encrypted under a key the installation creates and keeps off the data volume. Every restore verifies the round trip. |
| Archived WAL segments | The same key, when point-in-time recovery is on. |
| Secrets on disk | Owner-only (0600). A secret readable more widely stops the installation from starting. |
| Traffic from clients | TLS with a publicly trusted certificate, through Tailscale or a reverse proxy. |
| Traffic inside the installation | Mutual TLS between the supervisor, the gateway and each app, on a certificate authority the installation creates. The apps pin the gateway's client certificate. |
| Database connections | TLS only, verified against a certificate authority the installation creates. |
| Database files | Not encrypted by the installation. Encrypt the disk on the host. |
Encrypt the disk before you install
Anyone with the disk, a snapshot of it or your provider's console has the documents. The backup key protects the copies in your bucket, not the original. Whole-disk encryption belongs to the layer that owns the disk, with a key held outside the filesystem it protects.
Do this before the first install. Moving an installation onto an encrypted volume later means a backup, a fresh install and a restore.
- On a rented server, turn on volume encryption when you create the machine.
- On your own hardware, use LUKS on the volume that holds
/srv/kernalworks, and keep the passphrase or key file off the machine.
Confirm it with lsblk. A crypt device between the disk and the filesystem means encryption is working. The installation cannot check this for you.
$ lsblk -o NAME,TYPE,MOUNTPOINT
What you can rotate
| Secret | Rotatable | How |
|---|---|---|
| OpenID Connect client secret | Yes | See below. |
| Two-factor wrapping keyring | Yes | rotate-totp-keyring. Assisted installations only. |
| Recovery epoch | Yes | A restore rotates it, which ends every session. |
| Database passwords | No command | See below. |
| Backup encryption key | No command | See below. |
Rotate the OpenID Connect client secret
- Update the input file
Put the new secret in the OIDC input file you installed with, and change nothing else. The secret is always read from a file, never from an environment variable.
- Regenerate the host configuration
Run
generate-host-config. It also updates the configuration digest the installation checks at startup. - Restart the installation
Regenerating issues new internal TLS certificates to every app, so a restart is required. No data is touched, and the outage lasts as long as the restart.
Rotate the two-factor keyring
Second factors are sealed under a wrapping keyring. Rotation adds a new current key and keeps the old ones, so existing enrollments keep working. Nothing schedules it. The keyring is included in backups.
$ docker compose -p kernalworks-office -f compose.yaml exec office node /opt/kernalworks/operations/src/office.mjs rotate-totp-keyring --config /srv/kernalworks/data/office-installation.json
Database passwords
There is no rotation command, and re-running provisioning deliberately leaves existing credentials alone. Rotating one by hand means ALTER ROLE … PASSWORD, rewriting the connection-string file, regenerating the host configuration and restarting. A mistake stops the installation. The database roles are reachable only from the installation's own network, so treat a leaked database credential as a recovery.
The backup encryption key
The key is created once, kept in custody and does not expire. Existing backups need the key they were made with, so there is no rotation yet. Losing the key loses every backup. Show the recovery phrase again with export-recovery-phrase, as in Keep a second copy of the key.