-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add optional cluster key rotation #1
Comments
Can we make this key like an OTP? i.e. depend on timestamp |
Hey @ProfFan, thanks for the suggestion! Am I missing something? |
Thank you for the reply! One question, is the limiting factor here memberlist? I didn't find a way to "plugin-in" other methods for authentication there. |
Yes, memberlist has a single way of implementing authorization: using shared-keys. Note that it does not provide authentication: since there is a single key, there is no notion of "identity". However, this does not mean we cannot extend this scheme in a few ways. It would be possible, for instance, to generate the key from a fixed shared part + a TOTP part. |
My take is that in a cloud-computing context we do not actually control the servers (as they are hosted as VMs by cloud providers) so anything we "put" on these are "compromised" to the providers. Same idea applies for IoT devices where they can be accessed by third parties inspecting the device physically. Thus a key unique to the device or VM helps that we can safely revoke the key and the rest of the system stays safe. |
Ok, I see where you're coming from. Another possibility would be a CA-like setup, which is an order of magnitude more complex than PSKs and probably out-of-scope for wesher. |
Agree on your view :) Rotation is enough in this sense. Thank you for all the effort again! |
A couple important issues that need be addressed for rotation to work properly (I am probably stating the obvious, but let's do it anyway):
My current take on the matter is that the problem is very hard. Most systems that had to handle key rotation ended up using a central key infrastructure and authentication certificates instead of a shared key, thus shifting the issue to certificate renewal, which is already solved by X.509. Some systems remain that use psk at scale for authentication, mostly physical access control systems to my knowledge, e.g. the entire Mifare family. They usually handle key rotation by supporting two different keys during rotation time and drop support for the old key when all users have rotated. However, these systems have the huge advantage of separating concerns: the central management unit is responsible for generating and propating the keys while users simply get and store the new key provided to them. One way to implement it could be to rotate keys at a deterministic time (for instance after a specific memberlist message id) in a deterministic way (for instance derive from the old key and something that is not static, for intsance the hash of the given memberlist message, or hash of the state at that time). However, I fear that given the specifics of gossip protocols we fail at finding a proper deterministic time (some nodes might not receive messages in the same order for instance) or even a deterministic derivation algorithm (some nodes may node view the same state at the same time, gossip only provides eventual consistency). So, the other way is to elect one or multiple nodes (which ones? based on what criteria?) responsible for generating the key, and maybe reach consensus about the new key, then propagate that new key (possibly using memberlist directly). Then we can use existing primitives in This still sounds hard and uncertain 😄 |
Here is a concrete idea for implementation. The requirement is that a single node is responsible for triggering a rotation. That responsibility could be static (a configuration flag) or dynamic (find a deterministic feature that makes the node responsible).
Here is a list of problems that I think will arise:
In conclusion, I am really wondering if this is worth the pain. Maybe we could stick with a simpler way of changing keys once in a while: updating configurations and restarting wesher. For that specific matter, a couple other changes could improve reliability:
Then the matter of renewing a key can be delegated to configuration management tools:
|
Good insights @kaiyou ! Maybe we should first try to enable manual key rotation. This means a lot of the issues you mention don't apply. I was probably being too ambitious with the "automatic" part of the original issue 😉 Giving an operator the possibility to easily see the state of his cluster ("are all nodes I expect to be there really there?") and giving him a command like |
That last one is probably a lot simpler to implement. We would still need some ipc, possibly a control socket for wesher or some inotify. But it sounds a lot more reasonable. My last edit on the previous comment goes in this direction mostly. Your |
It would be nice to have the memberlist key be rotated automatically.
This would increase security a bit, at the cost of making ad-hoc joining less practical.
We'd also need a way to get the current key.
The text was updated successfully, but these errors were encountered: