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
| Secret | Protects | Kept in | If it changes |
|---|---|---|---|
SESSION_SECRET | Session cookies | /data (generated) | Everyone signs in again. Nothing else is lost. |
JOOBQUI_SECRETS_KEY | Notification-channel secrets, two-factor secrets, secret settings saved in the console | /data (generated) | Everything sealed with it becomes unreadable. See below. |
JOOBQUI_PAYLOAD_KEYS | Sealed 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.conf | Beside the file, or with you | The file cannot be opened: see Recovery. |
| The SDK token | The SDK gateway | PostgreSQL, sealed (Settings → Security) | Workers are refused until they have the new one. |
| API tokens | The API | PostgreSQL, as a hash | See Accounts, SSO, 2FA, roles. |
| PostgreSQL, Redis, SMTP and single sign-on passwords | Their services | /data or PostgreSQL, sealed | Change 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
- Set a new
SESSION_SECRET(32 characters or more,openssl rand -hex 32) on every instance. - 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.
- Put a new entry first and keep the old one after it:
k2:<new key>,k1:<old key>. - Restart every server instance with the new list.
- Wait until no job sealed with the old key can be left: queues, retries, scheduled jobs and dead letters.
- 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
- Save the new token in Settings → Security. It applies within seconds, and the old one stops working.
- 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 leaked | Do |
|---|---|
| An API token | Revoke 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 token | Rotate it (above). |
| The session secret | Rotate it (above). |
The /data volume or a backup of it | Treat all of the above as leaked, and the licence too: disable the server on the portal's licensing page and connect it again. |