Not a NetScaler issue, but I’m wondering if anyone...
# citrix-netscaler
k
Not a NetScaler issue, but I’m wondering if anyone else is worried of the changes in MS regarding cert authentication: https://community.citrix.com/forums/topic/253495-virtualsmartcard-authentication-using-the-certificate-san/ We’ve witnessed the issue with smartcards and in the same go we understood the issue also hits FAS virtual smartcard certs. To my understanding this will break the FAS-enabled SSO (all SAML/OIDC envs).
j
As @Jeff Riechers already answered on the community thread, you have to use at least FAS 2402 with SID-support
j
In my environment I enabled the higher security setting in the registry, and FAS worked fine. This was on 2411.
k
Oh, great info. Thx guys!
Just to be sure, have you changed the
UseSubjectAltName
on domain controllers (kdc) to 0 and it worked?
the article states "these authentication changes are already supported for users who use the default setting Build from this Active Directory information."
but it didn't work, so we changed this to "supply in the request"
Seems that if we do that, the FAS certificate includes the same information in the SAN field, but the actual subject in the certificate is just: CN=domain\samaccountname
doesn't work though
j
What are you mapping the user authentication field to? I use my FAS for my domain, and for gmail accounts with shadow accounts, and I enabled the StrongCertificateBindingEnforcement and that worked. But I am still using the SAN for placing the UPN to be authenticated with.
Sorry, went back and re-read your post. Why not just adjust the UPN in the AD to their email address? Is the username mapping different for the account?
we can't use subject alt name field for the user id
when we change the KDC reg key as described in the article
"The SID Extension detection and validation used by the Strong Certificate Binding Enforcement has a dependency on the KDC registry key UseSubjectAltName value. The SID extension will be used if the registry value does not exist or if the value is set to a value of 0x1. The SID extension will not be used if UseSubjectAltName exists, and the value is set to 0x0."
so, we need to add the StrongCertificateBindingEnforcement with value 1 to allow the SID mapping
j
Correct. If you want I can test out disabling the SAN and see if the SID works with that strong setting.
👍 1
k
"The SID extension will not be used if UseSubjectAltName exists, and the value is set to 0x0." ... the customer has set this value, so will the StrongCertificateBindingEnforcement override that one?
j
So you would need to do both I assume. Enable StrongBinding and disable SAN. Let me test it right now in my lab and let you know what it does. 1 moment.
k
They have physical smartcards for the client authentication and the user accounts have the altSecurityIdentities attribute set with the X509IssuerSerialNumber, which allows the users to log in. The smartcard contains a personal unique identifier sth like 123456789@fin.gov (in the certificate SAN field) and previously this matched the users UPN. Now the UPN is changed to their email address and the cert is mapped using altSecurityIdentities
as background for why we're doing this
j
So I think there is something with the MS login portion of this. I see the SID in my FAS cert, but when I tell it to not use SAN it fails. So it's like Windows itself isn't using the SID field, I am going to see if there is something on the VDA that also needs to be enabled to support the SID entry.
Oh, this might be part of it. The SID extension will not be used if UseSubjectAltName exists, and the value is set to 0x0. So if your certificate is populating the 1.3.6.1.4.1.311.25.2 field with the user SID you can't set that to 0. Do you see that entry on your client cert that matches their AD SID?
k
The reason why they're setting the UseSubjectAltName to 0 is that they need to enable the Windows Password Hint -feature... I'll try to write this in community. I even drew a flowchart of it
Messed up.
dropped a message in community
quite the rabbit hole
And thank you @Jeff Riechers, I really appreciate your help here and the time you put in testing stuff in your lab.
👍 1
To your question; yes, we can see 1.3.6.1.4.1.311.25.2 in the cert and it matches the SID in AD (objectSid attribute more specifically)
j
this is a good discussion. we're using usesubjectaltname 0 to disable UPN based smart card mapping and instead use certificate mapping, i did not realize that the new SID extension is not used if usesubjectaltname is set to 0, this is a common configuration used within gov agencies, and changing that value to 1 is going to be a nonstarter for many, @Kari Ruissalo (WyW) have to you asked Citrix or Microsoft about this by any chance? there had been talk within US Fed government circles that there was big pushback on this strong mapping enforcement and that MS was supposedly working on an alternative but I've not heard anything recently
k
I have. There’s ongoing discussions and I’ve heard a rumor that the issue has been fixed somewhere already. This is pretty much a MS problem if I understand it correctly, so it’s really interesting to see if the planned enforcement schedule sticks…
The MS KB doc history has been updated many times already
j
@Kari Ruissalo (WyW) did you happen to see this? https://techcommunity.microsoft.com/blog/publicsectorblog/enable-strong-name-based-mapping-in-government-scenarios/4240402 I'm not sure if it would be viable for an internal CA and FAS.
k
Don't think I have. I try to find some time to go through this. Thanks!
I shared the link in Community too as it might help others as well. Thank you @Josh Bilsky
❤️ 1
j
Ok, I found a way to make it work, but it won't be usable. I had to manually populate the altsecurityidentities entry for my FAS user with X509:<I>DC=LAB,DC=HOME,CN=HOME-DC<SR>3B000000000030784691496852D63B00000017
The reason it won't be usable, is that that serial number is 1. unique for each person. 2. unique for each cert renewal. 3. requires you to reverse order the 2 character hex codes from the serial number.
And to prove it does/doesn't work. I modified the last 2 characters and it is broken, switched it back and it worked.
k
@Jeff Riechers, we got it working with the instructions @Josh Bilsky shared above
👍 1
j
Neat. What tuple did you end up using?
k
Similar to tuple example 1
this almost got sticky, but @Josh Bilsky saved the day!
👍 1
j
@Kari Ruissalo (WyW) Thanks for following up and sharing with the community! It's good to know this could at least be a workaround for us although I still feel like MS should allow the SID extension to be used with UseSubjectAltName set to 0. I did share the outcome of your testing with the PKI working group at our agency for their awareness. When I saw your post initially I glossed over it due to thinking the SID extension would be the fix. I'm glad I read it closer, lol.
👍 1
k
We Googled the topic quite a bit and the article you shared never popped up. Wouldn't hurt if MS would link that in the KB article... Good thing you did!
j
@Kari Ruissalo (WyW) what did you use for the OID?
k
I need to check the final config, I'll try to check and get back
👍 1
j
I do have some concerns about enabling the tuple policy for certs issued by the internal CA. I feel like Microsoft's decision to force strong name mappings is to make it more difficult for an attacker to generate a cert from the internal CA that matches a weak mapping that could be used to authenticate. If you look at the language in the article, they are saying the subject name and/or subjectaltname should not contain names queried and/or built from an AD account. Isn't this effectively what FAS is doing?
k
I believe FAS writes (by default) the user account CN in to the Subject and in the SAN the entry is "PrincipalName: {UPN}". The strong mapping adds the requirement to fill in the altsecidenties attribute for the user objects in AD and this field by default contains the user's certificate information in the format that is described in KB5014754. The options presented in this article are tricky in "FAS point-of-view" as the certs are valid (by default) for 7 days. This would mean that every time the short-lived user certificate is renewed, the attribute should be rewritten to match the current certificate. We already started thinking of generating a script that would populate the user certs weekly for FAS and then update the attributes in AD, but fortunately the article you linked helps us to avoid this. I have pretty much always requested an additional SubCA for FAS use anyways, but to be on the secure-side with the tuple check, having a separate CA for just FAS use makes sense (you're referring to that CA's certificate thumbprint in the tuple).
Whenever I start feeling like I understand PKI a bit, I run in to something like this and am more certain that I don't understand much 😄
💯 1
@Josh Bilsky, the OID used is according to the example 1 (OID 2.16.840.1.101.3.2.1.3.45)
👍 1
j
@Kari Ruissalo (WyW) Now it's interesting that 2.16.840.1.101.3.2.1.3.45 id-fpki-common-pivi-authentication worked in your scenario because that OID would be stamped on the smart card certificate. I would have expected that for FAS to work with strong mapping enforced, you would have needed to use an OID that was included in the FAS certificate. I would not think 2.16.840.1.101.3.2.1.3.45 id-fpki-common-pivi-authentication would be included in the FAS certificate.
k
The OID in FAS cert is 1.3.6.1.4.1.311.25.2
... and FAS relies on the SID parameter within that OID (https://docs.citrix.com/en-us/federated-authentication-service/2402-ltsr/whats-new.html)
j
Right, the FAS cert would have 1.3.6.1.4.1.311.25.2 which is what I was expecting the policy tuple would need to allow the login to succeed with UseSubjectAltName set to 0. I thought that because UseSubjectAltName is 0 which forces certificate mapping over UPN mapping, the SID is ignored and that's why we need the tuple configuration, but I was surprised to learn that you used an OID that is in the actual smart card certificate and not the FAS certificate. I was expecting that 1.3.6.1.4.1.311.25.2 or another OID present on the FAS certificate would be needed in the policy tuple for this to work.
k
The UPN suffixes are not supported for the mapping if UseSubjectAltName is set to 0x0 according to that article. So, the examples 2. and 3. don’t work. I might be lost here, it’s pretty complex for me at least.
j
No I think you're on the right track with policy example 1 because you're using altsecurityidentities, the thing that confused me is that it works with the OID from the smart card. Is the strong mapping already enforced on the domain controllers or is it in compatibility mode?
j
In my testing I could not get anything to work for authentication when I enabled the usesubjectaltname to 0. Even with the tuple including the certsrv and oid. Is there something that needed to also be added to the altsecurityidentities attribute for users as well?
k
@Josh Bilsky, I don't know if they have enabled the strongauthentication -knob on the DCs actually, but most certainly they have the usesubjectaltname configured, which was their initial concern
@Jeff Riechers the article Josh linked also contains the GPO setting that needs to be applied
j
Yup, I enabled those GPO, but just could not get it to work, and was wondering if I still have to populate that altsecurityid like I had done before to get it to validate off of the SID. All I get is unknown username or password.
j
@Jeff Riechers you would need to have the altsecurityid populated with the name mapping along with the policy tuple to make the "weak" mapping considered "strong", once you set UseSubjectAltName to 0, it disables UPN based mapping and requires certificate mapping (aka altsecurityid)
k
the altsecid needs to be populated
j
Ok, so what type of entry would I put there? Can I just use the UPN for the user? Do I put the OID?
j
@Kari Ruissalo (WyW) Yeah we're still in compatibility mode here so I have not tested any of this. I'm just trying to plan for the future when this gets enforced in September. We don't have a test environment to try this on 🙃
👍 1
@Jeff Riechers it needs to be in x509 format, subject + issuer is what you'd use for FAS (see below). Since it's considered weak, you would also need the policy tuple based on example 1 that @Kari Ruissalo (WyW) used to allow it to work when strong mapping is enforced on the DCs
in case you want the gory details https://www.idmanagement.gov/implement/scl-windows/
👍 1
example string based on an internal CA: X509:<I>DC=com,DC=contoso,CN=CertAuthority1<S>DC=com,DC=contoso,OU=Users,CN=John Doe
k
@Josh Bilsky, fortunately one of our gov customer is creating a completely new environment and it's still in a sort of a playground mode... they're starting rollouts next week I guess and they wanted to use the strong mapping from the beginning. All in all, perfect timing... Aaaand... what's it worth, we've been discussing & planning this for two years already. Now that the actual production nears, we just needed to get this over with. Fortunately enough, it seems we got a working setup now.
I can just imagine that there are plenty of customers with FAS below the version 2311 (which introduces the OID/SID support) and completely unaware of the enforcement setting in next month. I already marked my calendar on the 11th of Feb as based on the KB change log, that'll be the doomsday.
💯 1
j
Ok, I think I have this all correct, but still no luck. Throwing all my info here to see if one of you sees what I can't see.
Here is info from my Citrix Smartcard
Error when logging in: The Key Distribution Center (KDC) encountered a user certificate that was valid but could not be mapped to a user in a secure way (such as via explicit mapping, key trust mapping, or a SID). Such certificates should either be replaced or mapped directly to the user via explicit mapping. See https://go.microsoft.com/fwlink/?linkid=2189925 to learn more. User: jeffriechers Certificate Subject: @@@CN=Jeff Riechers-gmail, OU=Gmail Users, DC=HOME, DC=LAB Certificate Issuer: HOME-DC Certificate Serial Number: 170000005F662CA7B794B09E0200000000005F Certificate Thumbprint: 9F384366D4D19EC73E7E55245583C6F96833BA20 Certificate Issuance Policies: Name-Based Strong Mappings for Certificates 5f7df4fbb9fd634f895e5a8459a432deb1843409;1.3.6.1.4.1.311.25.2;IssuerSubject altSecurityIdentities (Tried with and without spaces) X509:<I>DC=LAB,DC=HOME,CN=HOME-DC<S>DC=LAB,DC=HOME,OU=Gmail Users,CN=Jeff Riechers-gmail
The thumbprint on my strong mappings is the thumbrint from my CA certificate.
@Kari Ruissalo (WyW) as long as you don't set the UseSubjectAltName to 0 you are fine. I enabled all the GPO hardening and it worked, it just that reg change that requires all this hoopla.
k
Yeah. Not completely clear for me though what will happen for a customer if they’re running an older version of FAS like 2203. Based on the release notes that one doesn’t support the SID mapping.
Or at least the first mention of that feature is in FAS 2311 rel notes 🤷‍♂️
j
@Kari Ruissalo (WyW) my thought was actually nothing would happen because the SID extension is not supported for certificate mapping, i'm trying to see if I can get more info through our MS channels, basically is the policy tuple the prescribed path forward for this scenario
@Jeff Riechers to enable certificate mapping we have the UseSubjectAltName 0 deployed to all DCs, we also have UseSubjectAltName 0 (different path) and SendPreauthForNewerETypes deployed on the clients
the SendPreauthForNewerETypes was needed on the client to eliminate the username hint requirement if a certificate is only mapped to a single AD account, FWIW this was an undocumented key from the Win 7 days and I'm not sure it's still needed but we've kept it around
😮 1
j
Ok, still was no good. I still had the registry entry for StrongCertificateBindingEnforcement set to 2. When I switched it to 1, then it was fine.
j
how do you have the policy tuple configured on the dcs
j
Check up a few messages, I copy and pasted everything I have.
k
@Josh Bilsky you don’t need pw hint? 😮
j
@Kari Ruissalo (WyW) We only need to enter a hint if a single cert is mapped to multiple accounts, if there is only one account mapped to a cert, the SendPreauthForNewerETypes reg key on the clients eliminates the need for hints for one-to-one mappings
k
Great info!
👍 1
j
@Jeff Riechers your configuration looks good to me, I would have thought that tuple and OID would work based on the documentation
I assume you don't have any of these errors in your logs?
j
Copy code
As soon as I set StrongCertificateBindingenforcement to 2, it fails with this message.
A Kerberos error message was received: on logon session @@@CN=Jeff Riechers-gmail, OU=Gmail Users, DC=HOME, DC=LAB Client Time: Server Time: 175641.0000 1/17/2025 Z Error Code: 0x4b Unknown Error Extended Error: Client Realm: Client Name: Server Realm: HOME.LAB Server Name: krbtgt/HOME.LAB Target Name: krbtgt/HOME.LAB@HOME.LAB Error Text: File: onecore\ds\security\protocols\kerberos\client2\logonapi.cxx Line: 10a7 Error Data is in record data.
Even though the Subject and Issuer are set on the AltSecurityID setting on the user account, and the name mapping on the account matches those settings.
Ok, I think it is something with the Allow name-based strong mapping for certificates. If I change the thumbprint, I can still login when I have it set to 1 with strong. If I change the alt security ID with the setting on 1, I can't login.
j
you change the thumbprint in the policy tuple to something else and it works?
j
It continues to work when set to 1, but I change anything else and it is broken. So that seems to be the common denominator for why it doesn't work when set to 2.
j
your DCs are 2019+?
j
Yes. 2025.
And while that strong setting is 2, and usesubjectaltname to 1 it works. So weird.
j
my guess is that the strong setting 2 and usesubjectaltname 1 means it's successfully mapping the user against the UPN of the AD account and using the SID extension, this configuration I believe is fully supported in the newer versions of FAS
j
Yeah, I think that is going to be what I put in the designs going forward. Still really confused as to what in the name-based and altsecurityid isnt working. weird
j
well the problem is, certificate based mapping is the modern way of doing smart card auth, and in the gov space most new implementations will have usesubjectaltname=0 also in the gov space where the smart card certs are issued by 3rd party CAs, the UPN will not match the user's email address which is often required for M365 implementations, this is another advantage of using altsecid mapping over UPN mapping, like in our case our UPN is the email address but that doesn't match the UPN of the card cert so we provision the card cert in x509 format in the altsecids
@Jeff Riechers do you have the September preview release applied to your DCs? It looks like that update was the one that added the tuple policy support.
j
Yes, all patches are up to date, unless they have specific ones not in standard windows update
j
i'm wondering if this has not been implemented on 2025 and if you'll have to wait until the feb 11 patch cycle
I'm asking my team to see if they can confirm, but I think the reason why it might not be working for you is that you do not have a patch that would enable the tuple functionality, that would make sense why flipping it back to compatibility mode with usesubjectaltname=0 makes it work again, or switching usesubjectaltname=1 with enforcement mode does work, because the latter scenario is already supported as part of the changes implemented by KB5014754
👀 1
One other thought to close out the day, the way the MS article is written, a policy OID needs to be added to the FAS cert template for the functionality to work. From the MS language, I'm not sure using an application OID like 1.3.6.1.4.1.311.25.2 is acceptable.
j
So how is this for weird. I changed my altsecurity to <I>Issuer<SR>SerialNumber and it worked. EVEN THOUGH the gpo for DC was set to Thumbprint,OID,IssuerSubject So it seems even though that setting is on the DC it fails.
So, dropped something up on the forums for MS. I am thinking this is a bug with Server 2025 DCs. The GPO for name mapping is just not being honored. If I use any of the built-in strong methods, they work fine. Trying to define a weaker mode as strong via the gpo just does nothing. It's like the DC isn't even acknowledging that setting exists. https://answers.microsoft.com/en-us/windowserver/forum/server_dirservices-servertop_pki[…]ring-allow-name-based/c82bd9af-f9ba-4d6e-8ea7-4ceb3acdc405
j
My guess is the GPO won't be honored until you apply the Feb 2025 patch to the DCs.
🤕 1
k
Hmpfh... @Josh Bilsky, do you happen to have thin clients by any chance in your environments where you struggled with the strong mapping?
Our next problem is (now that all stuff Windows is resolved), is that if a smartcard is used on a thin client, I would need to read the altsubjectname from there and map the user on Gateway (so for instance the smartcard altsubjectname would be 12345678@country.gov, I would add this to the users AD attribute). I could use nFactor to accomplish this (1st certauth, 2nd ldap extract) and then enter the users userPrincipalName to storefront instead of the info on the smartcard
j
we do not have thin clients, but the flow you describe is similar to what we do, we map the UPN from the card certs to the employeeNumber attribute in the AD user accounts, the NS reads the UPN from the cert, matches to the AD account employeeNumber attribute via LDAP, and returns the samAccountName that gets passed to StoreFront
Here's the full deployment guide that is referenced in the first article.
k
Oldies goldies, most of the stuff is much updated (advanced policies on NetScaler), but for the most part pretty much stuff we already did. Thanks though!
j
yeah i saw your post on the Citrix forum about Linux, it's hard to say how things would work going direct through StoreFront with strong mapping enforced, there could be issues there
k
yeah, I told the customer to give it a go though
I'm planning to drop a blog about this, as there are so many things related to the change
can't help everybody personally, but if I could collect all the information here in one place and in readable format, it might help many
👍 2
I think StoreFront more or less just relies on the OS’ authentication stack, so on the other hand, why shouldn’t it work? The certificate auth is just passed to a Domain Controller which then decides if the cert is accepted?
Could just be that I start to think this way too difficult
j
Yeah, I was curious about how StoreFront works with regard to kb5014754 Would the SF servers require the CertificateMappingMethods key to be set?
k
Worth checking!
Would be optimal to run auth directly to SF which would use FAS for session SSO and the use HDX optimal routing to avoid direct connections from client to VDA
Tried to collect all the bits and pieces in one place -> https://blog.comping.fi/?p=303 .. if you find the time @Josh Bilsky and @Jeff Riechers to browse it through and correct my mistakes, much appreciated
j
Just wanted to share the latest from Microsoft regarding this issue. I had asked them whether the policy tuple approach was the recommended path forward on this issue and this is what they responded with "Thank you for your patience as I investigated the scenario you shared with me. I would like to share my findings regarding the issues with Kerberos authentication. We have received reports indicating that Kerberos authentication using certificate mapping fails with KDC_ERR_CERTIFICATE_MISMATCH in environments where the following conditions are met: - Domain controllers are configured for Full Enforcement Mode. - The Use Subject Alternate name setting is disabled by setting UseSubjectAltName to 0. - The authenticating user has at least one mapped altSec that is using a weak altSecurityIdentity mapping. This issue may particularly affect government customers utilizing third-party SSO/FAS solutions, including Citrix Federated Authentication Service, in environments where the principal name in the subject alternate name of the certificate does not match the AD UPN. This behavior is expected within Windows. However, Microsoft and Citrix are collaborating to determine if a change can be made to better meet customer needs for FAS authentication. The correct owner of this change (Microsoft or Citrix) has not yet been determined. Consequently, we do not have an estimated time of arrival for when or if a decision will be made regarding this change, or which product (Microsoft Windows or Citrix FAS) will be affected. Thank you for your understanding. I recognize that this is not the ideal scenario at the moment, but we are actively working with Citrix to find a solution and release it as soon as possible."
k
Thanks for sharing @Josh Bilsky, I have ran in to similar stuff in our case. With the UseSubjectAltName = 0x0
j
Glad it wasn't just me.