Skip to main content

Rotating platform secrets

Replace the built-in default values of secrets.key, system.secret, and hashing.salt, and learn what rotating each of the three costs.

The warnings in your startup logs​

SecureAuth ships with default values for secrets.key, system.secret, and hashing.salt in its reference configuration. Those values are the same for every installation, so every production deployment must replace them with its own.

acp server start inspects the values at startup and logs a warning for each condition it finds. None of the checks block anything: the server starts and keeps running either way.

The warnings come from acp server start only. Other commands, including the migration job, do not log them.

Each of the following sections describes one warning and what to do about it.

caution

Never reuse a value from the reference configuration, from this documentation, or from any example. Generate a new random value for every deployment.

secrets.key or system.secret at the default​

The server names every key whose active value is still the built-in default:

{"level":"warning","msg":"secrets.key, system.secret still set to the published built-in default; set your own values or enable features.insecure_allow_default_secrets, see …","time":"2026-01-15T09:21:44Z"}

When only one of the two is at its default, only that one is named. The real line ends with a link to this page, trimmed here.

Fix the keys the warning names:

  1. Set your own secrets.key, following Rotating secrets.key.
  2. Set your own system.secret, following Changing system.secret.
  3. Restart the deployment.

For system.secret, the config change is not the whole fix. On an install that already has a system tenant, it does not rewrite the secret the system client was seeded with. Rotate that client's secret as well, as described in Changing system.secret.

hashing.salt at the default​

{"level":"warning","msg":"hashing.salt is still set to the published built-in default; it hashes every stored client secret and OTP so it cannot be changed in place on a deployment that already holds data, set it before the first start, see …","time":"2026-01-15T09:21:44Z"}

The real line ends with a link to this page, trimmed here. On a new install, set your own salt before the first start. On a deployment that already holds data, this one cannot be fixed by editing the config: see Setting hashing.salt.

A default key behind the active one​

{"level":"warning","msg":"secrets still contains a published default key behind the active one; it can decrypt records written before the rotation, remove it once no data depends on it","time":"2026-01-15T09:21:44Z"}

This is the state a completed secrets.key rotation leaves behind, and it is expected until the last record encrypted with the old key has been rewritten. See Rotating secrets.key.

Seeding features enabled​

{"level":"warning","msg":"features demo_app, swagger_ui seed clients with the published default system secret; do not enable them on an internet-facing deployment","time":"2026-01-15T09:21:44Z"}

Only the enabled features are named. See Features that seed the default secret.

The checks turned off​

{"level":"warning","msg":"features dev_mode disable the published default secret checks; secrets.key, system.secret and hashing.salt are not verified","time":"2026-01-15T09:21:44Z"}

features.dev_mode and features.insecure_allow_default_secrets both suppress the other four warnings, and the warning names whichever ones are set. See Suppressing the warnings.

Rotating secrets.key​

secrets.key encrypts data stored in the SQL database. It is configured as a list, and every entry has an id and a key:

secrets:
- id: "2"
key: <your new random key>
- id: "1"
key: <your previous key>

In a Helm deployment, the same list goes under secretConfig.data, the block that becomes the Kubernetes Secret:

secretConfig:
create: true
name: secret
data:
secrets:
- id: "2"
key: <your new random key>
- id: "1"
key: <your previous key>

secrets is a top-level configuration key and a list, so it stays a list here. For where system.secret goes in the same block, see Configuring SecureAuth Platform.

The first entry in the list encrypts new data. Every entry in the list, including the trailing ones, can decrypt data that was encrypted with it. That is what makes rotation possible without downtime.

The startup check looks at the first entry when it decides whether the active key is the built-in default. A default in a trailing position is the correct end state of a rotation, so it gets its own, milder warning instead.

To rotate:

  1. Generate a new random key.
  2. Append it to the end of the secrets list with an id that is not already used, and roll the change out to every instance. Every instance can now decrypt with the new key, but none encrypts with it yet.
  3. Move the new entry to the first position, keeping the previous entry in the list, and roll that change out. New writes are encrypted with the new key.
  4. Remove the previous entry only when no data depends on it.

Do not combine steps 2 and 3 into one rollout. During a rolling restart, the instances that already restarted encrypt with the new key. The instances that have not restarted yet cannot decrypt what they write.

Keep the previous entry until step 4. Records written before the rotation are still encrypted with it, and removing it makes them unreadable.

danger

Removing a trailing entry while records are still encrypted under it loses that data. There is no recovery: the key is the only way to decrypt it.

SecureAuth has no re-encryption sweep. Records written before the rotation keep their old encryption until normal use rewrites them, and nothing reports when the last one is gone. That is why the trailing entry stays, and why a deployment that rotated away from the built-in default keeps logging the trailing-key warning on every start.

Remove the entry when you are confident no record still needs it.

Setting hashing.salt​

hashing.salt is the PBKDF2 salt used to hash every stored client secret and every one-time password. There is no multi-salt equivalent of the secrets list: one salt hashes everything, and a stored hash cannot be converted to a different salt.

Set hashing.salt at install time, before the first start. There is no supported in-place rotation for it.

Change it on a deployment that already holds data, and every stored client secret and OTP stops verifying. That includes the system tenant's own. The admin workspace then rejects system.secret, because the stored hash is not re-derived on a later start, so you cannot sign in to reissue anything. Changing hashing.salt on a running deployment is a planned migration that has to re-create or re-seed those credentials. Contact support before attempting it.

This is why the warning about hashing.salt is informational on an install that already holds data. There is nothing safe to change in the configuration file, so treat the warning as a record of the deployment's state rather than as an action for today.

On an install that has not started yet, no client secret has been hashed, so there is nothing to lock out. Set your own salt before that first start, and you never face the migration.

The same applies to any start that seeds new credentials, such as one run with --create-default-tenant. Those client secrets are hashed with whatever salt is configured at the time, and there is no way to re-hash them afterwards. Set your own hashing.salt before you seed anything you intend to keep.

Changing system.secret​

system.secret is the system tenant's client secret. It is also the initial password of the admin user of the system tenant admin workspace.

system.secret is read when a tenant is seeded. On an existing install, changing it in config is half the job:

  1. Set system.secret to a new random value in your configuration or in the Kubernetes secret that holds it, and restart. That clears the warning, and it governs any tenant seeded from then on.
  2. Rotate the secret of the system client that already exists, through the admin console or the admin API. See Client secrets management.
  3. Switch everything that authenticates as the system client to the new secret, then revoke the rotated secrets. Rotation keeps the previous secret valid until you revoke it.
  4. Change the password of the admin user in the Default static identity provider of the admin workspace. That password was seeded from system.secret separately from the client, and steps 2 and 3 do not change it.
caution

Step 1 alone changes nothing that is already stored. The existing system client and the admin user keep the values they were seeded with until you complete steps 2 to 4.

The same applies to every other seeded client. SecureAuth does not rewrite the secret of a swagger or demo client that already exists. If such a client holds the built-in default, rotate its secret and then revoke the rotated secrets, or delete the client.

For where system.secret lives in a Helm deployment, see Configuring SecureAuth Platform and Hardening guidelines for SecureAuth on K8s.

Features that seed the default secret​

features.demo_app and features.swagger_ui seed clients using the default system secret. Unless the warnings are suppressed, enabling either one logs a warning at start.

Keep both disabled on any deployment that is reachable from the internet. If either was enabled at some point, check the admin workspace for the clients it seeded and rotate and revoke their secrets, or delete them, as described in Changing system.secret.

Suppressing the warnings​

features.insecure_allow_default_secrets turns the default secret warnings off:

features:
insecure_allow_default_secrets: true

With it set, nothing checks secrets.key, system.secret, or hashing.salt, and none of the warnings above are logged. One warning naming the flag is logged instead, so the opt-out stays visible in a support bundle.

features.dev_mode suppresses the same warnings, and logs the same warning naming dev_mode. Local and development deployments are therefore quiet by default.

Silencing a warning does not change what the deployment runs on. It still uses the default values, and that is not a supported configuration for anything that handles real traffic. Use the flag to keep logs readable while you prepare the real values, and remove it in the same change that sets them.