Open GavinFrazar opened 1 year ago
Assigning @Joerger for PIV support.
I think the endgame here is to do only the PIV check, skipping MFA entirely. Yubis, in my experience, don't do well with operations that close in time. Other than that, which may be a more difficult change, I'm not sure there's much that can be done.
FWIW I was not able to reproduce this with my YubiKey 5C NFC or my YubiKey 5 Nano on Linux.
Hey @GavinFrazar and @Joerger, did we get a resolution here?
Hey @GavinFrazar and @Joerger, did we get a resolution here?
No, I'm not sure we have a good solution as of now. We don't have eyes into the transactions on the YubiKey, so like you said, it can be finicky when multiple transactions are being made, especially from different protocols.
IIUC the workaround is to just tap the YubiKey a bit slower. We could try to build a timeout into tsh
to prevent it from prompting them one after another too quickly, but I'm not sure an arbitrary timeout is guaranteed to help here.
I still think "combining" the prompts into just the PIV prompt would be the best call. If there are session "keepalive" prompts, further from the initial one, then only those should do WebAuthn.
Let's keep the issue around, then. Thanks for the update.
I've added a troubleshooting tip for this error for now.
Expected behavior:
$ tsh login
logs in with mfa and yubikey prompts.Current behavior:
Bug details:
Steps to reproduce:
require_session_mfa: "hardware_key_touch"
tsh login
Tap any security key
promptTap your YubiKey
but do so before it starts blinking again (it takes some short time before it starts to blink again). Alternatively, just keep tapping the yubikey immediately after the first prompt.There’s a brief window of time after you tap for the yubikey prompt (too early, before it starts blinking) where the key will be blinking, but tapping during this window is futile and you still get
ssh: handshak failed:…
error message.It seems that to successfully login, you must be careful to wait for the yubikey to start blinking again before tapping it the second time. We should at least hint the user about the quirky behavior when they see the error message.
Additionally, after you have reproduced this failure, the yubikey will still be blinking (for a few seconds). If you try to log in again while it's still blinking, you get another error. We should try to provide a hint in this case as well to simply wait for the key to stop blinking and try again. I occasionally ran into an issue where I would start seeing this error message as well:
however I cannot reproduce this one. It only resolved when I unplugged my yubikey and plugged it back in.
Debug logs
initial login attempt:
Subsequent attempt while yubikey is still blinking: