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.

  • Eknz@lemmy.eknz.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 months ago

    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.

  • KaninchenSpeed@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    11 months ago

    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.

    • dont@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      11 months ago

      The passphrase should be stored and transferred encrypted, but that would basically mean reimplementing mandos, a tool that was mentioned in another reply https://lemmy.world/post/38400013/20341900. Besides that yes, that’s one way I’ve also considered. An ansible script with access to all encrypted host’s initrd-ssh-keys that tries to login; if the host is waiting for decryption, provides the key, done. Needs one webhook for notification and one for me to trigger the playbook run… Maybe I will revisit this…

  • utjebe@reddthat.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 months ago

    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.