🔒Security & Encryption
ProxmoxMCP now supports secure encryption of API tokens and other sensitive configuration values at rest.
Features
Fernet Encryption: Industry-standard AES 128 in CBC mode with HMAC SHA256 authentication
Secure Key Derivation: PBKDF2 with salt to prevent rainbow table attacks
Environment-based Keys: Master keys stored separately from encrypted data
Backward Compatibility: Existing plain-text configurations continue to work
CLI Tools: Easy-to-use command-line utilities for encryption management
Quick Start
1. Generate a Master Key
Security Note: The key generation process now includes enhanced security measures that prevent the key from being exposed in terminal history or log files during automatic generation.
2. Encrypt Your Configuration
3. Use Encrypted Configuration
CLI Reference
Encrypt Configuration File
Check Encryption Status
Generate Master Key
Master Key Rotation
ProxmoxMCP supports secure master key rotation for enhanced security compliance and incident response.
Rotate Key for Single Configuration
Rotate Key for All Configurations
Key Rotation Best Practices
Schedule Regular Rotations: Rotate master keys annually or after security incidents
Test Before Production: Always test rotated configurations before deploying
Coordinate Updates: Ensure all systems using the configuration are updated with the new key
Secure Backup Storage: Store configuration backups securely and separately from the new key
Monitor Rotation: Keep audit logs of key rotation activities
Configuration Format
Before Encryption
After Encryption
Environment Variables
PROXMOX_MCP_MASTER_KEY
Master encryption key
Yes (for encrypted configs)
PROXMOX_MCP_CONFIG
Path to config file
Yes
Security Best Practices
Store Keys Separately: Never store the master key in the same location as encrypted data
Use Environment Variables: Avoid hardcoding keys in scripts or configuration files
Rotate Keys Regularly: Generate new master keys periodically and re-encrypt configurations
Secure Key Storage: Use secure key management systems in production environments
Backup Safely: Ensure encrypted backups include both data and key recovery procedures
Clear Terminal History: After key generation, consider clearing terminal history to prevent exposure
Use CLI Tool: Always use the provided CLI tool for key generation rather than manual methods
Test After Rotation: Always verify configurations work after key rotation before production use
Coordinate Key Updates: Ensure all systems are updated with new keys during rotation
Audit Key Operations: Maintain logs of key generation, rotation, and usage activities
Migration from Plain Text
Existing configurations work without changes. To migrate:
Backup Current Config: Always backup your working configuration
Generate Master Key: Create and securely store a master key
Encrypt Configuration: Use the CLI tool to encrypt sensitive values
Update Environment: Set the master key environment variable
Test Thoroughly: Verify the server starts and connects successfully
Clean Up: Securely delete plain text configuration files
Troubleshooting
Common Issues
"Token decryption failed"
Verify
PROXMOX_MCP_MASTER_KEY
environment variable is set correctlyEnsure the master key matches the one used for encryption
"Config file not found"
Check
PROXMOX_MCP_CONFIG
environment variable points to correct fileVerify file permissions and path accessibility
"Invalid encrypted token format"
Encrypted tokens must start with
enc:
prefixVerify file wasn't corrupted during transfer or storage
Debug Mode
Enable debug logging to troubleshoot encryption issues:
Key Rotation Procedures
Key rotation is essential for maintaining long-term security. ProxmoxMCP provides comprehensive tools and procedures for safely rotating encryption keys.
When to Rotate Keys
Regular Schedule: Annually or as per your organization's security policy
Security Incidents: When compromise is suspected or confirmed
Personnel Changes: After team member departures or role changes
Major Deployments: Before critical releases or infrastructure changes
Compliance Requirements: As mandated by security frameworks (SOC2, ISO27001, etc.)
Pre-Rotation Checklist
Before starting key rotation, ensure you have:
Current Access: Ability to decrypt existing configurations
Backup Strategy: Secure backup procedures for configuration files
Testing Environment: Non-production environment for validation
Downtime Window: Planned maintenance window for service restarts
Rollback Plan: Procedures to revert if rotation fails
Team Coordination: All team members aware of the rotation schedule
Step-by-Step Rotation Procedure
1. Preparation Phase
2. Single Configuration Rotation
3. Bulk Configuration Rotation
4. Environment Update
5. Validation Phase
Zero-Downtime Rotation Strategies
Blue-Green Deployment
Prepare Green Environment: Deploy with new keys
Validate Green: Test all functionality
Switch Traffic: Update load balancer/proxy
Monitor: Ensure no errors
Cleanup Blue: Remove old environment after validation
Rolling Update
Rotate Keys: Generate new keys for configuration
Update Environment: Set new master key
Restart Service: Restart with new configuration
Validate: Confirm service operational
Update Monitoring: Ensure alerts still function
Rollback Procedures
If key rotation fails, follow these steps:
Immediate Rollback
Post-Rollback Analysis
Document Issue: Record what went wrong
Preserve Evidence: Keep failed configuration for analysis
Review Logs: Check server and application logs
Plan Fix: Address root cause before retry
Schedule Retry: Plan next rotation attempt
Advanced Key Management
Multi-Environment Key Management
Development Environment
Staging Environment
Production Environment
Key Management Lifecycle
Key Generation
Use CLI Tool: Always use the provided encryption utility
Secure Generation: Use cryptographically secure random generation
Document Creation: Log key generation events (not the keys themselves)
Immediate Storage: Store keys in secure key management systems
Key Storage
Separate Storage: Never store keys with encrypted data
Access Control: Implement strict access controls
Encryption at Rest: Encrypt keys in storage systems
Backup Keys: Maintain secure, encrypted backups
Key Distribution
Secure Channels: Use encrypted communication for key distribution
Just-in-Time: Provide keys only when needed
Audit Trail: Log key access and distribution
Temporary Access: Use short-lived keys where possible
Key Retirement
Secure Deletion: Use cryptographic erasure techniques
Audit Cleanup: Remove keys from all systems
Documentation: Update key management records
Compliance: Follow data retention policies
Disaster Recovery Scenarios
Lost Master Key
If you lose access to your master key:
Check Backups: Look for securely stored key backups
Emergency Access: Use disaster recovery key procedures
Re-encrypt Data: Use available plain-text configurations to re-encrypt
Update Systems: Deploy new configurations with new keys
Post-Incident: Review and improve key backup procedures
Corrupted Configuration
If configuration files become corrupted:
Stop Service: Prevent further issues
Restore Backup: Use most recent valid backup
Validate Restoration: Test with current master key
Resume Service: Restart with restored configuration
Investigate: Determine corruption cause
Compromised Keys
If key compromise is suspected:
Immediate Rotation: Start emergency key rotation
Revoke Access: Disable compromised keys
Audit Usage: Review key usage logs
Notify Stakeholders: Inform relevant parties
Update Procedures: Strengthen key protection
Troubleshooting Key Rotation
Common Rotation Issues
"Current master key cannot decrypt configuration"
Symptoms: Rotation fails during verification phase
Causes:
Wrong
PROXMOX_MCP_MASTER_KEY
environment variableConfiguration file corrupted
Key truncated or modified
Solutions:
"Failed to create backup"
Symptoms: Backup creation fails during rotation
Causes:
Insufficient disk space
Permission issues
File system errors
Solutions:
"Service fails to start with new key"
Symptoms: Server won't start after key rotation
Causes:
Environment variable not updated
Configuration cache issues
Service configuration problems
Solutions:
Debug Mode for Rotation
Enable detailed logging during rotation:
Validation Procedures After Rotation
Basic Connectivity Test
Full Integration Test
CI/CD Integration
GitHub Actions
GitLab CI
Automated Monitoring
Integration Examples
Docker Compose
Docker Swarm with Secrets
Kubernetes
Systemd Service
Environment file (/etc/proxmox-mcp/environment
):
For more information, see the main README.md or security documentation.
Last updated
Was this helpful?