Skip to content

Secrets

Cluster-level credentials—storage keys, backup encryption keys, Postgres passwords, and signing keys—live in secrets.age, an encrypted file in your config repo. anastroctl decrypts it on your workstation and pushes each node only the secrets its config needs.

Project secrets for machines (API keys, .env files) don’t go here—those come from 1Password.

secrets.age maps secret paths (lowercase/with_underscores-and-dashes) to values, encrypted with age to the keys listed in [secrets] recipients. Because it’s ASCII-armored ciphertext, it’s safe to commit to git.

[secrets]
recipients = ["age1…", "age1…"] # everyone authorized to decrypt the bundle
Terminal window
anastroctl cluster key age # print your recipient (creates age.key)
anastroctl cluster bundle init # generate built-in cluster secrets
anastroctl cluster bundle set backup/encryption_key # hidden prompt or stdin
openssl rand -hex 32 | anastroctl cluster bundle set backup/encryption_key
anastroctl cluster bundle list # paths only, never values
anastroctl cluster bundle delete old/thing

Config files reference secrets as "secret:<path>".

cluster bundle init generates every internal key that isn’t already present: Postgres passwords (postgres/*), workspace keys (dwfs/root_key, dwfs/lease_signing_key), inference and integration keys, the admin recovery key (auth/recovery_key), and the secret store’s KEK (secrets/kek). Any init, set, or delete re-encrypts the bundle to the current recipients list, so newly added recipients take effect on the next edit.

Terminal window
anastroctl cluster unseal # all nodes in your active context
anastroctl cluster unseal -n cp2

unseal pushes each node the secrets referenced by its config (plus HA Postgres passwords and enabled feature keys; worker-only nodes only receive OTLP header secrets). Each node seals its secrets to its TPM with systemd-creds under /var, injects them into services as systemd credentials, and automatically restarts any service whose secret changed—no cluster apply needed.

  • Rotating a secret: update it with cluster bundle set, then run cluster unseal.
  • Adding a secret for a new config change: run cluster unseal before cluster apply, because nodes reject a config referencing a secret they don’t hold yet.

If a node’s config requires a secret it doesn’t have, it stays sealed: its node API answers (reporting secrets failing in anastroctl node status), while all other services wait.

In a 3- or 5-node cluster, a sealed control-plane node asks its peers every 5 seconds. A peer hands over the secrets if the requesting node’s config is signed by a trusted operator key, belongs to the same control_plane, and is pinned to that peer’s endpoint ID. That means a replaced node unseals itself automatically after anastroctl cluster apply.

Configs signed offline with anastroctl cluster config sign (for ANASTROCFG disks) aren’t pinned to an endpoint ID, so peers won’t auto-unseal them—run anastroctl cluster unseal manually. Single nodes have no peers and always unseal via unseal or bootstrap.

Terminal window
anastroctl cluster bundle rekey --kek # secrets/kek: the cluster secret store
anastroctl cluster bundle rekey --dwfs-root # dwfs/root_key: every org's workspace key
anastroctl cluster bundle rekey --integrations # integrations/kek: GitHub, MCP servers, Linear, …
anastroctl cluster bundle rekey --onepassword # onepassword/kek: 1Password service account tokens
anastroctl cluster bundle rekey --inference # inference/kek: inference account credentials

Each writes a fresh key to secrets.age with the old one beside it (<key>_previous), pushes both to every control-plane node that holds the key, waits for each node to re-wrap everything under the new key, and drops the old one. Values only get a new wrapped data key, so nothing that compares them sees a change. If interrupted, simply re-run it to finish, then commit the updated secrets.age.

Control-plane nodes also run an encrypted secret store in Postgres (secretd), wrapped by secrets/kek. Cluster admins manage it with:

Terminal window
anastroctl cluster secret list
anastroctl cluster secret set <path> # stdin or hidden prompt
anastroctl cluster secret get <path> --reveal # requires recent device sign-in; audited
anastroctl cluster secret rotate <path> # generates 32 random bytes nobody sees
anastroctl cluster secret delete <path>

Every write, read, and reveal is audited.

You can attach service consumers to a non-bootstrap secret in the cluster store so new versions deliver directly as systemd credentials:

Terminal window
anastroctl cluster secret set storage/workspaces/secret_access_key --consumer apid
anastroctl cluster secret get storage/workspaces/secret_access_key
anastroctl cluster secret rotate storage/workspaces/secret_access_key --value
  • --consumer (repeatable) sets the list of services receiving that secret; removing a consumer or deleting the secret removes its delivered credential.
  • rotate --value prompts or reads a replacement from stdin; omitting --value generates 32 random bytes. Use get <path> --reveal --version <n> to inspect a retained previous version.
  • Nodes roll out updated credentials and restart consumers one node at a time. If a restart fails or stalls, that node holds the rollout lock until it succeeds on retry so two nodes never restart at once. (If that node is permanently lost, verify its restart job has stopped before clearing the lock—see the storage secrets validation notes.)

Bootstrap keys—Postgres passwords, DWFS keys, inference/integration keys, the recovery key, and secrets/kek—always stay in secrets.age, and store delivery excludes secretd, keyd, Postgres, and etcd. Keep secrets.age up to date for reinstalls and disaster recovery.

To let orgs connect 1Password for project secrets, enable the integration in anastro.toml:

[integrations.onepassword]
enabled = true
connect_url = "" # optional: point at an org's 1Password Connect server instead of the SDK

If your bundle predates onepassword/kek or integrations/kek, run anastroctl cluster bundle init, then cluster unseal and cluster apply. Nothing extra needs to be installed—the node image bundles the 1Password SDK (op-sdk) alongside opd, which seals org service-account tokens. Control-plane nodes need outbound HTTPS to *.1password.com (or your connect_url).

When disabled, 1Password settings stay hidden in the UI and org 1password commands report it’s off.

Object storage: configure the buckets for backups and workspaces.