feat(moni): add API key rotation command#45
Merged
CodeMonkeyCybersecurity merged 2 commits intomainfrom Nov 13, 2025
Merged
Conversation
Implements 'eos update moni rotate-api-keys' command to rotate LiteLLM virtual keys for Moni/BionicGPT deployment. Changes: - Added pkg/bionicgpt/rotate_api_keys.go with full rotation logic - Updated pkg/bionicgpt/types.go with rotation constants and types - Added rotate-api-keys subcommand to cmd/update/moni.go Features: - ASSESS → INTERVENE → EVALUATE pattern implementation - Automatic .env backup before changes - Transaction-like behavior with rollback on failure - Generates new virtual key via LiteLLM API - Updates .env file (OPENAI_API_KEY, EMBEDDINGS_API_KEY) - Updates database models table with new key - Restarts app container to pick up changes - Comprehensive verification tests - Deletes old key after successful rotation Safety: - Dry-run mode (--dry-run) to preview changes - Skip backup option (--skip-backup, not recommended) - Skip verification option (--skip-verify) - Skip restart option (--skip-restart) - Custom install directory (--install-dir) Architecture compliance: - Business logic in pkg/, orchestration in cmd/ - Structured logging throughout - No hardcoded values (all constants defined) - Error context with remediation steps - Uses execute package for Docker operations Replaces manual bash script with integrated Eos command.
…gZkrecW3LCZmP Signed-off-by: cybermonkey <git@cybermonkey.net.au>
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.
Implements 'eos update moni rotate-api-keys' command to rotate LiteLLM virtual keys for Moni/BionicGPT deployment.
Changes:
Features:
Safety:
Architecture compliance:
Replaces manual bash script with integrated Eos command.