ADR-0007: Root Key Lifecycle and Management Strategy
- Status: accepted
- Date: 2024-11-03
- Tags: Security
Context
Our system requires a robust and secure approach to managing the root key, which is fundamental to the entire security infrastructure. We need to establish:
- Key generation and storage policies
- Backup and recovery procedures
- Rotation policies
- Emergency recovery procedures
The root key is a critical security component that requires careful handling throughout its lifecycle while maintaining operational efficiency.
Decision
We will implement the following key management strategy:
Root Key Characteristics
- Long-lived key with periodic rotation
- Generated automatically by SPIKE Nexus
- Stored exclusively in memory, never on disk in plain text
Key Protection
- Administrator-provided password through SPIKE Pilot
- Encrypted backup for emergency recovery
- Memory-only plain text existence
Key Rotation:
- Periodic rotation schedule
- Automatic re-encryption of all dependent secrets
- Maintain system availability during rotation
Consequences
Positive
- No plain text key storage on disk
- Administrator-controlled recovery capability
- Automated key generation reduces human error
- Regular rotation enhances security
- Automatic re-encryption maintains data security
- Clear recovery procedures
Negative
- Dependency on administrator password
- Risk of system unavailability if both memory content and recovery password are lost
- Performance impact during key rotation and re-encryption
- Need for careful password management
- Operational complexity during rotation
Implementation Requirements
Key Generation
Initial Generation
- Automated generation by SPIKE Nexus
- Cryptographically secure random number generator
- Immediate memory storage
Storage Requirements:
- Memory-only plain text storage
- Secure memory handling
- Memory zeroing after use
Backup and Recovery
Password Requirements
- Strong password policies
- Secure password transmission
- Password storage guidelines
Backup Process
- Encryption of root key
- Secure storage of encrypted backup
- Regular backup verification
Key Rotation
Rotation Process:
- Automated rotation procedure
- Gradual secret re-encryption
- Validation of re-encrypted secrets
Scheduling:
- Define rotation intervals
- Maintenance window planning
- Emergency rotation procedures
Critical Operations
Password Management
Administrator Responsibilities:
- Secure password creation
- Password storage
- Access control
- Regular password verification
Recovery Procedures:
- Emergency recovery process
- Password verification
- System restoration steps
Rotation Operations
Pre-rotation:
- System health check
- Backup verification
- Resource availability check
During Rotation:
- Progress monitoring
- Error handling
- Recovery readiness
Post-rotation:
- Verification of re-encrypted secrets
- System health validation
- Backup update
Monitoring and Alerts
Key Health
- Memory presence verification
- Backup status
- Rotation schedule tracking
Critical Alerts:
- Failed rotation attempts
- Backup failures
- Memory issues
- Access attempts
Recovery Procedures
Emergency Recovery:
- Password validation
- Backup decryption
- System restoration
- Verification steps
Failed Rotation Recovery:
- Rollback procedures
- System state verification
- Impact assessment
References
- NIST Key Management Guidelines
- OWASP Key Management Cheat Sheet
- Cryptographic Key Lifecycle Best Practices
Notes
- Regular audits of key management procedures required
- Document all rotation events and issues
- Maintain detailed recovery runbooks
- Regular testing of recovery procedures
- Password management procedures must be documented and practiced
Warning
The administrator password for key recovery is CRUCIAL. Loss of this password combined with system failure could result in permanent data loss. Implement appropriate password management procedures.
- ADR-0021: SPIKE Keeper as a Stateless Shard Holder
- ADR-0020: Switch to Zola for Documentation System
- ADR-0019: Plugin-Based Storage Backend Architecture
- ADR-0018: Administrative Access to SPIKE
- ADR-0017: Synchronous Persistence for SPIKE Secrets Store
- ADR-0016: Memory-First Secrets Store
- ADR-0015: Use Singular Form for File and Package Naming
- ADR-0014: Maintaining SQLite as SPIKE’s Primary Storage Backend
- ADR-0013: S3-Compatible Storage as SPIKE’s Backing Store
- ADR-0012: HTTP Methods for SPIKE API
- ADR-0011: PostgreSQL as SPIKE’s Backing Store
- ADR-0010: Session Token Storage Strategy for SPIKE Nexus
- ADR-0009: Multi-Administrator Support System
- ADR-0008: Administrative Access Control System
- ADR-0007: Root Key Lifecycle and Management Strategy
- ADR-0006: Trust Boundary Definition and Security Assumptions
- ADR-0005: Use SPIFFE mTLS for Inter-Component Authentication and Communication
- ADR-0004: SPIKE Keeper Minimalist Design Approach
- ADR-0003: Root Key Management and Storage Strategy
- ADR-0002: Use Docsify for Documentation System
- ADR-0001: Display Secrets in Plain Text in SPIKE Pilot Admin CLI