Click here to get back home

Intermittent Kerberos authentication failure

 HomeNewsGroups | Search | About
 microsoft.public.windows.server.security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Intermittent Kerberos authentication failure chen 06-14-2007
Posted by chen on June 14, 2007, 2:26 pm
Please log in for more thread options
We're running into intermittent authentication failure with Kerberos
with our web application that results in 401 Unauthorized errors.

Here is an overview of the environment:
. The webapp is running on server A. It is configured for
impersonation. The worker process is running under a service account
(which is a domain account) and is enabled for delegation. SPN is
setup appropriately & AuthenticationProvider is configured to use
kerberos (Negotiate).
. The web app turns around and calls a webservice running on Server B.
This is also configured similar to the first server (trusted for
delegation, correct SPN setup & AuthenticationProvider set to
Negotiate)

>From a client machine, accessing the webapp which in turn accesses the
webservice works well for the most part... the end-user kerberos
credentials are being passed to the web service as expected. But
occassionally (frequency ranges between rare to once a week to number
of clients exhibiting this symptom all at once) the client encounters
401 unauthorized errors.

So we wrote a simple app that mimics the web app behavior that calls
the web service & display the identity of the user, authentication
type, impersonation level etc. We do see the authentication type
mysteriously switch to NTLM for a brief while before switching back to
Kerberos again. That explains the failure of the webapp call to
webservice but we're not sure why the Kerberos authentication fails
sometimes. This is somewhat harder to explain why this fails at
seemingly random times. We've looked at Network Monitor captures,
Kerberos logs, played with KerbTray/Klist to purge the tickets and
mostly we see the expected behavior.

We're running out of ideas and are no longer sure what we should be
looking for... in logs, captures etc. Anyone else experiencing similar
issues? Ideas anyone?

Thanks.

chen


Posted by chen on June 15, 2007, 11:48 am
Please log in for more thread options
One thing we noticed in the NetMon captures, the TGS request usually
looks for the SPN using the FQDN as in: Realm: xyz.com SName: http/
ServerA.xyz.com.

Sometimes, we see the SName in TGS request as http/ServerA instead of
the FQDN. This returns the KRB_ERROR- KDC_ERR_S_PRINCIPAL_UNKNOWN
which probably leads to Kerberos failure to switch back to using NTLM
authentication.

Under what scenarios will a client be sending a TGS request which does
not use the FQDN?



Posted by Joe Kaplan on June 15, 2007, 12:11 pm
Please log in for more thread options
I've seen this issue reported before, but I can't remember the details. The
exact behavior you are seeing, ticket being requested initially with the
full DNS-based SPN but then switching over to the NetBIOS style and
potentially causing failure, is a known issue that I think may have
something to do with IE. I believe if you do some additional searches on
the newsgroups and MS KB, you'll find more info.

It may be possible to work around the issue by creating the other SPN as
well.

Another thing you might consider would be protocol transition logon and
constrained delegation. If you are using 2003 web servers throughout and
have a 2003 native AD, then it is possible to configure things so that the
front end can authenticate with any protocol you want (Kerb, NTLM, Digest,
basic, etc.) and then transition to Kerberos to do the delegated call when
needed. This feature requires you to use constrained delegation as well,
but that is generally a good idea anyway as unconstrained delegation is a
potentially serious security risk.

Good luck with this one!

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
> One thing we noticed in the NetMon captures, the TGS request usually
> looks for the SPN using the FQDN as in: Realm: xyz.com SName: http/
> ServerA.xyz.com.
>
> Sometimes, we see the SName in TGS request as http/ServerA instead of
> the FQDN. This returns the KRB_ERROR- KDC_ERR_S_PRINCIPAL_UNKNOWN
> which probably leads to Kerberos failure to switch back to using NTLM
> authentication.
>
> Under what scenarios will a client be sending a TGS request which does
> not use the FQDN?
>
>



Posted by chen on June 15, 2007, 5:08 pm
Please log in for more thread options
On Jun 15, 12:11 pm, "Joe Kaplan"
> I've seen this issue reported before, but I can't remember the details. The
> exact behavior you are seeing, ticket being requested initially with the
> full DNS-based SPN but then switching over to the NetBIOS style and
> potentially causing failure, is a known issue that I think may have
> something to do with IE. I believe if you do some additional searches on
> the newsgroups and MS KB, you'll find more info.
>
> It may be possible to work around the issue by creating the other SPN as
> well.
>
> Another thing you might consider would be protocol transition logon and
> constrained delegation. If you are using 2003 web servers throughout and
> have a 2003 native AD, then it is possible to configure things so that the
> front end can authenticate with any protocol you want (Kerb, NTLM, Digest,
> basic, etc.) and then transition to Kerberos to do the delegated call when
> needed. This feature requires you to use constrained delegation as well,
> but that is generally a good idea anyway as unconstrained delegation is a
> potentially serious security risk.
>
> Good luck with this one!
>
> Joe K.
>
> --
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services
Programming"http://www.directoryprogramming.net
>
>
>
>
> > One thing we noticed in the NetMon captures, the TGS request usually
> > looks for the SPN using the FQDN as in: Realm: xyz.com SName: http/
> > ServerA.xyz.com.
>
> > Sometimes, we see the SName in TGS request as http/ServerA instead of
> > the FQDN. This returns the KRB_ERROR- KDC_ERR_S_PRINCIPAL_UNKNOWN
> > which probably leads to Kerberos failure to switch back to using NTLM
> > authentication.
>
> > Under what scenarios will a client be sending a TGS request which does
> > not use the FQDN?- Hide quoted text -
>
> - Show quoted text -

Thanks Joe. We'll explore the constrained delegation option more. And
yes, all the web servers & DCs are running Windows Server 2003.

Originally, we thought that this is somehow IE related (or browser
related as Firefox exhibits the same symptoms). But the netmon capture
shows that other service classes exhibiting similar behavior as well.
For e.g. we see TGS requests for 'cifs/<fileserver>' fail for almost
identical reasons as well. Again the fileserver is not the FQDN but
the NetBIOS name.

This leads me to believe that it is not the client processes that are
issuing these requests - more a system component (LSASS perhaps?) that
affects all processes running under the context of the logged on user.
So once again, under what scenarios does the TGS request flip from
using FQDN to NetBIOS style server names?

chen

PS: We've added the SPN for the NetBIOS style names as well & so far
based one days worth of testing everything looks good but we aren't
sure if we fixed or even understood the underlying problem.


Posted by Joe Kaplan on June 15, 2007, 6:52 pm
Please log in for more thread options
I wish I knew the underlying problem. The way I remember the question going
when I heard it, I thought it was a browser issue as well but that doesn't
not sound like it is the case. I think your suspicion that this is going on
down in the guts of Kerb/lsass is correct.

I'm glad to hear that adding the NetBIOS style SPN seems to have fixed it.
My guess is that you are fine with that, but given my incomplete
understanding of the problem, I certainly can't guarantee you that. I'm not
sure who could. I'm also not sure if this only happens in cases where the
DNS name maps directly to an account with a known NetBIOS identity. I'm
guessing that if you created some sort of "DNS-only" identity with an A
record pointing to specific arbitrary name that you created, this probably
wouldn't happen. I'm not sure though.

It does bring up the point that if you create a specific SPN for a service
based on a DNS, it would seem to be necessary to create the matching NetBIOS
style SPN and put it on the same account. Also, as with other SPN rules,
you must be careful to never accidentally create a duplicate in AD for fear
of getting a different class of errors (ERR_AP_MODIFIED).

Best of luck again,

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
>
> Thanks Joe. We'll explore the constrained delegation option more. And
> yes, all the web servers & DCs are running Windows Server 2003.
>
> Originally, we thought that this is somehow IE related (or browser
> related as Firefox exhibits the same symptoms). But the netmon capture
> shows that other service classes exhibiting similar behavior as well.
> For e.g. we see TGS requests for 'cifs/<fileserver>' fail for almost
> identical reasons as well. Again the fileserver is not the FQDN but
> the NetBIOS name.
>
> This leads me to believe that it is not the client processes that are
> issuing these requests - more a system component (LSASS perhaps?) that
> affects all processes running under the context of the logged on user.
> So once again, under what scenarios does the TGS request flip from
> using FQDN to NetBIOS style server names?
>
> chen
>
> PS: We've added the SPN for the NetBIOS style names as well & so far
> based one days worth of testing everything looks good but we aren't
> sure if we fixed or even understood the underlying problem.
>



Similar ThreadsPosted
Kerberos machine authentication - apparent authentication failures May 30, 2005, 10:35 am
How to set up Kerberos authentication? (some code :) August 18, 2005, 2:55 pm
Problems With Kerberos Authentication September 25, 2007, 2:33 am
Kerberos and Integrated Windows authentication July 24, 2005, 8:26 am
Kerberos V5 Authentication for a Telnet Session October 27, 2005, 3:21 am
Kerberos authentication failed across forest March 23, 2006, 8:58 am
Kerberos authentication failed across forest March 23, 2006, 9:08 am
Intermittent traffic issue March 19, 2006, 10:44 am
Services Security Failure Audit October 29, 2005, 2:09 pm
MSDTC Security Log Failure Audits October 29, 2005, 6:41 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap