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

Add TPM with PCR binding example #431

Closed
travier opened this issue Jul 19, 2022 · 7 comments · Fixed by #558
Closed

Add TPM with PCR binding example #431

travier opened this issue Jul 19, 2022 · 7 comments · Fixed by #558
Assignees
Labels
good first issue Good for newcomers jira

Comments

@travier
Copy link
Member

travier commented Jul 19, 2022

From:

add an example to the docs that binds the LUKS disk encryption to the TPM's PCR 7 value.

@travier travier added the good first issue Good for newcomers label Jul 19, 2022
@bgilbert
Copy link
Contributor

bgilbert commented Jul 19, 2022

Note that we currently can't bind to PCR 8 because we change the kernel command line on every OS update.

@jlebon
Copy link
Member

jlebon commented Jul 19, 2022

IIUC, the values can change by updating UEFI firmware/certificates (e.g. via fwupd). We should make sure to note this and include instructions for updating the Clevis binding in that situation.

@travier
Copy link
Member Author

travier commented Jul 20, 2022

The PCR 7 value should be the Secure Boot certificate only from memory and should not be affected by other things changing.

@lukewarmtemp lukewarmtemp self-assigned this Jun 5, 2023
@lukewarmtemp
Copy link
Contributor

@travier Do you think I should add steps to on how to emulate a TPM2.0 device for development in the documentation as well? A significant portion of getting TPM working and binding the the disk encryption to PCR 7 was setting up the Fedora CoreOS VM correctly. Or should we assume that developers reading the documentation will be working with real machines that have physical TPM devices?

@travier
Copy link
Member Author

travier commented Jun 7, 2023

If you run it with cosa run, which uses kola, there is an option to get a virtual TPM: https://github.com/coreos/coreos-assembler/blob/main/mantle/cmd/kola/options.go#L159

If you've found a good resource to setup a virtual TPM with libvirt then we could link to it but otherwise I think it's a bit out of scope for the documentation.

@cgwalters
Copy link
Member

With cosa run it's on by default, the option is to turn it off.

I think improving the ergonomics of all of this relates to coreos/fedora-coreos-tracker#235

If you've found a good resource to setup a virtual TPM with libvirt

https://www.smoothnet.org/qemu-tpm/

@lukewarmtemp
Copy link
Contributor

https://www.smoothnet.org/qemu-tpm/

I had a look at this source, but it didn't seem to work for my dev environment. I ended up using this method:

https://en.opensuse.org/Software_TPM_Emulator_For_QEMU

and modified the bash script listed in the Fedora CoreOS documentation:

https://docs.fedoraproject.org/en-US/fedora-coreos/provisioning-libvirt/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants