I'm playing with GRUB2, SecureBoot and Kernel Signing and I think I found a possible bug in my Secure Boot, but I want to check my understanding of these processes first.
I know that when Secure Boot is enabled, only binaries signed with a Key loaded in the firmware can be launched, so all bootloaders have to be signed. In a typical case are shim and GRUB.
Shim should lunch the MoakManager if the boot fails or you have some keys to import or delete and if it's all right it should then launch GRUB which is the real bootloader.
The problem is that I've just generated a custom version of GRUB with grub-mkstandalone
which I signed with a new key created with OpenSSl; a key I've not imported yet in the firmware, and shim was able to launch it without any reports from Secure Boot.
I checked the keys with mokutil --list-enrolled
and it reported only the Canonical Certificate.
So, to recap:
In my EFI partition I have:
- shimx64.efi signed by Canonical, generated with grub-install
- my custom GRUB, generated with grub-mkstandalone, signed with my own key, wich I've not imported yet, named
grubx64.efi
.
At boot SHIM could lunch GRUB and GRUB could boot Ubuntu successfully.
If some Secure Boot check only the sign of the first bootloader and the others loaders are responsable for verifying theirself and the modules they preload and users eventually load, the security concern here is really high.
I'll do some more tests, but maybe I should open a bug ticket.
Any ideas?