Secure Boot lays the foundation for the security of the entire computer system. However, in practice, there are potential security risks in secure boot.
In the previous post “Secure Boot 101: Getting Started with Secure Boot”, we introduced several core concepts of Secure Boot. In reality, users’ computers are often encrypted, and using TPM (Trusted Platform Module) to store encryption keys is a good solution — users can have an encrypted disk without having to enter the password each time the computer restarts. Additionally, this ensures that if the hard drive is maliciously removed from the computer, the key will not be leaked as it is stored in TPM.
However, relying solely on TPM to store keys is far from sufficient. Attackers can remove the hard drive and replace it with another one. If the password is directly stored in the TPM chip without verifying the system state, there is a security issue: any user with physical access to the machine from the operating system level can obtain the key. Furthermore, attackers can replace the disk, extract the key, or even request the key from TPM by changing the initramfs/initrd or modifying the GRUB boot process. Therefore, a system relying solely on TPM is not as secure, at least not meeting our objectives.
The ideal trust chain should ensure that each step is trusted by the previous one and establishes the trust foundation for the next step. For Secure Boot, the ideal steps should be:
This process ensures that each step in the boot process is trusted by the previous one and endorses trust for the next one. The trust begins by signing the GRUB2 EFI executable file with a self-signed certificate, overriding other “ordinary” certificates in UEFI. Using grub-standalone instead of regular GRUB2 means that GRUB configuration files and modules are embedded into a signed single executable file. This prevents the injection of GRUB modules (drivers) or changes to parameters. Additionally, GRUB should be password-protected and then calls signed and verified kernels and initramfs/initrd.
This trust chain seems reasonable as it prevents interference with the boot order and ensures that the unencrypted portion of the partition is not replaced. Attackers cannot load any different GRUB, nor can they modify the configuration, initramfs/initrd, or the kernel.
However, the weak link in the above process is the boot loader. Attackers may attempt to inject kernel drivers or malicious code when GRUB is called. To address this, Ubuntu enforces the use of SHIM, a pre-loader mechanism. In this scenario, the operation of the trust chain is slightly different:
The problem with this process is that there are external sources in the trust chain, and different components may be replaced or patched. The issues are as follows:
SHIM, by default, trusts Microsoft certificates, meaning your computer will trust all Microsoft-signed boot loaders and content.
Taking control of Secure Boot has several advantages:
This post discussed potential security risks in Secure Boot. In practice, instead of self-signing all content, using TPM PCR (Platform Configuration Register) for better protection of encryption keys is an alternative. PCR contains hash values of all content during the boot process, such as firmware settings, boot order, boot loader content (like SHIM, GRUB), kernel, and initrd. TPM can be configured to release the encryption key only when PCR contains specific values (or matches the state before boot). This helps prevent data theft because if an attacker replaces the hard drive or modifies the bootloader, it disrupts PCR, and TPM will refuse to release the key, ensuring the security of the data.
Secure Boot and TPM can establish a secure foundation for the computer’s boot process, but Secure Boot is not a cure-all. In execution, security needs to be safeguarded from multiple perspectives to avoid neglecting the fundamental trust roots while introducing advanced technologies.
The post Making Secure Boot Even More Secure appeared first on NSFOCUS, Inc., a global network and cyber security leader, protects enterprises and carriers from advanced cyber attacks..
*** This is a Security Bloggers Network syndicated blog from NSFOCUS, Inc., a global network and cyber security leader, protects enterprises and carriers from advanced cyber attacks. authored by NSFOCUS. Read the original post at: https://nsfocusglobal.com/making-secure-boot-even-more-secure/