Skip to content

Commit

Permalink
Key rotator (#3136)
Browse files Browse the repository at this point in the history
Supports #2147.

Introduces the `key_rotator`, which is a utility for managing the lifecycle of global HPKE keys. It will bootstrap keys, and rotate them according to the rotation policy in the config.

Keys are unique by their HPKE ciphersuite. For each ciphersuite, a key is run through the pending->active->expired->deleted lifecycle. It is permissive of some manual operator changes, e.g. if a manual key rotation needs to be executed through janus_cli or the aggregator API.

In this iteration, it runs as a standalone binary for use in a cronjob. It is suitable for deployment in our environments, including taskprov ones. A future PR will add support for BYOH deployments by letting the `aggregator` process run the key rotator.
  • Loading branch information
inahga committed Jun 20, 2024
1 parent 99775e1 commit 85172b6
Show file tree
Hide file tree
Showing 19 changed files with 1,357 additions and 39 deletions.
29 changes: 26 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ pretty_assertions = "1.4.0"
prio = { version = "0.16.5", default-features = false, features = ["experimental"] }
prometheus = "0.13.4"
querystring = "1.1.0"
quickcheck = { version = "1.0.3", default-features = false }
quickcheck_macros = "1.0.0"
rand = "0.8"
rayon = "1.10.0"
reqwest = { version = "0.12.5", default-features = false, features = ["rustls-tls"] }
Expand Down
2 changes: 2 additions & 0 deletions aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ janus_aggregator_core = { workspace = true, features = ["test-util"] }
mockito = { workspace = true }
opentelemetry_sdk = { workspace = true, features = ["testing"] }
prio = { workspace = true, features = ["multithreaded"] }
quickcheck = { workspace = true }
quickcheck_macros = { workspace = true }
rstest.workspace = true
tempfile = { workspace = true }
tokio = { workspace = true, features = ["net", "test-util"] } # ensure this remains compatible with the non-dev dependency
Expand Down
1 change: 1 addition & 0 deletions aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ mod collection_job_tests;
mod error;
pub mod garbage_collector;
pub mod http_handlers;
pub mod key_rotator;
pub mod problem_details;
pub mod query_type;
pub mod report_writer;
Expand Down
Loading

0 comments on commit 85172b6

Please sign in to comment.