fix(ingest): persist JWT signing key in database to survive volume resets#194
Merged
Conversation
…sets When the ingest container is restarted without a persistent volume the RSA keypair is regenerated, invalidating all existing agent JWTs with a signature verification error (not just an expiry error). This caused software inventory to fail silently for any agent that registered before the last restart. - Add system_config table (key/value) for system-level settings not scoped to an organisation - On startup, load the JWT private key from system_config first, then fall back to the key file, and finally generate a fresh key — writing it back to the database in all cases so subsequent restarts find it there - This makes the JWT signing key resilient to Docker volume loss Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crypto/rsa: verification erroron all existing agent JWTs — agents can still heartbeat (the heartbeat handler has a fallback), but software inventory streaming fails silently withUnauthenticated.system_configdatabase table first, then fall back to the key file, and finally generate fresh — writing it back to DB in all cases. The key now survives volume resets because it lives in PostgreSQL.system_configtable (key/value, no org scope) for system-level settings.Test plan
system_configtable on first startup🤖 Generated with Claude Code