-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Faq refresh #67
Faq refresh #67
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.jekyll-cache | ||
_site |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,12 @@ Should I validate the TPMTOTP on every boot | |
|
||
Probably. I want to make it also do it at S3. [See Heads issue #69](https://github.com/osresearch/heads/issues/69) | ||
|
||
How is the TPM used in heads? | ||
---- | ||
|
||
Stores secret something? Could also have a disk unlock key. | ||
|
||
|
||
suspend vs shutdown | ||
---- | ||
|
||
|
@@ -182,6 +188,16 @@ throttling or limiting the number of failed attempted while TOTP is susceptible | |
to phishing attacks and requires a user to enter the code within a given time | ||
period. | ||
|
||
How is HOTP used in heads? | ||
---- | ||
|
||
TBD | ||
|
||
How is TOTP used in heads? | ||
---- | ||
|
||
TBD | ||
|
||
coreboot vs Linuxboot | ||
---- | ||
|
||
|
@@ -190,4 +206,118 @@ TO BE WRITTEN | |
What happens if I lose/break my security key | ||
---- | ||
|
||
TO BE WRITTEN | ||
This depends on whether or not you have backups for the key. If you have no backup you will have lost access to all data that was encrypted using this key. If you have backups you may create a new key from them. The counter on the key will be different but you can reset that in heads. Since you know that something changed you can ignore the tampering warning. | ||
|
||
What is the recovery shell? | ||
---- | ||
|
||
The recovery shell is a minimal unix shell running on top of the heads kernel. It can be used to investigate and configure the heads environment. | ||
|
||
What are the limitations of the recovery shell? TBD | ||
---- | ||
|
||
This thread (https://github.com/osresearch/heads/issues/639#issuecomment-570014587) says that the secrets from nvram are wiped before the recovery shell is launched. Does this limit what the recovery shell can do? Can the secrets be recovered using my other security infrastructure for validating that each step of the configuration and boot is working? | ||
jtmoree-github-com marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
When do I need to reflash the BIOS? TBD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reflashing the bios is kinda the only way to make completey sure of its state. See linuxboot/heads#836 See how it gets complicated? TL;DR: you flash if there is a new official version you want to benefit from the new features. You reflash if in doubt you have been hacked. I personally reflash the same ROM here and there. Reflashing the same rom means having the same coreboot stages measured. If your config/user and public key are the same: the measurements will be the same. Reflashing the same version in terms of flashrom function means you are actually taking a backup out, and reflashing only what changed. No change, no change. And then on reboot, HOTP/TOTP should be the same. |
||
---- | ||
|
||
To change the default boot | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the heads menu that hosts the default boot option states that any changes are temporary and the BIOS has to be reflashed to save the setting. The default boot is the only meaningful change in that scope. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. The default boot option doesn't reflash the BIOS whatsoever. Here is my /boot kexec files:
There, you see interesting files that are covered in specific section already. Please do not mix things up, and simply refer to other documentation sections, non duplicating them. In recap, kexec_hashes.txt contains the current /boot hashes. kexec_default_.#.txt contains the hashes corresponding with the current boot default hashes: The ROM is only modified when flashing, merging user configs so they become persisten, or when adding user public key. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/osresearch/heads/blob/master/initrd/bin/config-gui.sh Line 18. Normally, to save things to BIOS requires write access to NVRAM. How about:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jtmoree-github-com This is getting more and more complicated for me to understand. A FAQ means Frequently Asked Questions. Those questions were never asked to me and are linked to implementation details and confusions I don't quite understand the origin. config-gui.sh:
As stated before elsewhere, and this gets really confusing to me, config-gui.sh is proposing to the user the above options. This has nothing to do with saving a new boot default, which is what I explained before. So once again: The ROM gets modified when
Can we check where what things should be understood prior of being documented maybe? Not sure how to properly handle this while not taking all my time to review all that was already asked and replied in issues everywhere, already, before, but spot on questions that still need explanations. That is why everything is attempted to be answered on github. Let me know how you see this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is 4.2 here #25 (comment) |
||
Anything else? | ||
|
||
What secrets are stored in BIOS? TBD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None. TPM: PCRs are not secrets, but a result of calculations on coreboot stages + some added measurements (kernel modules, config.user, public key, going into recovery to invalidate secret, since going into recovery wipes the precalculated secret in memory, LUKS header). Bios!=TPM. Then TPM NV space contains a secret. But as stated before, that secret is released only if measurements are the same + Disk Unlock Key passphrase |
||
---- | ||
|
||
LUKS passphrase for disk (optional) | ||
|
||
|
||
If secrets are wiped out at a drop to the recovery shell, can I safely reflash from there? Do secrets get erased if flashing from the recovery shell? | ||
---- | ||
|
||
TBD | ||
|
||
Can the HOTP/TOTP functions work in the recovery shell if secrets are wiped? | ||
jtmoree-github-com marked this conversation as resolved.
Show resolved
Hide resolved
|
||
---- | ||
|
||
TBD | ||
|
||
When flashing the BIOS I can choose to keep or erase settings? What settings? Can they be regenerated? Will I lose anything important? TBD | ||
---- | ||
|
||
The erase choice will remove signatures and settings from boot. /boot/kexec* | ||
? the sigs and hashes can be regenerated. Key is a string such as ‘Librem Key’. What about counter? | ||
|
||
|
||
What is /tmp/kexec? TBD | ||
---- | ||
|
||
|
||
Assuming heads is running on the system, what are the steps for configuring it using the recovery shell? | ||
---- | ||
|
||
This likely needs to be a howto ARTICLE but each step is decribed here. | ||
|
||
### Set default boot | ||
|
||
Heads needs to know which partition to use for bootup. The setting is based on an environment variable which is set in /etc/config.user. | ||
|
||
```echo “export CONFIG_BOOT_DEV=’/dev/sdX’” > /etc/config.user``` | ||
|
||
### Flash current settings into BIOS TBD | ||
|
||
This is technical and risky. Perhaps a separate document is best? | ||
|
||
### Set tpm owner password TBD | ||
|
||
```tpm-reset``` | ||
|
||
### Sign files in boot | ||
|
||
This command will use your security token to sign all files in /boot (except kexec*) and record the sigs in the file kexec_hashes.txt | ||
|
||
```kexec-sign-config -p /boot/``` | ||
|
||
### set hotp/totp TBD | ||
|
||
hotp, hotp_verification, hotp_initialize | ||
, totp | ||
|
||
|
||
What security related files are added to /boot on my system? And what are they for? | ||
---- | ||
|
||
### kexec.sig TBD | ||
|
||
### kexec_hashes.txt | ||
|
||
This file holds the signatures of all of the files in /boot. On boot a new signature for the files is generated using your security token. The sigature would not match the file if either the hashes file or the /boot files have changed. Since an attacker will not have your security token they would not be able to modify the files in a way that would pass verification. | ||
|
||
### kexec_hotp_counter TBD | ||
|
||
|
||
### kexec_hotp_key TBD | ||
|
||
|
||
### kexec_rollback.txt TBD | ||
|
||
|
||
|
||
|
||
How do I boot my OS in the recovery shell? | ||
---- | ||
|
||
Use Kexec-boot to ignore all verification and boot an OS. | ||
|
||
```kexec-boot -b /boot -e ‘foo|elf|kernel /vmlinuz|initrd /initrd.img|append root=/dev/whatever’``` | ||
|
||
|
||
Can I use multiple security tokens? | ||
---- | ||
|
||
Yes with some caveats. If the tokens have the same private key loaded they will perform the same cryptographic functions but the internal counter will always be different on each. This will show as tampering when switching between them. The best use case is to have one as a backup for the other. If the primary is lost the secondary may be used and the counter may be reset on first use. | ||
|
||
What if we sign files in heads on two different systems with the same security token? Will the counter always be off? | ||
---- | ||
|
||
YES? | ||
TBD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally, Heads base was coreboot 4.8.1 with a measured boot patch applied on top of it.
In newer versions, coreboot integrated measured boot, and that patch was modified to respect the same measuring scheme then coreboot. The PCRs used in Heads extends the ones of coreboot by also measuring the state of the Recovery shell (if going into recovery shell, the measurements are extended and invalidated). The user related files are also measured (GPG public key, config.user overlay). You should refer here to produce this doc and extend the one there or refer to the one there and extend there. Duplicating doc duplicates maintenance of such doc. (kernel modules, config.user, public key, going into recovery to invalidate secret, since going into recovery wipes the precalculated secret in memory, LUKS header)
Heads takes those measurements to calculate a secret, which upon sealing (TOTP/HOTP) is "challenged" against an external device.
In the case of TOTP, this output takes the form of a Qr code, to be scanned on a smartphone to remote attest the firmware state at each boot on that smartphone. This requires the user to verify manually on his phone.
In the case of HOTP against Heads' supported USB Security dongles (Nitrokey Pro, Nitrokey Storage, Librem Key), in presence of a TPM, those measurements are used to challenge the USB Security dongle with that value.
In the case of the user having setuped a Disk Unlock Key (a secondary LUKS header slot) through setting a default boot option, the a TPM defined NV memory region can release a randomized Disk Unlock Key if: the TPM measurements are valid and the passphrase to unlock the TPM NV space is valid. In that case, the TPM will release the Disk Unlock Key, embedded into a initrd additional file which is passed to the OS. The Disk Unlock Key passphrase can be changed by setting a new boot default, and requires the user to type his Disk Recovery Key passphrase and then renew/change his Disk Unlock Key passphrase. This changes /boot content, and will also ask for the GPG User PIN to sign the changes.