15 A lost secret
| What was lost | What to do | What you lose |
|---|---|---|
SETTINGS_ENCRYPTION_KEY, or AUTH_SECRET when that is unset | Set a new one. Re-enter each integration secret under Settings → Integrations, and each webhook's address and secret under its notification rule. An administrator resets two-step verification for each enrolled user under Settings → Users | The stored secrets, which read as empty, with settings.decrypt_failed in the log. Every webhook's address and signing secret. All two-step enrollments and recovery codes |
AUTH_SECRET, with SETTINGS_ENCRYPTION_KEY set | Set a new one | Sessions and SAML sign-ins in progress. Nothing else |
POSTGRES_PASSWORD | The password is kept in the database volume, and a local connection inside the db container needs none. Put a new value in .env, then run docker compose exec db sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB"' and type \password grc with your owner's name, entering the same value. On a new deployment, choose any value before restoring | Nothing |
APP_DB_PASSWORD | Set a new one in .env, and run docker compose up -d | Nothing |
| The age private key | Create a new key, and take a new backup at once | Every backup encrypted to the old key |
If every administrator is locked out by two-step verification, no one can reset the others, as nobody can reset their own. Clear it for one administrator from the server, then have them reset the rest under Settings → Users:
docker compose run --rm --no-deps worker ./node_modules/.bin/tsx --tsconfig tsconfig.worker.json src/lib/jobs/mfa-recover.ts --email [email protected] --confirm
Off Docker, run ./node_modules/.bin/tsx --tsconfig tsconfig.worker.json src/lib/jobs/mfa-recover.ts --email [email protected] --confirm wherever the worker runs, with its
settings. The command:
- Removes that administrator's secret, any setup in progress and their recovery codes, clears their locked code attempts and ends their sessions. Their password doesn't change.
- Writes
mfa.reset.hostto the audit log, with the actorhost command (mfa:recover). - Queues an alert to every active administrator, and an email to that person. It says if an alert couldn't be queued. A queued email still needs the worker and a working mail server, and the reset doesn't wait for either, so tell the others yourself when email is down.
- Flags them to set two-step up again. Their next password or LDAP sign-in stops at the setup, and they can't use the application in a browser until it's done, whether or not Require two-step verification is on. Setting it up clears the flag.
- Leaves API tokens they created working, as a token doesn't ask for two-step, and prints how many. This is for a lost
code, and revoking would stop whatever those tokens run. If you suspect a compromise, add
--revoke-tokens: it revokes every live token they created in the same step, audits each one as a revocation under Settings would be, and says so in the alert. Whatever used those tokens needs new ones.
It refuses, and changes nothing, for a person who isn't an administrator, a deactivated administrator, an administrator with no two-step set up, and one who signs in through SSO. SSO never asks for this code, so clearing it wouldn't help. With SSO-only sign-in on, use a break-glass administrator. It can't be run on a demo instance.
Who can run it: anyone who can run commands on the server or in its containers. No password or code is asked for. Host access is the trust boundary here, as it is for the database itself, so keep it as tightly held as an administrator's account. The audit entry and the alert are how the others find out.