Repository navigation
Description
Problem
Restoring an instance backup made before a node successfully renewed its certificate can leave that node unable to reconnect. Keeping the same CA is insufficient: the gateway also requires the presented certificate serial to exist in the restored database. The agent keeps the newer certificate, whose serial did not exist at the backup's time.
The restore procedure and documentation currently promise that existing servers reconnect automatically with their existing identities. This case does not satisfy that promise and can require operator recovery after a disaster restore.
Audited revision: 1295e534d7a1c3cd0a492449de8806aa532a4924.
A pre-publication comparison of this snapshot with main 2ee78ff1e96118b1732b98bc54c99f5f91b95a32 found that the only intervening change was to apps/api/src/modules/deployments/application/exec-sessions.spec.ts. None of the affected production paths changed.
Scenario and evidence
- Enroll a node and create an instance backup containing its current registered certificate serial A.
- Renew the node certificate successfully. The control plane commits serial B, and the agent receives and persists it.
- Restore the older instance backup, including the CA and database, then point the same gateway name at the restored instance.
- The node presents B. Its signature can be valid under the restored CA, but B is absent from the restored credential registry, so gateway authentication rejects it.
- The agent requires operator recovery rather than silently enrolling again.
Relevant sources:
- Renewal records the newly issued serial.
- Authentication looks up the exact presented serial, and rejects missing or mismatched registered credentials.
- The agent stops reconnecting after an identity rejection and waits for operator intervention.
- The restore imports the snapshot and revokes restored user sessions/email links; it has no reconciliation step for certificates issued after that snapshot.
- The unconditional reconnection claim appears in ADR 0026, INSTALL.md, and the restore completion message.
Verification and limits
This finding comes from tracing the restore, renewal, registry lookup and reconnect behavior in source. No actual backup restore, certificate rotation against a running gateway, or VM test was performed for this audit. It applies when a successful renewal occurred after the selected backup; it does not claim that all restored agents fail to reconnect. Existing workloads may keep serving locally while control-plane management is unavailable.
This is also not the documented lost-response renewal case: here the renewal response was received and persisted normally.
Proposed correction
Define and test the post-restore identity recovery contract. At minimum, qualify the documentation and completion message and provide an explicit operator-authorized recovery procedure that preserves the node's logical identity and its allocations. If automatic recovery is intended, design it without accepting every certificate signed by the CA or weakening revocation and tenant checks. Any change to those invariants needs an explicit design decision.
Acceptance criteria
- A disposable integration environment enrolls a node, takes a backup, successfully renews and persists its certificate, then restores the backup.
- The supported recovery path restores management of that same node and preserves its allocations, with auditable authorization if operator action is required.
- Revoked, removed, wrong-node and wrong-organization credentials remain rejected; recovery cannot silently bypass revocation.
- Documentation states which post-backup identity changes need recovery and distinguishes management recovery from continued local workload service.
- The restore command does not report unconditional automatic reconnection when its prerequisites are absent.
Related work
Follow-up to closed #231, whose acceptance requires a restored control plane to re-adopt existing agents, and the identity work in closed #14. #227 covers retry-safe renewal after a lost response; this issue covers database rollback after a successful renewal. #439 concerns substitution of the wrong archive; this failure is possible with the correct, intentionally selected archive.
Activity
feat(fleet): a server a restore rolled back is re-adopted on an admin…
fix: re-adoption adopts only the certificate the administrator review…