Yubikey & OnPrem AD - is it working for you?
I'm testing out a deployment of Yubikeys as 2FA in a test environment following the instructions from Yubico's documentation (https://support.yubico.com/hc/en-us/articles/360013707820). I'm running into a brick wall at the step labeled "Setting up Windows Server for YubiKey PIV Authentication".
Has anyone here been successful at deploying yubikeys to your on prem AD without 3rd party software? If so, what documentation did you follow?
Yes, I know I can use 3rd party software from many vendors to do this. I'm trying to sort out the process to do it without 3rd party software as the Yubikey is able to act as a smartcard for AD.
Posted Jan 24, 2022, 3:58 PM UTC
Yes, I use Yubikeys as Smart Cards (PIV/CAC) with my on-premises AD. I deployed it without any additional third-party software except for Yubikey's own SC Mini-Driver. I followed the same guide you linked in your post. The step you're stuck on is the main requirement for making this all work: a Certificate Authority, preferably a 2-tier PKI.
The whole system works great. I have several smart cards (certificates+keys) on my Yubikey: 1x Tier 0 (DA), 1x Tier 1, and 1x Tier 2. The Yubikey 5 can handle up to 15 smart cards. I created another Yubikey with another set of SCs (different certificates) that I keep at home for remote access and as a backup.
I'm obviously missing something in this process because even though the process of installing the certificate completes successfully on the yubikey the step that verifies the certificate is installed fails misserably:
At the step for verifying the key has the certificate we get:C:\Users\Administrator\Downloads>certutil -scinfoThe Microsoft Smart Card Resource Manager is running.Current reader/card status:Readers: 10: Yubico YubiKey OTP+FIDO+CCID 0--- Reader: Yubico YubiKey OTP+FIDO+CCID 0--- Status: SCARD_STATE_PRESENT | SCARD_STATE_INUSE--- Status: The card is being shared by a process.--- Card: YubiKey Smart Card--- ATR:3b fd 13 00 00 81 31 fe 15 80 73 c0 21 c0 57 59 ;.....1...s.!.WY75 62 69 4b 65 79 40 ubiKey@=======================================================Analyzing card in reader: Yubico YubiKey OTP+FIDO+CCID 0Missing stored keysetMissing stored keyset--------------===========================--------------CertUtil: -SCInfo command FAILED: 0x80090016 (-2146893802 NTE_BAD_KEYSET)CertUtil: Keyset does not existDid you load your CA's root certificate onto the Yubikey? A chain of trust may be required. Try the following:
Also, the Yubikey Mini-Driver needs to be installed on every computer you wish to authenticate on. On a remote server, you need to install the driver with
INSTALL_LEGACY_NODEoption:Yes, installing the root certificate to the key works. It is reading it from the key that fails.
The Yubikey Driver is installed on the server in legacy mode and on the workstations on the domain.
When I install the certificate I get prompted for the key's PIN. I enter the PIN then I get this:
C:\Users\Administrator\Documents>certutil -scroots update "2022-01-24_ca_certificate.cer"Element 0:Serial Number: 1d2eb6e361a40c874753eead9bf9e195Issuer: CN=brain-BSI-SRV-TEST-CA, DC=brain, DC=testNotBefore: 6/30/2021 11:56 AMNotAfter: 6/30/2051 12:06 PMSubject: CN=brain-BSI-SRV-TEST-CA, DC=brain, DC=testCA Version: V0.0Signature matches Public KeyRoot Certificate: Subject matches IssuerCert Hash(sha1): 10 b2 20 86 2a b1 ed a1 b5 b8 a2 35 0d 3e 11 b2 8f 2f e5 3cDone.CertUtil: -SCRoots command completed successfully.When I go try to verify that the cert is in the key I get this:
C:\Users\Administrator\Documents>certutil -scinfoThe Microsoft Smart Card Resource Manager is running.Current reader/card status:Readers: 10: Yubico YubiKey OTP+FIDO+CCID 0--- Reader: Yubico YubiKey OTP+FIDO+CCID 0--- Status: SCARD_STATE_PRESENT | SCARD_STATE_UNPOWERED--- Status: The card is available for use.--- Card: YubiKey Smart Card--- ATR:3b fd 13 00 00 81 31 fe 15 80 73 c0 21 c0 57 59 ;.....1...s.!.WY 75 62 69 4b 65 79 40 ubiKey@=======================================================Analyzing card in reader: Yubico YubiKey OTP+FIDO+CCID 0Missing stored keysetMissing stored keyset--------------===========================--------------CertUtil: -SCInfo command FAILED: 0x80090016 (-2146893802 NTE_BAD_KEYSET)CertUtil: Keyset does not existHow are you provisioning the Yubikey? Have you created the SC enrollment template in your Certificate Authority?
Quick overview of how enrollment works, starting with a blank Yubikey:
certutil -scupdateas previously mentioned.That's basically it for self-enrollment. Enrolling on behalf of other users has a few extra steps.