Vault Structure
The vault stores versioned schemas with cryptographic integrity:The vault is automatically created when you run
chameleon init for the first time.How Hash Integrity Works
1. Schema Registration
When you apply a migration, ChameleonDB registers the schema version:- Schema content saved to
versions/v002.json - SHA256 hash computed from the JSON content
- Hash saved to
hashes/v002.hash - Manifest updated with new version metadata
- Event logged to
integrity.log
2. Automatic Verification
Before every operation, ChameleonDB verifies integrity:3. Tamper Detection
If someone modifies a vault file, the hash check fails:manifest.json Structure
The manifest tracks all registered versions:Version Snapshots
Each version file contains a complete schema snapshot: versions/v001.json:Version files are immutable. Once written, they should never be modified. Any modification is detected as tampering.
integrity.log (Audit Trail)
All vault operations are logged:INIT- Vault creationREGISTER- New version registeredMIGRATE- Migration appliedVERIFY- Integrity verificationMODE_CHANGE- Integrity mode changedVIOLATION- Integrity violation detected
Verifying Vault Integrity
Manual Verification
View Version History
View Specific Version
Integrity Violation Recovery
If tampering is detected:Step 1: Identify the Issue
Step 2: Review Integrity Log
Step 3: Restore from Backup
Step 4: Investigate Access
Check who modified the files:Step 5: Rotate Passwords
Best Practices
Never manually edit vault files - Use CLI commands only
Commit vault to version control - Except
auth/ directoryMonitor integrity.log - Set up alerts for violations
Run verify before deployments - Ensure vault integrity
Backup vault regularly - Automated backups recommended
Next Steps
Mode Enforcement
Learn about ring-based access control
Best Practices
Security recommendations for production