Skip to content

Prevent ADMIN_KEY envar from recreating existing auth key - #444

Open
jeremiah-RENISAC wants to merge 2 commits into
MISP:masterfrom
jeremiah-RENISAC:master
Open

jeremiah-RENISAC wants to merge 2 commits into
MISP:masterfrom
jeremiah-RENISAC:master

Conversation

@jeremiah-RENISAC

@jeremiah-RENISAC jeremiah-RENISAC commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #443

Adds a check when the environment variable "ADMIN_KEY" is set to see if user 1's key is already set to the same value by hash match, and if so, skips the change_authkey command. When change_authkey is run, it expires the current key and recreates a new duplicate entry without preserving any allowed ips.

@jeremiah-RENISAC

Copy link
Copy Markdown
Contributor Author

Tested the new image:

  • Redeploy with same ADMIN_KEY value triggers the "configured admin key already active, not changing" path
  • Changing the ADMIN_KEY value and redeploying triggers the "setting admin key from environment variable" path

@ostefano

Copy link
Copy Markdown
Collaborator

@righel can you help reviewing this?

@ostefano
ostefano requested a review from righel September 10, 2026 11:55
@ostefano ostefano self-assigned this Sep 10, 2026
@ostefano ostefano added enhancement New feature or request scheduled Will merge at the next opportunity labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scheduled Will merge at the next opportunity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADMIN_KEY envar expires and recreates matching keys on startup without preserving allow lists

2 participants