| Summary: | no-touch-required flag not restored from hardware token | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | snegrea | ||||||
| Component: | ssh-keygen | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||
| Status: | NEW --- | ||||||||
| Severity: | normal | CC: | djm, mindrot, mindrot, nikolas | ||||||
| Priority: | P5 | ||||||||
| Version: | 8.4p1 | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Attachments: |
|
||||||||
|
Description
snegrea
2021-10-18 03:37:04 AEDT
I don't think the FIDO standard offers any way for the security key to communicate whether a resident key requires touch back to the application. Typically in the web model this information is held and communicated to the client from the RP, but there is no analogue for this in the SSH setting. Thanks for the insight about the FIDO standard. Could you please give me a pointer about where to find documentation regarding the standard? I did not have much luck searching. Is there a way to set no-touch-required flag after the key is downloaded from the hardware? The main issue is that while the key is/was properly configured in the hardware token there is no way to correctly set this flag on the local disk files in the event of a restore operation. ssh relies local disk files to pick up this flag so if there is another way to correctly set this flag, then this becomes a user configuration issue. This particular issue makes it impossible to consistently use a hardware token on multiple computers because the flags are not correctly restored. (In reply to snegrea from comment #2) > Thanks for the insight about the FIDO standard. Could you please > give me a pointer about where to find documentation regarding the > standard? I did not have much luck searching. They are at https://fidoalliance.org/specifications/download/ but aren't especially easy to read unfortunately. > Is there a way to set no-touch-required flag after the key is > downloaded from the hardware? The main issue is that while the key > is/was properly configured in the hardware token there is no way to > correctly set this flag on the local disk files in the event of a > restore operation. ssh relies local disk files to pick up this flag > so if there is another way to correctly set this flag, then this > becomes a user configuration issue. Not at present. I'll think about how we could add this... I can replicate this issue if using a passphrase for the new key. Otherwise it works fine. Device type: YubiKey 5 NFC Firmware version: 5.2.4 $ uname -a Linux [...] 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux $ ssh -v OpenSSH_8.4p1 Debian-5, OpenSSL 1.1.1k 25 Mar 2021 $ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye (In reply to nikolas from comment #4) > I can replicate this issue if using a passphrase for the new key. > Otherwise it works fine. > > Device type: YubiKey 5 NFC > Firmware version: 5.2.4 > > $ uname -a > Linux [...] 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) > x86_64 GNU/Linux > > $ ssh -v > OpenSSH_8.4p1 Debian-5, OpenSSL 1.1.1k 25 Mar 2021 > > $ lsb_release -a > No LSB modules are available. > Distributor ID: Debian > Description: Debian GNU/Linux 11 (bullseye) > Release: 11 > Codename: bullseye Please excuse me, I have been wrong. Passphrases don't affect this bug. Has there been any progress on this issue by any chance, the issue still exists in OpenSSH_9.2p1. If there's still no clear idea forward I would suggest adding the `-O no-touch-required` option to the `ssh-add -K` and `ssh-keygen -K` commands when loading keys from a fido token. This way the action to use no touch on restore is conscious but easily automated with for example shell aliases. Created attachment 3682 [details]
ssh-keygen: accept -O no-touch-required with -K
This (should - it's untested) allow manually clearing the touch-required flag when downloading resident keys from a FIDO token.
E.g.
ssh-keygen -K -O no-touch-required
Please give it a try
Fantastic, I can confirm that this patch works on latest HEAD. Would the same change be easily applicable to ssh-add too? Created attachment 3683 [details]
ssh-add: support -O no-touch-required with -K
Here's the same for ssh-add.
I guess the next thing people will ask for is selecting which keys are downloaded or added, since they might not want to apply no-touch-required to all of them. I guess adding support for the user= and application= strings to the respective download options is next.
ssh-add works fine as well, great stuff I agree on having some flexibility on selecting what keys should be with additional features. However, ideally this should be based on the fido credential id in my opinion. At least I believe that application and user can be identical for multiple keys and thus would affect more than one key. This would not allow more granular selection of one specific key. Credential id should however be unique (at least from what I can see on my Yubikey) |