SEQN Auth Key Rotation Runbook
This runbook covers rotation for SEQN Auth credentials, including SMTP deployment credentials. Payment-provider flows remain out of scope.
Credential inventory
| Credential | Prefix or env | Owner | Rotation impact |
|---|---|---|---|
| Publishable project key | pk_live_ | App/admin console | Browser-safe; rotate only by creating or recreating projects. |
| Project secret key | sk_live_ | App backend | Backend integrations fail until consumers receive the new key. |
| Webhook signing secret | whsec_ | Webhook receiver | Receivers fail signature validation until they accept the new secret. |
| OIDC client secret | OIDC_CLIENT_SECRET | Silver Auth API/Authentik | New login callbacks can fail if API and Authentik disagree. |
| Authentik API token | AUTHENTIK_API_TOKEN | Silver Auth API/Authentik | Project provisioning is blocked while invalid. |
| Session secret | SESSION_SECRET | Silver Auth API | Existing app sessions and pending-login cookies are invalidated. |
| Application secret hash secret | APPLICATION_SECRET_HASH_SECRET | Silver Auth API | Existing sk_live_ verification fails unless the value is preserved or project secrets are reissued. |
| Invitation token hash secret | INVITATION_TOKEN_HASH_SECRET | Silver Auth API | Outstanding invite links fail unless the value is preserved or links are reissued. |
| Webhook secret hash/encryption secrets | WEBHOOK_SECRET_HASH_SECRET, WEBHOOK_SECRET_ENCRYPTION_SECRET | Silver Auth API | Existing webhook secret metadata cannot be verified/decrypted unless values are preserved or webhook secrets are reissued. |
| Google OAuth secret hash/encryption secrets | GOOGLE_OAUTH_SECRET_HASH_SECRET, GOOGLE_OAUTH_SECRET_ENCRYPTION_SECRET | Silver Auth API | Stored customer-owned Google OAuth secret metadata cannot be verified/decrypted unless values are preserved or credentials are re-saved. |
| SMTP credentials | SMTP_USERNAME, SMTP_PASSWORD, SMTP_FROM_EMAIL | VPS ops / email provider | Invitation email delivery fails until the new credentials are saved and the API is recreated. |
| Database passwords | AUTHENTIK_PG_PASS, SILVER_POSTGRES_PASSWORD | VPS ops | Requires coordinated database and service restart. |
| Backup encryption key | OFFSITE_BACKUP_AGE_RECIPIENT or OFFSITE_BACKUP_GPG_RECIPIENT | VPS ops | Old backups require the old private key until retention expires. |
Standard safety rules
- Take a fresh local backup before high-blast-radius rotations.
- Keep a dated incident or maintenance note with actor, reason, scope, and rollback plan.
- Never paste raw secrets into docs, alerts, screenshots, support tickets, or chat.
- Prefer secret stores and one-time terminals over local files.
- Rotate canaries first when possible.
Project secret key rotation
Use for exposed sk_live_ keys, environment moves, or scheduled hygiene.
- Identify the project and backend consumers.
- Prepare the receiving app secret store for the new value.
- In the hosted console, rotate the project secret.
- Copy the one-time
sk_live_value directly into the backend secret store. - Restart or redeploy the backend consumers.
- Run
GET /v1/backend/applicationfrom the backend environment. - Confirm no new
invalid_secret_keyerrors.
Current rotation replaces the valid secret immediately, so schedule production rotations when consumers can be updated at the same time.
Webhook signing secret rotation
Use for exposed whsec_ values or scheduled receiver hygiene.
- Confirm the receiver can accept a new secret.
- If the receiver supports dual secrets, add a pending new secret slot.
- Rotate the webhook endpoint secret in the hosted console.
- Copy the one-time
whsec_value into the receiver secret store. - Send a test webhook event.
- Confirm delivery logs show successful signatures.
- Remove the old receiver secret after the grace window.
If the receiver cannot accept dual secrets, schedule a short maintenance window because outgoing signatures switch immediately.
OIDC client secret rotation
- Take a fresh local backup.
- Create or rotate the client secret on the Authentik OAuth2 provider for
silver-auth. - Update the VPS
.envvalue forOIDC_CLIENT_SECRET. - Recreate only the
silver-auth-apicontainer. - Start a fresh login from an incognito browser.
- Confirm
/auth/callbackcompletes and/v1/mereturns the signed-in user.
Active sessions should continue unless SESSION_SECRET also changes.
Authentik API token rotation
- Create a replacement Authentik API token with the same minimum provisioning permissions.
- Update
AUTHENTIK_API_TOKENin the VPS.env. - Recreate only the
silver-auth-apicontainer. - Create or update a canary project.
- Confirm provisioning status is
synced. - Revoke the old Authentik token.
Session secret rotation
SESSION_SECRET protects opaque session token hashes/cookies and signed pending-login cookies. Rotation signs users out and invalidates in-progress login handoffs, but it should not invalidate project secret keys, invitation links, webhook secret metadata, or stored Google OAuth credential metadata when the dedicated secret-domain env vars are preserved.
- Announce a maintenance window.
- Take a fresh local backup.
- Replace
SESSION_SECRETwith at least 32 random characters. - Recreate
silver-auth-api. - Confirm anonymous users redirect to login and new sessions work.
- Monitor support channels for forced sign-in reports.
Secret-domain env rotation
Use this when rotating the dedicated hash/encryption env vars. Prefer preserving the old value until you can reissue the affected customer-facing secret; rotating these values without reissue is intentionally disruptive.
- Take a fresh local backup.
- Identify the affected domain: project secrets, invitation links, webhooks, or Google OAuth credentials.
- Replace only the matching
*_SECRETenv var. - Recreate
silver-auth-api. - Reissue the affected project secret, invitation link, webhook signing secret, or Google OAuth credential.
- Run the matching smoke: backend key health, invitation acceptance, webhook test delivery, or Google OAuth credential status.
Database password rotation
- Take a fresh local and offsite backup.
- Stop write traffic if possible.
- Rotate the Postgres role password inside the target database.
- Update the matching
.envvariable. - Recreate dependent containers.
- Confirm
/healthz,/v1/config, login, and admin console access.
SMTP credential rotation
- Create the replacement SMTP credential or app password in the email provider.
- Update
SMTP_USERNAME,SMTP_PASSWORD, and sender values in the VPS.env. - Recreate only the
silver-auth-apicontainer. - Create a canary invitation and confirm the email delivery status is
sent. - Revoke the old SMTP credential.
Backup encryption key rotation
- Add the new public recipient to
.env. - Run
backup-offsite.sh. - Confirm the new archive can be decrypted by the new private key.
- Keep the old private key until all old encrypted backups pass retention.
- Remove the old private key only after restore coverage is no longer needed.