• [gentoo-user] Benefits from full disk encryption on server?

    From whiteman808@21:1/5 to All on Fri May 16 19:10:02 2025
    Hello,

    I'm going to run on my server a few services for me and friends like
    static HTML pages, gitea, jabber server, and mailing lists.

    Are there any advantages from putting Linux on encrypted root at bare metal server if I often access remotely server from ssh, and sometimes need to reboot it? What about key supplied during unlocking server after reboot or manually power on? Giving
    remotely password doesn't seems safe to me.

    I want to protect against burglary and I'm not sure whether doing full disk encryption is a right way to go. Maybe should I just instead of trying to focus on the software side try to take more care of physical security?

    Thank you all gen2 folks,
    whiteman

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Freeman@21:1/5 to All on Fri May 16 21:00:01 2025
    On 5/16/2025 12:59 PM, whiteman808 wrote:
    Hello,

    Are there any advantages from putting Linux on encrypted root at bare metal server if I often access remotely server from ssh, and sometimes need to reboot it? What about key supplied during unlocking server after reboot or manually power on? Giving
    remotely password doesn't seems safe to me.

    I want to protect against burglary and I'm not sure whether doing full disk encryption is a right way to go. Maybe should I just instead of trying to focus on the software side try to take more care of physical security?

    Burglary is a difficult use case to protect against, because as you
    point out you need to provide the key somehow at boot.  There are
    TPM-based approaches that are not well-supported on Linux distros which
    try to ensure that the key is only readable if the disk is booted
    normally, but you're still vulnerable to any physical access OS
    vulnerability.

    I run servers with full disk encryption on SOME of my storage, but not
    the OS drives. I store the key in a file on the OS drive. This obviously provides no security against burglary, but the benefit is that when a
    disk with sensitive data fails it is encrypted with a strong key (no
    memorable passphrase). You need both the OS disk and the encrypted disk
    to read anything sensitive, so I can just toss the failed disk in the
    trash. This also allows unattended boot.

    Another approach you could consider is putting the key on another host available over the network. Your initramfs/etc could use a credential
    stored on it to access the remote host and retrieve the disk key. The
    remote host could be a Pi hidden someplace non-obvious. Then if the host
    is stolen and not kept powered on continuously (ie not a sophisticated attacker) the disk won't be readable, but it would boot just fine as
    long as it is attached to your LAN.

    There might be some other variations on a theme like that using some
    sort of credential vault software. Approaches like that could also be
    used to remotely disable the device if you can't access it - the
    credential vault could be told to not provide the key any longer.

    In any case there are definitely use-cases for full disk encryption that
    still add value even if it isn't as secure as having to remember a LUKS
    key on boot.

    --

    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to All on Sat May 17 04:10:01 2025
    On 5/16/25 11:59 AM, whiteman808 wrote:
    Hello,

    Hi,

    Are there any advantages from putting Linux on encrypted root at bare
    metal server ...

    I think so.

    But I've not yet done it myself. I've only used LUKS for a data file
    system.

    ... if I often access remotely server from ssh, and sometimes need
    to reboot it?

    I don't think the method or frequency of access alters the advantages of
    FDE.

    What about key supplied during unlocking server after reboot or
    manually power on? Giving remotely password doesn't seems safe to me.

    I think this is where an OoB console access to provide the key, or
    initial RAM disk based SSH server can come into play.

    I've actually had FDE provide /faster/ access to data than unencrypted
    for weird reasons related to caching.

    There's also, destroy the key and the drive is cryptographically
    sanitized and available for re-use without concern.

    I added a key to the FDE on my work notebook a couple of jobs ago and
    had that key stored in a 4 MB partition (smallest I could make) on a
    flash drive. (Raw partition, not file.) So when I booted my computer
    in the dock, the key could be found and automatically unlock the FDE.
    If I booted not connected to the dock, I had to enter my FDE password.

    I want to protect against burglary and I'm not sure whether doing full
    disk encryption is a right way to go. Maybe should I just instead
    of trying to focus on the software side try to take more care of
    physical security?

    Are you worried about disk theft or system theft?

    The former is easier to protect against than the latter.

    Take a look at a solution that Red Hat supports. I'm sure Gentoo can be
    made to support it:

    Clevis (client) and the Tang server

    It's meant to be a way for servers to unlock FDE. I don't remember the particulars at the moment.



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wol@21:1/5 to Grant Taylor on Sat May 17 10:10:01 2025
    On 17/05/2025 03:06, Grant Taylor wrote:
    Are you worried about disk theft or system theft?

    The former is easier to protect against than the latter.

    I believe modern hardware will automatically encrypt the disk and store
    the key in the TPM. At BIOS level. So that disk is only readable on that computer.

    (There are ways to back up the key, but to a first approximation, take
    the disk out of the computer and it's cryptographically wiped.)

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Victor Ivanov@21:1/5 to gentoo-user at lists.gentoo.org on Sat May 17 11:23:59 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) DQo+IEFyZSB0aGVyZSBhbnkgYWR2YW50YWdlcyBmcm9tIHB1dHRpbmcgTGludXggb24gZW5jcnlw dGVkIHJvb3QgYXQgYmFyZSBtZXRhbCBzZXJ2ZXINCg0KVGhlcmUgYXJlIGFsd2F5cyBhZHZhbnRh Z2VzIG9mIGhhdmluZyBGREUsIGluY2x1ZGluZyB3aGVuIGEgdGhlZnQgDQpvY2N1cnMuIFdoaWxl IG9mYyBGREUgd2lsbCBub3QgcHJvdGVjdCBhZ2FpbnN0IHRoZWZ0LCBhdCBsZWFzdCB0aGUgZGF0 YSANCm9uIHRoZSBkcml2ZShzKSB3aWxsIGJlIHNlY3VyZS4NCg0KSWYgeW91J3JlICJob3N0aW5n IiBvdGhlciBwZW9wbGUncyBkYXRhLCBJIHRoaW5rIHRoaXMgdGhlcmUncyBldmVuIG1vcmUgDQpn b29kIHJlYXNvbiB0byB1c2UgZW5jcnlwdGlvbiwgd2hldGhlciB0aGF0IGRhdGEgaXMgc2Vuc2l0 aXZlIG9yIG5vdC4NCg0KUGVyc29uYWxseSwgSSB1c2UgRkRFIGZvciBldmVyeXRoaW5nLiBJdCdz IG9ubHkgb25lIHN0ZXAgZnVydGhlciB0aGFuIGFuIA0KZW5jcnlwdGVkIGRhdGEgcGFydGl0aW9u LCBzbyBJIGRvbid0IHNlZSB3aHkgbm90LiBIZXJlJ3MgYW4gc2FtcGxlIA0Kc2luZ2xlLWRpc2sg KG5vIFJBSUQpIGxheW91dDoNCg0KL2Rldi9zZGENCuKUnOKUgCAvZGV2L3NkYTEgOiBFRkkgU3lz dGVtIFBhcnRpdGlvbg0K4pSc4pSAIC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gnTKIrZ/mizJPeQNX683+UOf9jjo/E=
    =LAIj
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to Wol on Sat May 17 17:20:01 2025
    On 5/17/25 3:04 AM, Wol wrote:
    I believe modern hardware will automatically encrypt the disk and store
    the key in the TPM. At BIOS level. So that disk is only readable on that computer.

    Some systems have that capability. But all of the systems that I've
    looked at don't enable it automatically.

    Sadly, it doesn't offer any protection if the entire system is taken,
    Hence the question of what to protect.

    This also offers no protection against physical based / connected attacks.

    (There are ways to back up the key, but to a first approximation, take
    the disk out of the computer and it's cryptographically wiped.)

    I get what you're saying, but if you put it back in the same system the
    data is available again. Thus the data wasn't wiped. Conversely
    destroy the key and now you can't get the data back without massive
    brute force.



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Freeman@21:1/5 to Rahul Sandhu on Sun May 18 12:30:01 2025
    On 5/17/2025 8:43 AM, Rahul Sandhu wrote:
    Hi,

    You may want to look into TPM2-based disk encryption; during normal
    operation it's basically transparent. My servers all have an encrypted
    root partition, and I do not need to enter a password to boot it as the decryption keys are stored in the TPM. Take a look at this page[1] for information on how to do it with Clevis, however I would recommend the
    usage of systemd-cryptenroll(1) instead for systemd systems[2].

    I didn't realize that this had progressed so far. With LUKS you could presumably also set a passphrase in case the PCRs get messed up.

    This is basically how most corporate laptops are configured.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)