⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kerberos-notes.txt

📁 samba最新软件
💻 TXT
📖 第 1 页 / 共 2 页
字号:
AllowedWorkstationNames and Krb5--------------------------------Microsoft uses the clientAddresses *multiple value* field in the krb5protocol (particularly the AS_REQ) to communicate it's netbios name.This is (my guess) to permit the userWorkstations field to work.The KDC I imagine checks the netbios address against this value, inthe same way that the Samba server does this.The checking of this implies a little of the next question:Is a DAL the layer we need?---------------------------Looking at what we need to pass around, I start to seriously wonder ifthe DAL is even the right layer - we seem to want to create an accountauthorization abstraction layer - is this account permitted to login tothis computer, at this time?This information in AD is much richer than the Heimdal HDB, and itseems to make sense to do AD-specific access control checks in anAD-specific layer, not in the back-end agnostic server.Because the DAL only reads in the principalName as the key, it hastrouble performing access control decisions on things other than thename.I'll be very interested if the DAL really works for eDirectory too.Perhaps all we need to do is add in the same kludges as we have inSamba 3.0 for eDirectory.  Hmm...That said, the current layer provides us with a very good start, andany redefinition would occour from that basis.GSSAPI layer requirements-------------------------Welcome to the wonderful world of canonicalisationThe MIT GSSAPI libs do not support kinit returning a differentrealm to what the client asked for, even just in case differences.Heimdal has the same problem, and this applies to the krb5 layer, notjust gssapi.We need to test if the canonicalisation is controlled by the KDCOptionflags, windows always sends the Canonicalize flagsOld Clients (samba3 and HPUX clients) uses 'selfmade' gssapi/krb5for using it in the CIFS session setup. Because they use krb5_mk_req()they get a chksum field depending on the encryption type, but that's wrongfor GSSAPI (see rfc 1964 section 1.1.1). The Cheksum type 8003should be used in the Authenticator of the AP-REQ! That allows the channel bindings,the GCC_C_* req_flags and optional delegation tickets to be passed from the client to the server.Hower windows doesn't seems to care about if the checksum is of the wrong type,for CIFS SessionSetups, it seems that the req_flags are just set to 0.So this can't work for LDAP connections with sign or seal, or for any DCERPCconnection.So we need to also support old clients!Principal Names, long and short names-------------------------------------As far as servicePrincipalNames are concerned, these are notcanonicalised, except as regards the realm in the reply.  That is, theclient gets back the principal it asked for, with the realm portion'fixed' to uppercase, long form.  The short name of the realm seems to be accepted for at least AS_REQoperations, but because the server performs canonicalisation, thiscauses pain for current client libraries. The canonicalisation of names matters not only for the KDC, but alsofor code that has to deal with keytabs.We also need to handle type 10 names (NT-ENTERPRISE), which are a fullprincipal name in the principal field, unrelated to the realm.HOST/ Aliases-------------There is another post somewhere (ref lost for the moment) that detailswhere in active directory the list of stored aliases for HOST/ is.This should be read, parsed and used to allow any of these requests touse the HOST/ key.For example, this is how HTTP/, DNS/ and CIFS/ can use HOST/ withoutany explicit entry.Jean-Baptiste.Marchand@hsc.fr reminds me:> This is the SPNMappings attribute in Active Directory:> http://msdn.microsoft.com/library/en-us/adschema/adschema/a_spnmappings.aspWe implement this in hdb-ldb.Implicit names for Win2000 Accounts-----------------------------------Despite not having a DNS name, nor a servicePrincipalName on accountscreated by computers running win2000, it appears we are expected tohave an implicit mapping from host/computer.full.name andhost/computer to it's entry.Returned Salt for PreAuthentication-----------------------------------When the server replies for pre-authentication, it returns the Salt,which may be in the form of a principalName that is in no wayconnected with the current names.  (ie, even if the userPrincipalNameand samAccountName are renamed, the old salt is returned).This is probably the kerberos standard salt, kept in the 'Key'.  Thestandard generation rules are found in a Mail from Luke Howard dated10 Nov 2004:From: Luke Howard <lukeh@padl.com>Message-Id: <200411100231.iAA2VLUW006101@au.padl.com>MIME-Version: 1.0Content-Type: text/plain; charset=US-ASCIIOrganization: PADL Software Pty LtdTo: lukeh@padl.comDate: Wed, 10 Nov 2004 13:31:21 +1100Versions: dmail (bsd44) 2.6d/makemail 2.10Cc: huaraz@moeller.plus.com, samba-technical@lists.samba.orgSubject: Re: Samba-3.0.7-1.3E Active Directory IssuesX-BeenThere: samba-technical@lists.samba.orgX-Mailman-Version: 2.1.4Precedence: listReply-To: lukeh@padl.comDid some more testing, it appears the behaviour has anotherexplanation. It appears that the standard Kerberos password saltalgorithm is applied in Windows 2003, just that the source principalname is different.Here is what I've been able to deduce from creating a bunch ofdifferent accounts:Type of account		Principal for Salting========================================================================Computer Account                host/<SAM-Name-Without-$>.realm@REALMUser Account Without UPN        <SAM-Name>@REALMUser Account With UPN           <LHS-Of-UPN>@REALMNote that if the computer account's SAM account name does not includethe trailing '$', then the entire SAM account name is used as input tothe salting principal. Setting a UPN for a computer account has noeffect.It seems to me odd that the RHS of the UPN is not used in the saltingprincipal. For example, a user with UPN foo@mydomain.com in the realmMYREALM.COM would have a salt of MYREALM.COMfoo. Perhaps this is toallow a user's UPN suffix to be changed without changing the salt. Andperhaps using the UPN for salting signifies a move away SAM names andtheir associated constraints.For more information on how UPNs relate to the Kerberos protocol,see:http://www.ietf.org/proceedings/01dec/I-D/draft-ietf-krb-wg-kerberos-referrals-02.txt-- Luke--Heimdal oddities----------------Heimdal is built such that it should be able to serve multiple realmsat the same time.  This isn't relevant for Samba's use, but it showsup in a lot of generalisations throughout the code.Other odd things: - Support for multiple passwords on a client account:  we seem to   call hdb_next_enctype2key() in the pre-authentication routines to   allow multiple passwords per account in krb5.  (I think this was   intened to allow multiple salts)State Machine safety--------------------Samba is a giant state machine, and as such have very differentrequirements to those traditionally expressed for kerberos and GSSAPIlibraries. Samba requires all of the libraries it uses to be state machine safe intheir use of internal data.  This does not mean thread safe, and anapplication could be thread safe, but not state machine safe (if itinstead used thread-local variables).So, what does it mean for a library to be state machine safe?  This ismostly a question of context, and how the library manages whateverinternal state machines it has.  If the library uses a contextvariable, passed in by the caller, which contains all the informationabout the current state of the library, then it is safe.  An exampleof this state is the sequence number and session keys for an ongoingencrypted session).The other issue affecting state machines is 'blocking' (waiting for aread on a network socket).  Heimdal has this 'state machine safety' in parts, and we have modifiedthe lorikeet branch to improve this behviour, when using a new,non-standard API.  Heimdal uses a per-context variable for the 'krb5_auth_context', whichcontrols the ongoing encrypted connection, but does use globalvariables for the ubiquitous krb5_context parameter.  The modification that has added most to 'state machine safety' ofGSSAPI is the addition of the gsskrb5_acquire_creds function.  Thisallows the caller to specify a keytab and ccache, for use by theGSSAPI code.  Therefore there is no need to use global variables tocommunicate this information. At a more theoritical level (simply counting static and globalvariables) Heimdal is not state machine safe for the GSSAPI layer.The Krb5 layer alone is much closer, as far as I can tell, blockingexcepted. .To deal with blocking, we could have a fork()ed child per context,using the 'GSSAPI export context' function to transferthe GSSAPI state back into the main code for the wrap()/unwrap() partof the operation.  This will still hit issues of static storage (one

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -