Security Identifier (SID) to User Identifier (uid) ResolutionSystem
Luke Kenneth Casson Leighton
lkcl at samba.org
Tue Dec 28 21:11:55 GMT 1999
On Tue, 28 Dec 1999, Nicolas Williams wrote:
> On Wed, Dec 29, 1999 at 07:13:52AM +1100, Luke Kenneth Casson Leighton wrote:
> > On Tue, 28 Dec 1999, Jeremy Allison wrote:
> > > Luke Kenneth Casson Leighton wrote:
> > > > 2) multiple samba servers as members of the same domain need
> > > > same-user-name-same-smbpasswd locally on each server, and they _still_
> > > > produce different SIDs for the same damn username, which i am sure is a
> > > > security risk, i just can't think it through clearly, it's that brain-dead
> > > > and complicated an issue.
> > >
> > > They create different SIDs because they are *DIFFERENT USERS*.
> > if they are different users, then they should be in private/smbpasswd, not
> > verified against the PDC.
> > my question is, therefore, what the heck are we thinking, and what was it
> > again that we were smoking when we discussed this fifteen months ago,
> > jeremy?
> While you know from the session setup the NT username's SID, as well as
> the equivalent Unix username and UID and thus you can map that uid to
> the NT username's SID, you can't do this for any other uids (or gids)
> that you run into.
not unless you know what the SID is, in some fashion.
> Having a Unix username->NT username map as well as a
> Unix groupname->NT groupname map would help. That's what you're
... in a more well-defined and more secure fashion than is currently
implemented in samba 2.0.x and SAMBA_TNG, yes.
the "username" / "groupname" mapping would be part of the "automatic SURS
table population", used to generate new SURS table entries.
the resolution of unix usernames to nt usernames is prone to security
risks, such as deleting an NT user on a remote PDC and recreating an NT
user with the same name but different password, circumventing the security
associated with NT's SAM implementation. SIDs on NT, once deleted, cannot
> Incidentally, PAM_NTDOM needs such Unix->NT username map, so
> if you use Samba and PAM_NTDOM you've got a Unix->NT map and an NT->Unix
> map; but Samba won't use the Unix->NT map as of right now.
i know, i know. as the maintainer of pam_ntdom, i intend to use the same
scheme, once devised.
> > if this were to be implemented, how would we create ACLs to distinguish a
> > local user login (SID of local user = S-1-5-localsmbpasswd) from a remote
> > user login (SID of remote user = S-1-5-passwordserver=someserver with
> > security=domain set), when the algorithmic function we are using can only
> > deal with one SID?
> Hey, remember, you can't store SIDs in any *nix filesystem as of yet. So
> how could you store a SID on a *nix file ACL then? You have to map the
http://cb1.com/~lkcl/cifs/draft-lkcl-sidtouidmap-00.html, section 3.3.3,
"SURS mapping for File Permissions".
> (Yes, there are some read-only NTFS drivers for FreeBSD).
and if you use those, you don't need to do *nix file ACL mappings, you
just blat the Security Descriprot straight through the NTFS driver onto
> > > If this is a security hole then NT security is *completely*
> > > broken (hint. It's not :-).
> > NT doesn't authenticate users against the remote PDC's SAM and then
> > generate ACLs for those users from its local SAM database, which is what
> > is implemented _right now_ in 2.0.X with "security = domain".
> > this is what i am objecting to, more than anything else, and it's all due
> > to the use of the pdb_group_rid_to_gid() etc functions.
> Yes. I object to it as well, but only because there's a semantic
> inconsistency and it's visible to users. But it does work as it stands.
it's a mess, it has severe limitations. i hate it.
> Which is why I think you should make the uid/gid<->SID mapping
you can't configure a broken algorithm except by breaking something else.
More information about the samba-technical