Modifications in Windows 2k8 R2 that prevent krb5 referal in RODC setup?

Joshua Hawkinson jhawkinson at overlandstorage.com
Fri Sep 24 15:24:20 MDT 2010


Hello Love,

I've briefly reviewed the debug output of the net ads status command that I've attached to the first message then compared it with the code in libads/sasl.c, and it appears that in this test we are using the "normal" krb5_apis.  I have not yet traced back through the code completely to verify that, but at first glance (using the comments in the code) that seems to be the case.  It seems that with the detected mechanism that samba will only use the GSS style Princ if LDAP signing is enabled?!? That in mind all of our testing to this point has been with MIT krb5.  We have only reviewed Heimdal code thus far.  At any rate this gives us something to look at, so we'll give it a go. If nothing else perhaps the section of code you're referring to can give us some ideas *shrug

Perhaps you, or samba team wouldn't mind taking a look output here to verify?
[2010/09/16 16:02:41.724000, 10] libsmb/namequery.c:83(saf_store)
  saf_store: domain = [CLASSICAL], server = [APHRODITE.classical.snapqa], expire = [1284679061]
[2010/09/16 16:02:41.724000, 10] lib/gencache.c:180(gencache_set_data_blob)
  Adding cache entry with key = SAF/DOMAIN/CLASSICAL and timeout = Thu Sep 16 16:17:41 2010
   (900 seconds ahead)
[2010/09/16 16:02:41.724000, 10] libsmb/namequery.c:83(saf_store)
  saf_store: domain = [CLASSICAL.SNAPQA], server = [APHRODITE.classical.snapqa], expire = [1284679061]
[2010/09/16 16:02:41.724000, 10] lib/gencache.c:180(gencache_set_data_blob)
  Adding cache entry with key = SAF/DOMAIN/CLASSICAL.SNAPQA and timeout = Thu Sep 16 16:17:41 2010
   (900 seconds ahead)
[2010/09/16 16:02:41.724000,  4] libads/ldap.c:2852(ads_current_time)
  time offset is 0 seconds
[2010/09/16 16:02:41.728000,  4] libads/sasl.c:1113(ads_sasl_bind)
  Found SASL mechanism GSS-SPNEGO
[2010/09/16 16:02:41.732000,  3] libads/sasl.c:781(ads_sasl_spnego_bind)
  ads_sasl_spnego_bind: got OID=1.3.6.1.4.1.311.2.2.30
[2010/09/16 16:02:41.732000,  3] libads/sasl.c:781(ads_sasl_spnego_bind)
  ads_sasl_spnego_bind: got OID=1.2.840.48018.1.2.2
[2010/09/16 16:02:41.732000,  3] libads/sasl.c:781(ads_sasl_spnego_bind)
  ads_sasl_spnego_bind: got OID=1.2.840.113554.1.2.2
[2010/09/16 16:02:41.732000,  3] libads/sasl.c:781(ads_sasl_spnego_bind)
  ads_sasl_spnego_bind: got OID=1.2.840.113554.1.2.2.3
[2010/09/16 16:02:41.732000,  3] libads/sasl.c:781(ads_sasl_spnego_bind)
  ads_sasl_spnego_bind: got OID=1.3.6.1.4.1.311.2.2.10
[2010/09/16 16:02:41.732000,  3] libads/sasl.c:790(ads_sasl_spnego_bind)
  ads_sasl_spnego_bind: got server principal name = not_defined_in_RFC4178 at please_ignore
[2010/09/16 16:02:41.736000,  1] libsmb/clikrb5.c:710(ads_krb5_mk_req)
  ads_krb5_mk_req: smb_krb5_get_credentials failed for ldap/aphrodite.classical.snapqa at CLASSICAL.SNAPQA (Decrypt integrity check failed)
[2010/09/16 16:02:41.736000, 10] libads/sasl.c:811(ads_sasl_spnego_bind)
  ads_sasl_spnego_krb5_bind failed with: Decrypt integrity check failed, calling kinit
[2010/09/16 16:02:41.736000, 10] libads/kerberos.c:188(kerberos_kinit_password_ext)
  kerberos_kinit_password: as TIBERIUS$@CLASSICAL.SNAPQA using [MEMORY:net_ads] as ccache and config [/var/lock/samba/smb_krb5/krb5.conf.CLASSICAL]
[2010/09/16 16:02:41.740000,  0] libads/kerberos.c:338(ads_kinit_password)
  kerberos_kinit_password TIBERIUS$@CLASSICAL.SNAPQA failed: KRB5 error code 29
[2010/09/16 16:02:41.740000, 10] lib/gencache.c:345(gencache_get_data_blob)
  Returning valid cache entry: key = AD_SITENAME/DOMAIN/CLASSICAL.SNAPQA, value = Default-First-Site-Name, timeout = Mon Jan 18 19:14:07 2038
[2010/09/16 16:02:41.740000,  5] libads/dns.c:810(sitename_fetch)
  sitename_fetch: Returning sitename for CLASSICAL.SNAPQA: "Default-First-Site-Name"
[2010/09/16 16:02:41.740000, 10] libsmb/namequery.c:1400(internal_resolve_name)

Thank you very much
Joshua

From: Love Hörnquist Åstrand [mailto:lha at kth.se]
Sent: Friday, September 24, 2010 11:58 AM
To: Joshua Hawkinson
Cc: samba-technical at lists.samba.org; Andrew Bartlett
Subject: Re: Modifications in Windows 2k8 R2 that prevent krb5 referal in RODC setup?

Joshua,

It depends on your codepath, if you use the "normal" krb5_ apis, that true, if you use gss_ it will have different behavior ?

What api are you using ?

Love

24 sep 2010 kl. 10.48 skrev Joshua Hawkinson:


hmmm, I took a look at Heimdal 1.4 -- I think it's the latest -- and they had the name-type set to PRINCIPAL like samba4 Heimdal.  It is however certainly worth a test to verify.

Thank you both for your responses.  I'll be back after installing a new test client with Heimdal, and compiling samba.

--Joshua

From: Love Hörnquist Åstrand [mailto:lha at kth.se]
Sent: Thursday, September 23, 2010 11:03 PM
To: Joshua Hawkinson
Cc: samba-technical at lists.samba.org<mailto:samba-technical at lists.samba.org>
Subject: Re: Modifications in Windows 2k8 R2 that prevent krb5 referal in RODC setup?

Modern Heimdal sets name-type to KRB5_NT_SRV_HST when going though gss-api with serviced based names.



That doesn't work ?



Love

Skickat från min iPhone

23 sep 2010 kl. 15:06 skrev Joshua Hawkinson <jhawkinson at overlandstorage.com<mailto:jhawkinson at overlandstorage.com>>:
Ugh!  So we've reviewed both Heimdal and MIT krb5 and it seems that the problem persists everywhere. After reading the krb5 RFC it seems that Microsoft should not be so touchy about the NAME-TYPE, but the linux Kerberos implementations should also set the correct NAME-TYPE.  We're thinking that perhaps we should modify the krb libs on the system to inspect the principal as it is building it and if it is krbtgt at REALM we'll just set the NAME-TYPE to NT-SRV-INST.  This approach seems to be consistent with a) what works in this situation, b) the krb5 rfc.  I realize this is super hacky but I'd like to know your thoughts on the matter.

Have you guys integrated Heimdal into samba 4 so you can customize it to work with windows servers in cases like this?

--Josh

-----Original Message-----
From: Joshua Hawkinson
Sent: Tuesday, September 21, 2010 12:46 PM
To: Joshua Hawkinson; samba-technical at lists.samba.org<mailto:samba-technical at lists.samba.org>
Subject: RE: Modifications in Windows 2k8 R2 that prevent krb5 referal in RODC setup?

Hello everyone,

Well here is a quick update -- By setting the Microsoft recommended setting ((2) service and instance, or KRB5_NT_SRV_INST (as defined in the krb5 code)) into the Kerberos libs on system seems to have worked.  Unfortunately it seems that the current krb5 code both Heimdal and MIT have this value statically assigned to name-type (1) and (0) respectively (or principal and unknown).  Microsoft seems to be a bit slicker about setting the name-type in different situations.  At any rate other than specifying a "password server" parameter in the smb.conf to the writable DC there does not seem to be a good work around.  We're testing the static (2) setting to see what -- if anything -- it breaks in our environment...

Samba folks,
As this seems to be a more generic krb5 issue; should I enter a defect into bugzilla?

--Josh

-----Original Message-----
From: samba-technical-bounces at lists.samba.org<mailto:samba-technical-bounces at lists.samba.org> [mailto:samba-technical-bounces at lists.samba.org] On Behalf Of Joshua Hawkinson
Sent: Thursday, September 16, 2010 5:12 PM
To: samba-technical at lists.samba.org<mailto:samba-technical at lists.samba.org>
Subject: Modifications in Windows 2k8 R2 that prevent krb5 referal in RODC setup?

Hi guys,

I seem to have uncovered a defect in the latest stable version of samba (3.5.5) where I'm unable to authenticate through Kerberos to a 2008 R2 read only domain controller (RODC).  I've been digging in on this issue for about a couple of days and I've found that the problem only seems to occur during TGS-REQ to the RODC.  The RODC seems to reject this request (with error 31 decrypt integrity check failed) without forwarding it on to the writeable DC. If I replace the 2008 R2 RODC with a standard 2008 RODC the problem does not occur.  Also if I set the samba server to directly authenticate to the writeable DC no problems occur (obviously).  I've received word from an engineer at Microsoft that the problem is due to.... Well I'll paste in his message



More information about the samba-technical mailing list