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

shim should stop loading binaries without a .sbat section #591

Open
jsetje opened this issue Jul 27, 2023 · 4 comments
Open

shim should stop loading binaries without a .sbat section #591

jsetje opened this issue Jul 27, 2023 · 4 comments

Comments

@jsetje
Copy link
Collaborator

jsetje commented Jul 27, 2023

Currently shim will not directly, but through the shim_lock protocol, allow binaries that do not have a .sbat section to be loaded. For shims that carry certificates for complex products such as Linux distributions, this allows various chains to be constructed and may require a carefully considered vendor_dbx to be tracked and built into shim. In particular reviewing the fact that this list is complete is essentially impossible for someone outside of the organization that has created these signed binary artifacts.

The current behavior exists because Linux kernels, which are loaded by GRUB2 and validated via shim_lock protocol are currently not labelled with a .sbat section. While it is not hard to create such a section, what exactly should result in bumping the security generation number depends a bit on the posture that a particular chain of trust subscribes to. At the bare minimum, anyone using a signed shim needs to protect boot services state, so any bypasses in the EFI stub need to be covered. At the other end of the spectrum someone, that is extremely concerned about integrity, may want to be able to revoke for any unauthorized kernel memory write issues. In order to separate this issue which is intended to discuss the mechanism for making a .sbat section mandatory for at least some chains of trust from the security generation discussion I have created a separate issue #590

Unless some external event forces an epoch upon us, it is desirable not to create one and this allow for backwards compatibility. The most obvious way to do this is to introduce a new key ring that creates a chain of trust that enforces having a .sbat section even in shim_lock protocol. Shims signed with the UEFI CA would initially be allowed to carry certificates on both key rings, but would would eventually be required to only embed keys that trust binaries that are required to have a .sbat section. However, this would not prevent someone from building and signing a shim with certificates on the key ring that does not require a .sbat section which means that folks building small or even one-off trusts do not need to worry about curating the SBAT security generation for their kernels.

@jsetje
Copy link
Collaborator Author

jsetje commented Aug 2, 2023

@jejb from some external discussions it sounded like you might be using shim to produce binaries that implement a slightly different posture. Would what is outlined above be workable in the scenarios you care about? If not, I would really appreciate any comments.

@jejb
Copy link

jejb commented Aug 2, 2023 via email

@jsetje
Copy link
Collaborator Author

jsetje commented Aug 3, 2023

Thank you for taking a look at this!

Loading system specific binaries from the GRUB menu is an interesting use case. Presumably those would be signed by either the PK or another key on the system's DB and not by a key embedded in shim. That's a good argument for making a keyring that requires binaries to carry a .sbat section to remain special in that way.

@ValdikSS
Copy link

ValdikSS commented Oct 4, 2023

In fact, loading unsigned files without .sbat secrion entolled by hash does not work: #489

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

3 participants