Auto Restore WorkflowΒΆ
OverviewΒΆ
The auto restore workflow is triggered when a Trustpoint container with HSM-based storage (SoftHSM or Physical HSM) is restarted and the database contains encrypted data, but the HSMβs Key Encryption Key (KEK) is not available. This process ensures that encrypted private keys can be recovered using a backup password, even if the HSMβs volatile KEK is lost.
Key Point: For SOFTWARE storage type, no auto restore is needed - the container restarts normally.
Workflow ProcessΒΆ
HSM-Based Storage (SoftHSM or Physical HSM)ΒΆ
The auto restore workflow varies depending on what HSM components are available:
Scenario 1: KEK Lost, Token Exists
Container Restart (SOFTHSM + WIZARD_COMPLETED + encrypted DB)
β
managestartup.py detects KEK lost but token exists
β
WIZARD_AUTO_RESTORE_PASSWORD state created
β
entrypoint.sh detects state β skips unwrap/config
β
User accesses web β /setup-wizard/auto_restore_password/
β
BackupAutoRestorePasswordView
β
DEK recovery + TLS extraction
β
sudo wizard_auto_restore_success.sh
β
NGINX & TLS config β WIZARD_COMPLETED
β
Done!
Scenario 2: HSM Completely Lost (New HSM Installation)
Container Restart (SOFTHSM + WIZARD_COMPLETED + encrypted DB)
β
managestartup.py detects new KEK scenario (token missing)
β
WIZARD_SETUP_HSM_AUTORESTORE state created
β
entrypoint.sh detects state β skips unwrap/config
β
User accesses web β /setup-wizard/auto-restore-hsm-setup/<hsm_type>/
β
AutoRestoreHsmSetupView
β
sudo wizard_setup_hsm.sh <module> <slot> <label> auto_restore_setup
β
HSM token initialized β WIZARD_AUTO_RESTORE_PASSWORD state created
β
User accesses web β /setup-wizard/auto_restore_password/
β
BackupAutoRestorePasswordView
β
DEK recovery + TLS extraction + CA deactivation
β
sudo wizard_auto_restore_success.sh
β
NGINX & TLS config β WIZARD_COMPLETED
β
Done!
Scenario 3: KEK Available (Normal Restart)
Container Restart (SOFTHSM + WIZARD_COMPLETED + encrypted DB)
β
managestartup.py detects KEK available
β
Normal startup continues
β
DEK unwrapped using existing KEK
β
NGINX & TLS config β WIZARD_COMPLETED
β
Done!
SOFTWARE Storage TypeΒΆ
For SOFTWARE storage type:
Container Restart (SOFTWARE + WIZARD_COMPLETED)
β
managestartup.py
β
No auto restore needed
β
Normal container startup continues
β
Done!