[auto-rotation feature] PR 3 - Auto-rotation scheduler + deadline detection#970
Open
Manuthor wants to merge 20 commits into
Open
[auto-rotation feature] PR 3 - Auto-rotation scheduler + deadline detection#970Manuthor wants to merge 20 commits into
Manuthor wants to merge 20 commits into
Conversation
Base automatically changed from
feat/key-rotation-manual
to
docs/key-autorotation-spec
May 29, 2026 12:57
6cc8ce5 to
fa12cc6
Compare
4e3e03c to
f27b7e5
Compare
fa12cc6 to
5f27e21
Compare
f27b7e5 to
43b5cdb
Compare
d843e12 to
ca7eaef
Compare
9eb009a to
854aa02
Compare
f7ee659 to
e8eaa16
Compare
43b5cdb to
f4fcd04
Compare
Add comprehensive specification for scheduled key rotation covering: - 6 rotation scenarios (plain, wrapping, wrapped, asymmetric, CoverCrypt, KEK) - Rotation policy vendor attributes (x-rotate-interval, etc.) - Server-side cron scheduler - KMIP attribute tables (auto vs manual rotation semantics) - Implementation roadmap (5 stacked PRs) Ref: #900
…s + test vectors (#969) * feat(rekey): implement symmetric key ReKey with wrapping key re-wrap - Implement KMIP ReKey for symmetric keys with name transfer per §4.4 - Support re-wrapping dependent keys when a wrapping key is rekeyed - Add find_wrapped_by() to ObjectsStore trait (SQLite, PostgreSQL, MySQL) - Fix: transfer Name attribute from old to new key during ReKey - Fix: error on self-wrap when wrapping_key_id is user-supplied - Fix: bypass ownership check for server-configured KEK Tested with 37 vector tests (9 symmetric + 27 keypair + 1 security) * fix: consolidate rekey operations using trait * feat: consolidate Recertify operation
…4 (merge spec+manual into PR1)
…, deny modify rotation attributes, update bad KMIP spec refs, offset becomes i64
* docs: add key auto-rotation specification Add comprehensive specification for scheduled key rotation covering: - 6 rotation scenarios (plain, wrapping, wrapped, asymmetric, CoverCrypt, KEK) - Rotation policy vendor attributes (x-rotate-interval, etc.) - Server-side cron scheduler - KMIP attribute tables (auto vs manual rotation semantics) - Implementation roadmap (5 stacked PRs) Ref: #900 * fix: build * chore: update Nix expected hashes
5911dc5 to
dcc5aa5
Compare
fa2b67d to
cf711aa
Compare
cf711aa to
bea7e61
Compare
f610a78 to
7b7cbd4
Compare
54a61cc to
411a05d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a background cron scheduler that automatically rotates keys whose
x-rotate-intervalhas elapsed, with configurable check frequency via a new server flag.
This is PR 3 of 4 in the key auto-rotation feature stack (depends on PR 2: #988):
What's included
Database —
find_due_for_rotation()New
ObjectsStoremethod returns all Active symmetric/private keys whoserotation deadline has passed:
Implemented in SQLite, PostgreSQL, and MySQL backends.
Auto-rotation dispatcher —
crate/server/src/core/auto_rotate.rsrun_auto_rotation(kms, owner)— iterates due keys and dispatches to thecorrect rotation flow (plain, wrapping, wrapped, asymmetric)
dispatch_renewal_warnings(kms)— emits approaching-deadline events at 30/ 7 / 1 days before next rotation (wired by PR 4 ([auto-rotation feature] PR 4 - Notification system (SMTP email) #971) notifications)
kms.key.auto_rotationlabelled withuidandalgorithmon every successful rotation
Cron thread —
crate/server/src/cron.rsstart_auto_rotation_cron()spawns a Tokio task that wakes everycheck_interval_secsand callsrun_auto_rotation()Server config
--auto-rotation-check-interval-secs(default0= disabled)crate/server/src/config/wizard/auto_rotation_wizard.rskms.tomltemplate updatedConfiguration example
cosmian_kms --auto-rotation-check-interval-secs 300 # check every 5 minutesOr in
kms.toml:Breaking changes
None. The scheduler is off by default (
0disables it).Reviewer notes
dispatch_renewal_warningsuses theNotifiertrait wired in PR 4 ([auto-rotation feature] PR 4 - Notification system (SMTP email) #971) tosend SMTP alerts at 30 / 7 / 1 days before the next scheduled rotation.
hsm::) are excluded fromfind_due_for_rotation— the KMS cannot generate key material inside the HSM.