Hey everyone, here’s an idea, what do you think? (Please stop me…)
I have a few remote servers where disk encryption is only a moderately important measure; I definitely want to keep it but I’m also annoyed by having to ssh into it during the initrd-phase to provide a passkey on every reboot. What I would like is to get a notification with a link to my idp for some device flow, allowing me to authorize the server to obtain the secrets necessary for decryption.
As far as I can tell, this hasn’t been done before, or have I missed something? A naive idea would be to have custom oidc-claims for the different servers where the value is the luks-passphrase. Feels like a bad idea, though. Any ideas on the details as to how? I obviously don’t want to bloat my initrd-image, so a bash script using curl would be ideal.
I was sorting somethingting similar some time ago with https://www.dwarmstrong.org/remote-unlock-dropbear/
Also there is https://github.com/latchset/tang and https://github.com/latchset/clevis
Then I changed it so my server boots and offers basic functionality like DNS and any encrypted data would wait until I unlock it. When I fiddle with it could be annoying, but otherwise works very well considering I need to unlock it just a few times a year.
If you already have/can run a local server, then maybe storing the luks passphrase there and running a script on it which sshs into the remote server end enters the stored passphrase on command. Maybe a simple http server triggers it, which you could auth using forward auth of your reverse proxy, so you wouldnt need to implement auth in your script.
Of cause the passphrase is stored in plain text, but that will be the case in any case not using a tpm.
You could do notifications with a simple webhook of your favourite chat app, or by running a ntfy server (and app) and also sending the notification with a curl from a initrd script.
Some people use TPM hardware for this. Others (big cloud operators) have a ton of complicated infrastructure involving among other things special key servers on a walled off LAN. I don’t know a really satisfying answer, so will keep watching the thread.
Ironically, the passphrase for the encryption wouldn’t be encrypted in this scenario as claims can be decoded from the token payload if intercepted. It would also probably be stored as-is server side as well. Claims aren’t designed as secrets.
Perhaps you could authorise a request to an actual secrets manager via oidc though, allowing the volume to be unlocked.
Yes, I was thinking about storing encrypted keys, but still, using claims is clearly just wrong… Using a vault to store the key is probably the way to go, even though it adds another service the setup depends on.
A fall-back to the current way of unlocking the volume would probably be a good idea. It wouldn’t be fun to lose access to something because a cloud service went down or access to it was lost etc.
Definitely! I have bmc/kvm everywhere (well, everywhere that matters).
I have talked myself out of this (for now), though. I think if I ever find the time to revisit this, I will try to to it by injecting some oidc-based approval (memo to myself: ciba flow?) into something like clevis/tang.
Isn’t Kmip how this is solved?
Sort of, but this seems a bit heavy. (That being said, I was also considering pkcs#11 on a net-hsm, which seems to do basically the same…)
Chech here, I think is a more sensible way of doing things https://www.recompile.se/mandos
Interesting, do you happen to know how this “approval” works here, concretely?
I am afraid I don’t get the question.
What do you exactly mean?
It wasn’t clear to me at first glance how the mandos server gets the approval to supply the client with its desired key, but I figured it out in the meantime: that’s done through the mandos-monitor tui. However, that doesn’t quite fit my ux-expectations. Thanks for mentioning it, though. It’s an interesting project I will keep in mind.
Ehmmmm I still don’t grasp what you mean.
In any case, mandos has a possibility to do it automatically via rsa encryption, so you have the possibility of totally unattended restart.
Because the server is (ideally) in a different location, if one of yiur systems is stolen / compromised then you only delete / revoked the certificates ID and then that machine would not be able to decrypt its own luks system.
I never deployed this system on my own, but I know a few guys who did it
Regards
deleted by creator
I followed this guide and it works very well for me. It’s basically a setup for a dropbear ssh server on boot time.


