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

Pre-calculate and sign PCR 11 values on build #69

Merged
merged 15 commits into from
Mar 11, 2024
Merged

Pre-calculate and sign PCR 11 values on build #69

merged 15 commits into from
Mar 11, 2024

Conversation

brdanin
Copy link
Member

@brdanin brdanin commented Mar 1, 2024

This PR changes the current encryption behaviour in favour of binding to signatures of PCR 11 values with signed public key based policies. Binding to PCR 7 is kept static, as the Secure Boot state should not change during e.g. a kernel upgrade.

Following steps are being performed during the build process if a partition with the feature flag tpm2 is defined in the fstab.mod file:

  1. PCR 11 values get pre-calculated during the build process using ukfiy(could be changed in the future to systemd-measure)
  2. Generates a valid PCR signature JSON for the given build based on the values calculated in Step 1
  3. Combines .pcrsig and .pcrpkey sections into the final bootable Unified Kernel Image
  4. Optional: This UKI file can also be signed if Secure Boot is enabled

These steps are executed by the OS during boot:

  1. When creating the defined partitions, systemd-repart binds the encryption to the signature values defined in tpm2-pcr-signature.json (.pcrsig)
  2. systemd-cryptsetup then valides this signatures with the PCR 11 values present on the system and the public key provided using the tpm2-pcr-public-key.pem (.pcrpkey) certificate file
  3. If all checks out, the boot process is continued and the partition can then be mounted and accessed

builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
builder/image.d/makesecureboot Fixed Show fixed Hide fixed
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

Successfully merging this pull request may close these issues.

2 participants