Skip to content

docs(5090): JWT rotation + runtime secrets hydration runbook - #3213

Draft
POWERFULMOVES wants to merge 2 commits into
mainfrom
docs/5090-jwt-rotation-runbook
Draft

POWERFULMOVES wants to merge 2 commits into
mainfrom
docs/5090-jwt-rotation-runbook

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

Operator runbook for rotating JWT secrets and hydrating runtime credentials on the 5090 node. Methodology proven on DARKXSIDE (PR #3204); tooling grounded in #2956 runtime_secrets_hydrate.py (container-only core creds, dry-run mode). Four phases: hydrate, rotate, recreate, verify. Acceptance criteria + rollback included.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: POWERFULMOVES/PMOVES.AI/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 308d8d2e-4b1f-4f51-a900-28cdb95c60e2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the docs Documentation label Sep 28, 2026
@kilo-code-bot

kilo-code-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

The review did not run because the selected model is no longer available.

Choose another model in Kilo Code review settings: https://app.kilo.ai/code-reviews

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Review (B850-CLAUDE code-review body, assisting the merge wave): REQUEST-CHANGES

Secrets/topology: clean (no JWTs, secrets or LAN IPs). Commands mostly exist on main (supa-status at pmoves/Makefile:1089, runtime_secrets_hydrate.py --dry-run).

P1 (in pmoves/docs/RUNBOOK-5090-JWT-ROTATION.md)

  1. No real rollback (lines 71-79, 134-138). Step 7 runs sed -i with no backup step, yet Rollback says "restore from backup" and "the old JWT secret is still in the env files". After step 7 the old secret exists nowhere. Add a timestamped backup before any edit, and make Rollback restore from it.
  2. Partial recreate leaves services on the old secret (line 97). Only kong, postgrest, gotrue and pmoves-ui are recreated, while about 20 other services consume JWT_SECRET, SERVICE_ROLE_KEY or ANON_KEY (supabase realtime, storage, edge-functions, studio, pooler, plus agent-zero, cipher-api, p7-room-orchestrator, gateway-agent, model-registry, botz-gateway…). They would fail auth after rotation. Use the existing recreate-svc / supa-restart roads and enumerate the consumers.
  3. No working directory makes every step work (lines 22-34, 71, 88-96). Steps 1-2 and 8 need pmoves/, and step 4 needs the root. Run from the root, step 7's [ -f "$f" ] || continue silently skips every env file, so Phase 3 recreates with unchanged env. Pin one cwd, and fail loudly if an expected env file is missing.

P2: the new secret and keys go to world-readable /tmp files, and the secret appears in sed argv (visible in ps): use umask 077/mktemp and avoid argv. || echo 'changeme' (line 91) silently falls back to a default dashboard credential. The a0-plugins gitlink bump does not belong in a docs PR: it goes SIDEWAYS (drops 167 commits, pins the fork's main rather than Hardened), the gitlink gate fails on it, and it collides with #3210.

P3: line 130 says POST /api/health while the curl is a GET. Warn that rotation invalidates all existing sessions and tokens. The provenance link pmoves/chat-corpus/ITERATIONS.md is absent on main (#3204 is still open).

🤖 Generated with Claude Code

@POWERFULMOVES
POWERFULMOVES marked this pull request as draft September 28, 2026 15:36
@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Converted to draft by B850-CLAUDE (Knuckles), operator-directed 2026-09-28. As reviewed above, the runbook has no working rollback (step 7 overwrites the JWT secret with no backup), recreates only 4 of about 20 key consumers, and run from the repo root step 7 silently skips every env file. Anyone following it could lock services out with no way back. It also carries a SIDEWAYS a0-plugins gitlink (drops 167 commits) that fails the gitlink gate. To release it: address the P1s, drop or fix the gitlink bump, then mark Ready for review.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant