Commit 4e3e03c
committed
feat: add auto-rotation scheduler (cron) for key lifecycle management
Add a background thread that periodically checks which keys are due for
rotation and automatically rotates them. The scheduler supports:
- Symmetric keys via KMIP ReKey
- Asymmetric keys (RSA/EC/PQC) via new CreateKeyPair + cross-links
- CoverCrypt keys via ReKeyKeyPair (in-place rotation)
- Certificates via Certify (re-issuance)
New components:
- find_due_for_rotation() in ObjectsStore trait + SQLite/PostgreSQL/MySQL impls
- is_due_for_rotation() helper in locate_query.rs
- auto_rotate.rs: rotation logic per object type
- spawn_auto_rotation_cron() in cron.rs
- --auto-rotation-check-interval-secs CLI flag (default: 0 = disabled)
The rotation policy (rotate_interval, rotate_name, rotate_offset) is
transferred to the new key so the cycle continues. Old keys get
rotate_interval=0 and ReplacementObjectLink to the new key.1 parent 865771d commit 4e3e03c
17 files changed
Lines changed: 914 additions & 2 deletions
File tree
- CHANGELOG
- crate
- interfaces
- src/stores
- server_database
- src
- core
- stores/sql
- server/src
- config
- command_line
- params
- core/operations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
| 31 | + | |
26 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
120 | 133 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
216 | 222 | | |
217 | 223 | | |
218 | 224 | | |
| |||
651 | 657 | | |
652 | 658 | | |
653 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
654 | 664 | | |
655 | 665 | | |
656 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
| |||
414 | 418 | | |
415 | 419 | | |
416 | 420 | | |
| 421 | + | |
417 | 422 | | |
418 | 423 | | |
419 | 424 | | |
| |||
637 | 642 | | |
638 | 643 | | |
639 | 644 | | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
640 | 649 | | |
641 | 650 | | |
642 | 651 | | |
| |||
0 commit comments