There are practices that could improve out of the box security for linux distros.
default to encrypted root install, user has to disable
ubuntu is forcing users to save recovery keys in the installer. this is a good approach
support encrypted boot via multiple methods, e.g. FDE, double prompt, etc
make secure boot easier to understand and manage
yes. this is complex--which is my point. multiple models to support maximize adoption
support smartcard and tpm setup during install
make smartcard and tpm use easier to understand and manage after install
Regardless of what the rest of the users and linux distros are doing, what can I practically do to increase security for myself. I created list of boot related options and an assessment tool. Here are some general principles.
Disable USB Boot or only boot from USB
Set Admin password on Firmware
Use Secure Boot
Attempt Full Disk Encryption, if that fails at least encrypt root drive and use Secure boot
Use very strong passwords
Use smartcards instead of passwords for login and admin work
keep strong passwords as backup for access
use tpm and/or smartcard for encrypted root unlock
The Ubuntu 26.10 installer supports secure boot with signed Unified Kernel Images. I am also doing this manually as the installer doesn't work for most people.
One of the things we might want to do is lock down the efi partition. I change /etc/fstab to add options to the efi mount
/dev/disk/by-uuid/6E52-E6AF /boot/efi vfat defaults,umask=0077,shortname=efi 0 1
If the boot partition and the EFI partition are unencrypted an attacker may modify them by gaining physical access. The goal of secure boot is to protect the user by having the hardware make extra security checks before booting up.
This is a good goal but Linux implementations have a few major gaps which render it not secure in almost all Linux installs--the initrd is not signed or checked. This is exacerbated by the fact that it is complicated and difficult to understand for non technical end users. (I'm a very technical end user and I barely understand the relationship between UEFI, MOKs, shims and everything else). Since the initrd is rebuilt during the update of the system (often many times) it cannot be signed by the vendors (Microsoft, Ubuntu, Redhat, etc.) The hardware needs access to the kernel and initrd to boot. Booting of encrypted drives is challenging and often not possible leaving the initrd open to modification.
It is possible to create our own key and register with UEFI then create a Unified Kernel Image (UKI) that allows Secure Boot to properly protect our boot chain.
Secure boot only protects Linux with a signed Unified Kernel Image (UKI). This is where the initrd is combined with the kernel and signed by a key registered with UEFI.
Since the hardware in the computer has to get access to the data on the hard drives to boot into an operating system chosen and installed by the end user it is challenging to protect every thing with encryption. While the use of some specialized hardware makes this viable it requires complicated and risky setup. The general model has been to leave the boot partition decrypted so that the standard UEFI boot processes may access it. I am now encrypting everything but the efi partition and using secure boot with a custom UKI signed by me. Another option is to encrypt boot with luks1 at which two password prompts are presented. 1) decrypt boot 2) decrypt root.
Yet, another option could be to only boot from usb which is unencrypted and kept safe. The full disk on the laptop could be encrypted so that physical access is not an attack vector. Since the laptop itself does not boot there is nothing for an attacker to modify on disk. Firmware attack and hardware modification are the only options left for the attacker.
The evil maid attack is when someone gets physical access to the system to make modifications such as the boot process. How could we protect against it?
move boot files to removable usb
move entire system to removable usb
full disk encryption+Secure Boot+Signed UKI
it is almost impossible to keep a usb stick protected at all times. (in the shower?) but it would reduce the attack vector.
Ideally, all data on the system would be protected from modification by an attacker. If the boot partition is securely encrypted it is one less attack vector. Since the UEFI boot process has to have access to decrypt it is challenging to achieve this.
Grub supports some encrypted booting features. It might make sense to expand this but if the attacker has access to the EFI partition the boot process may still be modified. This approach might have to be paired with something like secure boot to be effective. Generally grub is going to boot whatever is configured and whatever is configured has to be in the clear so grub can access it. If grub is securely decrypting /boot it will ask for a passphrase.
if secure boot launches a signed uki from the efi partition we dont need a boot partition. We can store the boot files inside the encrypted root. Since the process to install will likely create a boot partition we can decomm it after the system is working.
We may also protect our drives with tpm hashing, etc but that is not working out of the box for most people. Not many distros support this on install.
When TPM was introduced there was great concern that Microsoft would leverage it to prevent install of non MS systems on PCs and servers. The mitigation for this concern has mostly been to turn off the security features on windows pcs and ignore TPM during Linux installs. It is good to see that we are finally (after 20 years) starting to work with the technology though we still have challenges.
Given that a lot of computers (maybe all now) have TPM modules the Linux community should offer users the use of it during install and some distributions are starting to do this.
Ubuntu is using the TMP for boot unlocking starting in 26.10 but it has limitations (like not working at all). It may be manually configured in various configurations. The latest installer for fedora may support tpm but I didn't notice it during install. Fedora supports tpm unlock of encrypted luks partitions after install.
I have found tpm+luks support to be fragile and ineffective as it is usually not securing the initrd. I only got it working with my own boot hooks but those do not validate signatures with the TPM. I only need to decrypt the root partition and don't care if the PCR hashes don't match. On systems without modern, working tpms have even less options.
Even with Secure Boot we have a huge hole on 99.9% of linux installs in that the initrd is not signed or checked. The heads project addresses this but it is not an option for most of the computers in the world as it requires specific hardware modifications. Can we extend the chain of trust from Secure boot of the kernel to the initrd? Can the tpm or other hardware assist with this? See my hardening document.
Generally, the Linux boot chain with Secure boot looks at signatures for shims used by linux vendors. Microsoft signed the shims. Linux vendors boot whatever kernels they want with the shims but the initrd is not checked. Custom kernels cannot be signed by vendors. Even when vendors sign kernals the initrd gets updated with many package installs making it impossible to sign in that model.
How can we protect the initrd which cannot be signed by the vendor?
User has to sign
kernel has to have a way to securely check the signature
fallback and warnings not available. must boot a different kernel
The best approach seems to be to use Unified Kernel Images (UKI) where the initrd is combined with the kernel and protected by tpm hashing, etc. I have this working but it is somewhat fragile and complex.
When UKI is not an option is it possible to extend the kernel chain of trust to the intird? why do we have all of this machine owner key infrastructure that is hard to understand and setup if it doesn't actually protect the full system?