Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to prevent unconditional trust to built-in (vendor) certificate #707

Open
RomanValov opened this issue Dec 10, 2024 · 0 comments

Comments

@RomanValov
Copy link

Hi devs,

With ongoing adoption of UKIs it's now possible to build trust chain from UEFI firmware up to early userspace code driven by initrd/initramfs embedded into signed UKI. The approach is used to perform automatic TPM2-based LUKS device unlocking during initrd phase. TPM2 policies may be configured in a way to prevent automatic unlocking when unexpected boot code is involved but there is no way to prevent unexpected early userspace from being invoked (which may be used i.e. to spoof LUKS device password prompt).

Even if UKI is signed with a custom user key/cert there is still a possibility to run arbitrary unsigned initrd/initramfs code in conjunction with kernel signed by built-in (vendor) key/cert. The workflow is perfectly supported by shim-based setups due to legacy reasons.

The problem is that built-in cert cannot be un-enrolled to prevent unsigned initrd/initramfs workflow. Even if mokutil --delete is used against built-in cert, it's still populated into MokList and unconditionally trusted on next boot. Hence the proposal is to introduce NVRAM variable to prevent unconditional trust to the built-in certificate. Shim's SBAT Level have to be bumped in addition.

The approach may be considered too strict and soft-brick systems that do not have alternative certificates in MokList. Hence logic based on proposed NVRAM variable may check if there is alternative certificate enrolled into MokList.

P.S.: Other considered approaches:

  1. Add built-in certificate to MokListX. It works to some extent. However given there are plenty of shim versions that carry certs for other vendors and distros, it's not easily manageable to track and block them all. Otherwise it's still possible to drop a shim + kernel from unblocked distro onto ESP.

  2. Deploy custom PK and KEK. Looks like an overkill and not perfectly compatible approach due to multi-boot setups and Option ROMs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant