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

idea: password protection #881

Closed
jans23 opened this issue Oct 30, 2020 · 10 comments
Closed

idea: password protection #881

jans23 opened this issue Oct 30, 2020 · 10 comments

Comments

@jans23
Copy link

jans23 commented Oct 30, 2020

A customer or ours wishes a simple password protection in Heads. This should prevent against simple DoS attacks where somebody executes a factory reset or other misconfiguration. Do you think this makes sense?

@tlaurion
Copy link
Collaborator

tlaurion commented Nov 1, 2020

@jans23 #361 ?

@tlaurion
Copy link
Collaborator

tlaurion commented Nov 1, 2020

@jans23 : Once again, that would depend of #771 if we want to implement this correctly, so that users don't lock themselves out if USB Security dongle is lost, while not having a secret hardcoded somewhere that could be extracted (externalize that validation).

Authentication could then be implemented prior of going into recovery shell, which could mainly mitigate #836 (comment), since access to recovery shell is mandatory to be able to modify boot scripts and get away of the protection given by Heads GUI in absence of a TPM to invalidate measurements and delete secrets prior of entering recovery shell

@szszszsz
Copy link
Contributor

szszszsz commented Nov 6, 2020

@tlaurion The initial idea was to use a simple passphrase as a low-security mean against non-hackers, and without the need for the USB Security dongle. Saying that, the #361 sounds like a right way to do it from a brief look.
Perhaps both should be possible - that is unlocking Heads configuration with passphrase or USB Security dongle.

cc: @alex-nitrokey

@tlaurion
Copy link
Collaborator

tlaurion commented Sep 10, 2021

@szszszsz @alex-nitrokey #361 was finally tested, and works well.

@persmule
The only problem I see with it is that if the public key is expired (just tested) Heads will panic and won't let the machine owner go into recovery.

@MrChromebox There could be some fallbacks or other options.

  • One i'm thinking is reusing the Disk Unlock Key passphrase (TPM sealed and protected decryption key) to test unlocking LUKS container. If that passphrase succeeds, then we know that the the sealed measurements in reserved TPM NV memory contained the LUKS header which is part of what is measured to release the Disk Unlock Key. So we know no drive swap occured and can safely land into recovery shell.
  • Another one, less secure, would be to permit recovery access by prompting for the Disk Recovery Key (LUKS slot 0 passphrase). That one would permit an attacker to swap current disk with one he prepared and for which he knows the passphrase to be able to access the recovery.
  • Another option could be to mitigate the problem of an expired public key by permitting in the GUI to extend the expiracy date of that key, export on external media if desired and reflash. On reboot, user would need to reseal HOTP.
  • But the most tragic use case is if the user lost his USB Security dongle.

Thoughts?

@kylerankin
Copy link
Collaborator

kylerankin commented Sep 11, 2021 via email

@daringer
Copy link
Collaborator

I would also totally second @kylerankin 's thoughts here, from user perspective the only thing that counts is: "I need to factory-reset my device at any time" -> So I would also 1st vote for a factory reset mechanism, which should always be possible, leaving the device in a state in which the user (if an attacker has done it) will clearly see that someone has tampered the device.

@tlaurion
Copy link
Collaborator

tlaurion commented Sep 13, 2021

@daringer @kylerankin :

So I would also 1st vote for a factory reset mechanism, which should always be possible, leaving the device in a state in which the user

That mechanism is already in place and is triggered automatically under gui-init here when no gpg user's public key were imported in ramfs from key-init that were extracted from cbfs-init early at boot.

Of course, the user is guided into gpg options only if no gpg public key were found in the ROM, but it is already there, and basically launches gpg-gui.sh. Otherwise the user has to go there manually.

What would we want to add here to meet your needs here?

  • A test to check if public keys found in ROM are not expired? If expired, tell the user it is and invite him to extend expiracy date or reset his dongle (Y/n).
  • Give additional option under gpg-gui.sh to the user to change expiracy date, where user has been offered in previous advice.

The rest is already covered, yes?
Question uncovered here is: dongle is lost. Do we want a backup mechanism, less secure:

  • To use Disk Unlock Key passphrase, which unlocks sealed TPM NV space only if LUKS header is valid + firmware measurements + not having went to recovery and if successful, let user go to recovery?
  • Open up for less secure option of asking user to type Disk Recovery Key passphrase for disk encrypted partition (cryptsetup luksOoen call on referred encrypted partition in file /boot/kexec_key_devices.txt ?)
  • Or, just expect the user to boot insecurely his system until he buys and receive a new USB Security dongle that he will have to factory reset through gpg-gui.sh from GPG Options menu?

@kylerankin
Copy link
Collaborator

kylerankin commented Sep 14, 2021 via email

@daringer
Copy link
Collaborator

daringer commented Sep 15, 2021

What would we want to add here to meet your needs here?

  • A test to check if public keys found in ROM are not expired? If expired, tell the user it is and invite him to extend expiracy date or reset his dongle (Y/n).
  • Give additional option under gpg-gui.sh to the user to change expiracy date, where user has been offered in previous advice.

I would go for option 1 only to keep things straight, resetting the dongle is perfectly fine and enough. The 2nd option is a "nice-to-have" but I don't feel like this is really necessary.

The rest is already covered, yes?
Question uncovered here is: dongle is lost. Do we want a backup mechanism, less secure:

  • Or, just expect the user to boot insecurely his system until he buys and receive a new USB Security dongle that he will have to factory reset through gpg-gui.sh from GPG Options menu?

Giving the user options for less secure setups, will lead to this option getting permanent. So I would (also for the sake of reduced complexity) force the insecure boot, which will then (hopefully) force the user to get a new dongle.

@tlaurion
Copy link
Collaborator

Integrated in #1515

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

No branches or pull requests

5 participants