Skip to content

Secrets ​

Which secrets the server has, where each is kept, and what happens when one changes. Read this before rotating anything: two of them cannot be changed without losing what they protect.

The secrets ​

SecretProtectsKept inIf it changes
SESSION_SECRETSession cookies/data (generated)Everyone signs in again. Nothing else is lost.
JOOBQUI_SECRETS_KEYNotification-channel secrets, two-factor secrets, secret settings saved in the console/data (generated)Everything sealed with it becomes unreadable. See below.
JOOBQUI_PAYLOAD_KEYSSealed job arguments/data (generated)Rotated safely by adding a key: see below.
The bootstrap key (/data/joobqui.key or JOOBQUI_BOOTSTRAP_KEY)The settings file /data/joobqui.confBeside the file, or with youThe file cannot be opened: see Recovery.
The SDK tokenThe SDK gatewayPostgreSQL, sealed (Settings → Security)Workers are refused until they have the new one.
API tokensThe APIPostgreSQL, as a hashSee Accounts, SSO, 2FA, roles.
PostgreSQL, Redis, SMTP and single sign-on passwordsTheir services/data or PostgreSQL, sealedChange at the provider, enter the new value, restart.

The three generated secrets are not rotated by the console or by a command, and the settings file is not meant to be edited. To take one over, set its variable in the environment of every server instance; from then on the environment's value is the one in use, and yours to keep.

Rotate the session secret ​

  1. Set a new SESSION_SECRET (32 characters or more, openssl rand -hex 32) on every instance.
  2. Restart every instance. Everyone signs in again.

Rotate the payload keys ​

JOOBQUI_PAYLOAD_KEYS is a list of id:key entries. The first seals; all of them open.

  1. Put a new entry first and keep the old one after it: k2:<new key>,k1:<old key>.
  2. Restart every server instance with the new list.
  3. Wait until no job sealed with the old key can be left: queues, retries, scheduled jobs and dead letters.
  4. Remove the old entry.

A job whose key is gone is not run: it goes to the dead letters, still sealed, and can be retried once the key is back. See Payload encryption.

Rotate the SDK token ​

  1. Save the new token in Settings → Security. It applies within seconds, and the old one stops working.
  2. Restart the workers with the new value. Until then they get 401 sdk_token_required. A task one of them holds cannot be acknowledged, so its lease expires and it runs again with one retry used.

There is one token at a time. To lose no retries, stop the workers, save the token, and start them with it.

Do not rotate the secrets key ​

There is no tool that seals stored values again under a new key. If JOOBQUI_SECRETS_KEY changes:

  • notification channels stay listed but cannot send until an admin enters their URL and key again;
  • every account with a second factor is refused at sign-in until an admin resets it (Access → Reset 2FA, or ./joobqui accounts:mfa:reset EMAIL) and the person enrols again;
  • secret settings saved in the console (the mail password, the SDK token) are ignored with a warning until they are saved again.

Change it only when it has leaked, and plan for those three steps.

Rotate a service password ​

For PostgreSQL, Redis, SMTP and the single sign-on client secret: change the password at the provider, enter the new one where the old one was (the Settings page, or the environment), and restart every instance. Workers are not affected: they hold none of these.

After a leak ​

What leakedDo
An API tokenRevoke it on the Access page: it stops working at once. Then read the audit log for what it did. A token from JOOBQUI_API_TOKENS is removed from the variable, with a restart.
The SDK tokenRotate it (above).
The session secretRotate it (above).
The /data volume or a backup of itTreat all of the above as leaked, and the licence too: disable the server on the portal's licensing page and connect it again.