Skip to content

Harden JWT key handling and redact secrets from command logs - #740

Open
tomsmith8 wants to merge 2 commits into
masterfrom
bugfix/cmtilo7av0007l704jnqxch58-harden-jwt-key-and-redact-logs-1788272196
Open

Harden JWT key handling and redact secrets from command logs#740
tomsmith8 wants to merge 2 commits into
masterfrom
bugfix/cmtilo7av0007l704jnqxch58-harden-jwt-key-and-redact-logs-1788272196

Conversation

@tomsmith8

Copy link
Copy Markdown
Contributor

Summary

  • Remove the hardcoded "some-secret" JWT fallback: an empty/blank key is now a hard error, and when no key is configured a random 48-char key is generated once per process (rotates on restart)
  • Add set_jwt_key_from_config so an empty stack config value means "not configured" while a blank-but-set value still fails startup
  • Redact secrets from Debug output of LoginInfo, ChangePasswordInfo, ChangeAdminInfo, ChangeUserPasswordBySuperAdminInfo, UpdateEnvRequest, and AssignSwarmNewDetails so log::info!("=> CMD: {:?}", cmd) never leaks passwords or env values (keys are logged, values replaced with [REDACTED])
  • Log env variable updates as key lists only instead of full values
  • Add IDOR guards: password-change commands must target the authenticated caller's own user id
  • Add unit tests covering key validation, redaction, and access control

Generated with Hive

@tomsmith8 tomsmith8 added the user label Sep 1, 2026 — with Hive Chat PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants