Rotating keys and secrets

Replace the key-ring certificate, connection credentials, model keys and the webhook secrets.

Synaxis keeps every credential it uses (GitHub App keys, Azure DevOps credentials, model keys, webhook secrets, people's upstream tokens) as a named secret in PostgreSQL, encrypted with a key ring. The key ring itself is protected by your key-encryption key: a certificate or an Azure Key Vault key. Secret values never appear in logs, exports or the audit log.

Stored secrets

To set or replace a stored secret, give its name and the value from a file or standard input:

synaxis secret set anthropic --from-file anthropic-key.txt
synaxis secret set openai < openai-key.txt

Synaxis reads the new value the next time it needs the secret, without a restart. Connections shows, for each connection, its secrets and how long ago each was set, a secret that is not stored, and when a certificate expires.

To rotate Do
A GitHub App private key Generate a new key on GitHub, synaxis secret set gh-app-key --from-file new-key.pem, then delete the old key on GitHub
A GitHub App webhook secret Set the new secret on the App in GitHub and store it under the connection's webhook secret name
An Azure DevOps client secret, certificate or token Create the new one in Entra ID or Azure DevOps, store it under the connection's credential name, then select Test on Connections
A model or embedding key On Available (Chat) or Available (Embedding), select the record's Edit, enter the new API key and save; the server tests the record's models again. Or store the new key under the record's secret name
A single sign-on client secret Store the new value under the provider's ClientSecretRef, or replace the mounted file and restart

The key-ring certificate

Rotate the key-encryption certificate before it expires, or if it may be exposed:

  1. Make a new PKCS#12 certificate, as at install.
  2. Mount it as the key-ring certificate, and keep the old one available beside it as a previous certificate (KeyRing:PreviousCertificateFiles, for example SYNAXIS_KeyRing__PreviousCertificateFiles__0). Synaxis keeps unwrapping what the old certificate wrapped.
  3. Restart the replicas. The keys are wrapped with the new certificate at start.
  4. Back up the new certificate and its password with your database backups.

On Kubernetes, put the new certificate in the Secret that keyRing.certificate.existingSecret names and mount the old one with extraVolumes and extraVolumeMounts.

Note: Never delete the key-ring certificate (or the Key Vault key) while a database backup that needs it may be restored. Without it, the stored secrets in that backup cannot be decrypted.

What rotates by itself

  • The key ring's data keys, every 90 days.
  • The signing keys of the tokens Synaxis issues, every 90 days. Retired public keys stay published for a day, longer than any access token they signed.
  • GitHub installation tokens (an hour) and Azure DevOps app tokens, before they expire.

See also