I am looking for some recommendations on how to secure the data of my physical servers (against physical theft), that I am about to set up. I am new to selfhosting but have a few years of experience running Linux on a desktop.

My usecase is a simple debian(?) server at home with Paperless ngx and Tailscale for when I am away from home.

The question is how to encrypt the data while still being able to keep the server updated.

Coming from Desktop my first thought was to simply enable FDE on install. But that would mean supplying the password everytime the server needs to reboot for an update. Could someone provide some insights on how often updates to debian require a reboot?

My second thought was to use an encrypted data partition. That way the server could reboot and I could use wireguard to ssh in and open the partition even when I am away from home for a longer time.

I am open to other ideas!

  • Willdrick@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    20 days ago

    Unless the crook happens to be extremely nerdy or its law enforcement, already being a Linux formatted partition feels it should be enough for a rando breaking in and stealing a computer.

    That being said, something like a PiKVM connected to your server (and Tailscale) could let you enable both UEFI/boot password and propt for LUKS decryption upon boot.

    • coffeetastesbadlikecoffee@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      ·
      19 days ago

      I wouldn’t rely on the thief not knowing how to read linux partitions. That very well may be the case, but the person they sell your hardware to will know better, considering they are in the market of purchasing used server hardware.

      I self host and my threat model is the thief selling my server to someone who knows what to do with it, but not knowing how to extract encryption keys from the memory of a running server before unpluging it. That being said I haven’t figured out encryption yet so watching this thread.

  • liliumstar@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    20 days ago

    I would do FDE yeah. My current laptop setup is with systemd-boot and a special initramfs that allows me to unlock it with a yubikey, with fallback to password. Fair warning, this exact configuration is not particularly easy to setup.

    There are also modules which enable early network connectivity along with a SSH server, meaning you login and unlock it remotely. I have not tried this.

    Debian does not frequently require rebooting under normal circumstances. Kernel updates are not that frequent, and you can usually put it off for a bit if you don’t want to deal with it.

  • SirMaple__@lemmy.ca
    link
    fedilink
    English
    arrow-up
    4
    ·
    20 days ago

    I use LUKS on my systems. I use mandos and wireguard in intramfs to connect to a mandos server to unlock LUKS during boot.

  • Goingdown@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    3
    ·
    20 days ago

    Luks FDE, and install dropbear-initramfs, configure ssh authorized_keys and rebuild initramfs. Then you can access initramfs via ssh to type luks password.

  • ftbd@feddit.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    19 days ago

    You can use FDE and setup a minimal ssh server like dropbear to run at startup. This way, you can supply the password via a keyboard connected to the machine OR via ssh. This gives you a similar workflow to the data partition you mentioned, but encrypts the entire system.

  • InnerScientist@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    12 days ago

    Somethign I haven’t seen mentioned yet is clevis and tang, basically if you have more than one server then they can unlock each other and if they’re spatially separated then it is very unlikely they get stolen at the same time.

    Though you have to make sure it stops working when a server get stolen, using a mesh VPN works just as well after the server is stolen so either use public IPS and a VPN or use a hidden raspberry pi that is unlikely to be stolen or make the other server stop tang after the first one is stolen.

  • Wispy2891@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 days ago

    I wanted to encrypt against physical theft but then I realized that the server weighs 20kg and there’s more valuable and lighter stuff to steal. And a thief would never be able to mount the zfs array, they’ll just fence my $2000 server for $50 and someone else will sell it piece by piece on ebay. And between people who buys used drives online on ebay almost nobody is going to do a full surface scan of a 12tb drive in the hopes of finding valuable data.

  • lorentz@feddit.it
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    20 days ago

    If you want to encrypt only the data partition you can use an approach like https://michael.stapelberg.ch/posts/2023-10-25-my-all-flash-zfs-network-storage-build/#encrypted-zfs to ulock it at boot.

    TL;DR: store half of the decryption key on the computer and another half online and write a script that at boot fetches the second half and decrypt the drive. There is a timewindow where a thief could decrypt your data before you remove the key if they connect your computer to the network, but depending on your thread model can be acceptable. you can also decrypt the root portion with a similar approach but you need to store the script in the initramfs and it is not trivial.

    Another option I’ve seen suggested is storing the decryption key on a USB pendrive and connect it with a long extension cord to the server. The assumption is that a thief would unplug all the cables before stealing your server.

  • InvertedParallax@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    20 days ago

    Good question.

    Debian doesn’t often require a reboot, but the longer you go, and if you need kernel modules (nvidia is the worst at this) you might need to reboot to keep everything in sync.

    My suggestion: raspberry pi, like 1st edition, keep the key very secure, give it a usb serial console. When the server reboots, enter the password that way. It’s your emergency console.

  • AtariDump@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    19 days ago

    I am looking for some recommendations on how to secure the data of my physical servers (against physical theft)…

    Lock the case shut. Run a security wire (like for laptops) to the case and mount the other end to something big / immovable.

    Truly paranoid: 24/7 video surveillance.

    Super truly paranoid: same as above but in a locked room