release article mentions widening support for systems without compatible hardware for secure boot and full disk encryption. This model includes:
activated only during install
UEFI
Secure boot
UKI (unified kernel image)
non standard partition layout
signed kernels and initrd from canonical
snapd managed kernels
tpm
In summary this is a customized UKI on unencrypted boot checked with secure boot. While it's a step in the right direction it doesn't work for most people. I cannot get it to work on hardware that is a few months old and seems that few on the Internet can get it to work. Since it doesn't work it's not a viable option. I'll document what I know here but keep moving in other directions that align with actual working systems and closer to the rest of the world.
Ubuntu wipes the disk and recreates all partitions--EFI partition included.
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB BIOS Boot bios_grub
2 2097kB 5245MB 5243MB fat32 ubuntu-seed boot, esp
3 5245MB 6031MB 786MB ext4 ubuntu-boot
4 6031MB 6065MB 33.6MB ubuntu-save
5 6065MB 256GB 250GB ubuntu-data
UKI is one image that combines both initrd and kernel. To allow everything to work the initrd would have to include every possible package but that still would not allow any custom workflow that is needed. This would only work for stock settings. Since the luks2 device is passed from grub I am assuming that grub is setup first before the tpm2 handshake with the hashing of the grub.
AI tells me that it is not possible to use canonicals FDE+tpm with any customizations. In this case it would be very helpful for canonical to include my extensions to initramfs which supporting booting encrypted luks root volumes without adding files to initrd. Some of my workflow still modify the initrd but i plan to remove that requirement.
some users are reporting that the installer issue can be worked around by using the old school install with encryption (which often doesn't work) and then manually setup the TPM setup. I can get it to install but the tpm setup doesn't work. I have a utility that does support the tpm bootup and may add that after the fact.
Even though UEFI can boot the kernel directly, ubuntu keeps grub in the mix to allow fallback to a working kernel if an update breaks the system. UEFI cannot detect a kernel problem. As grub will boot anything this method is not hardened against evil maid attacks against the efi and boot partitions.
An alternative to the ubuntu approach. Every time we update kernel and/or inird we create a UKI and sign it then register it with UEFI. We leave 2 or 3 UKIs in UEFI. We could manually choose a backup kernel in UEFI if an update breaks. The user would have to be trained to go into the UEFI boot menu but most of us using these features can figure this out. It would also be compatible with dual boot setups.
We store the UKI kernels in the efi partition so that Secure boot can get to them. they wont boot if tampered with. since the initrd is part of the uki we dont have to worry about it being modified. To make this happen we have to generate a private key and a certificate. the private key may sit on the encrypted root partition and the certificate may be placed on efi. The private key must be registered in UEFI--not IN mok.
the shim that the linux vendors use checks for machine owner keys (MOK) but only in a local database--NOT in the uefi registered database. An attacker with physical access may modify the shim process.
now we dont use the tpm for booting the system. we can use it for unlocking the full disk and we dont even need a boot partition since the kernels are in efi.
sudo apt update
sudo apt install systemd-ukify binutils
KERNEL=/boot/vmlinuz-6.8.0-51-generic
INITRD=/boot/initrd.img-6.8.0-51-generic
MY_UUID=$(findmnt -n -o UUID /)
sudo -E ukify build \
--linux="$KERNEL" \
--initrd="$INITRD" \
--cmdline="root=UUID=$MY_UUID ro quiet splash" \
--os-release=@/etc/os-release \
--output=/boot/efi/EFI/ubuntu/ubuntu-latest.efi
I have been unable to make the stock tpm feature work. It only works with my custom boot scripts.
another approach is to have secure boot boot the shim signed by Microsoft which canonical signed (i think) which then boots grub which decrypts a luks1 enCrypted partition (boot or root). since boot is encrypted it cannot be tampered with. Since the shim is protected by secure boot it would allow us to encrypt the entire system.
The downside is that this forces us to type a passphrase to unlock since that is the only way to unlock luks1.
Direct Comparison: Which is best for UKIs?
Bootloader Dynamic UKI Detection? Speed Visual Interface Complexity
systemd-boot Yes (Automatic) Extremely Fast Minimal Text Very Low
EFISTUB No (Static NVRAM) Instantly Fast None (Bios Menu) Medium
rEFInd Yes (Automatic) Fast Beautiful Graphical Medium
GRUB No (Requires Config generation) Slower Custom Text/Themes High