canonical / canonical/secboot

Add WithBootManagerConfigProfile() (PCR 5)

Open
#323 0 comments 0 reactions 0 assignees View on GitHub
efi-pcr-profiles preinstall-checks
Dominant language
Go
Stars
23
Forks
29
Avg merge
2d 8h
Merged PRs (30d)
2

Description

If PCR7 isn't supported for some reason, eg, because secure boot is disabled or the device is not in deployed mode, then we should be able to fall back to a safe profile that includes PCRs 1, 2, 3, 4 and 5. PCR 2 and 4 are for binding to all code that's loaded outside of the platform firmware.

It should also be possible to optionally bind to PCR5 using the `PCRProfileOptionsFlags`.

PCR1 is to bind to all of the platform firmware's configuration - currently, changes to security-sensitive settings such as enabling a debugger or disabling DMA remapping change the value of PCR7 by adding extra EVI_EFI_ACTION events.

PCR3 contains any configuration related to UEFI drivers that are not part of the platform firmware.

PCR5 contains the GPT of the IBL and can be used for any bootloader configuration, although security sensitive bootloader settings should probably also modify the value of PCR7 in the same way that disabling DMA remapping does.

Note that v1.06 of the TCG PC-Client PFP spec introduces a new event type - `EV_EFI_GPT_EVENT2`, the event data for which uses the identical format as the previous `EV_EFI_GPT_EVENT` event - `UEFI_GPT_DATA`. The only difference is that the `DiskGUID` field of the partition table header and the `UniquePartitionGUID` fields of each partition entry are zeroed out for privacy reasons because attestations are meant to be privacy preserving, and high entropy fields in measurements break this.

To support this, the efi package needs a new `WithBootManagerConfigProfile` API that will support PCR5.

Most events will be copied to the profile, with the exception of the `EV_EFI_GPT_EVENT` and `EV_EFI_GPT_EVENT2` events. These will need to be predicted from the GPT of the boot device. Secboot will need to construct `tcglog.EFIGPTData` for this, which can be created from `efi.PartitionTable` with all unused partition entries omitted. Either `tcglog.ComputeEFIGPTDataDigest` (for `EV_EFI_GPT_EVENT` events) or `tcglog.ComputeEFIGPTDataDigest2` (for `EV_EFI_GPT_EVENT2` events) can be used to compute the digest.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.