-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Use shred instead of rm on secret related files. #526
Conversation
I don't have access to that slack channel, but (verified!) dom0 will have access to LUKS key anyway. But for that to happen, one need to run 1) unmodified firmware 2) provide luks passphrase (actually passphrase to unlock luks key). The key is not loaded into RAM unless both happen, which (hopefully) mean it's legitimate owner accessing the machine. My concern is HOTP/TOTP key, which is loaded into RAM before the user provide any secret. And it is also the thing authenticating machine to the user, so if it got stolen, attacker could convince the user to provide the password (into now backdoored firmware). So we should ensure that this secret doesn't leak anywhere. Yes, coldboot style attacks are probably still possible, but are much harder to perform (especially if you control the firmware), than just booting random Linux using built-in menu and dumping RAM from there. As for the actual PR, yes it should be good. I'm not sure if |
Let's go high level first on TOTP/HTOP interaction. Exerpt from here with some comments inline:
This happens everytime the firmware gets modified. If the user didn't update it by himself, he should be alarmed by being prompted to generate new TOTP/HTOP secrets. The vulnerable part would be when the QrCode is generated and when the HOTP secret is sealed into the Nitrokey Pro v2/LibremKey. Those functions are called only when PCRs mismatch and require the user to type TPM/GPG card Admin PIN, a reboot is required after this step.
The TOTP code generation happens here while the HOTP happens here. They both depends on the TPM, and the secret could be grabbed only if the firmware was modified, which the user would be aware of and asked to regenerate TOTP/HOTP secret.
Heads sends HOTP code here. The TPMTOTP is used to unseal disk unlock key here only if PCRs matches, the passphrase typed would fail if the firmware or LUKS header gets modified. So even if the user looses it's GPG card, doesn't check the TOTP numeric code on his phone, the system won't permit to unlock the disk with disk unlock key and will propose the user to unlock the disk with disk recovery key passphrase. That is where we are now. |
Sounds fine! A little comment: this shred should be done also in case of success. In fact, especially in case of success. |
dcb5b25
to
2740317
Compare
@marmarek: applied. But again, HOTP/TOTP generation happens when firmware tampering is detected (measurements don't match) and is followed by a forced reboot before being able to use the system. |
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.
This seems straightforward to me. Approved.
Replacing rm with shred for secrets that should not be present in ram when booting OS.
Address the following concerns