Enforcing password policies with LDAP and 'passwd: compat' set



My organisation currently uses NIS for its Solaris name/directory services,
but we are looking at moving to using LDAP instead.

I'm currently testing Sun's LDAP server - Java Directory Server Enterprise
Edition 6.3.1' - with LDAP server and clients running Solaris 10 5/08.

One of the new functions we'd like to acquire with a move to LDAP for
name services is improved account/password management. Sun's Directory
Server implements a number of password policies - password expiration,
account deactivation, password lockout - which we never had with NIS,
and which our auditors would like to see. :-)

With /etc/nsswitch.conf set on a client to what I'll call 'pure' LDAP:

passwd: files ldap

... everything works swimmingly. The LDAP server's log shows that
login attempts are facilitated by attempted BINDs to the user's distinguished
name as that user. Accounts that are expired, deactivated or locked
each return an explicit error code and message, and ssh/telnet tell the
user that his account is 'expired'. A user can't login in any of these three
cases. Exactly what we want. Exactly what I gather everyone else
sees when they're using 'pure' LDAP and account management.

However, we want to preserve the old-style NIS compatibility for our
/etc/passwd file; we want to be able to use the old +/- syntax for
netgroup inclusion. So our test LDAP client has its /etc/nsswitch.conf
configured like this:

passwd: compat
passwd_compat: ldap

When we do this, however, we lose 'two-thirds' of our password policy
enforcement; well, two of our three tests fail:

- a login (via ssh or telnet) to an expired account will succeed (with no
warning messages about the expiration);

- a login to a deactivated account will succeed; but

- a login to a locked account will still fail (as desired).

The LDAP server still shows attempted BINDs to the accounts in all three
cases, and they still return the same errors ... but ssh/telnet now 'ignores'
the errors two of the three times!

It seems to be PAM's fault. We have these entries for account management
in /etc/pam.conf:

other account requisite pam_roles.so.1
other account binding pam_unix_account.so.1 server_policy debug
other account required pam_ldap.so.1 debug

... looking at the debug output it seems that pam_unix 'approves' a login
and so pam_ldap is never called. It seems to me that the 'passwd: compat'
setting in /etc/nsswitch.conf is so 'transparent' pam_unix itself seems to be
hoodwinked by it, and doesn't know to pass on accounts that are actually
stored in the LDAP database and not the local /etc/passwd file. That's just
my impression.

So, my question is ... has anyone got LDAP account management working
properly with clients which are configured for 'passwd: compat' operation?

This is driving me crazy ... I'm starting to think it's a big bug that
I won't be
able to get around. But LDAP has been in use for a decade (I'm seeing
early problems regarding PAM and such going back to 2004!) so it's hard to
accept that there's nothing to be done.

Assuming that it does end up being a bug ... can anyone suggest a
workaround, say on the LDAP server, which might help? I'm using a
serviceSearchDescriptor in some clients' LDAP profiles, for example,
to divert them to 'test project' containers for the 'projects' database. I
suppose I could set up a serviceSearchDescriptor to do the same thing
for the 'ou=people' container ... is there a way I could do this based on the
inquiring client host (I'm thinking of starting from something like automount's
ability to substitute the key of a map for the '&' character)?

Can anyone help?

Thanks,


Brad
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • Re: nss_ldap and OpenLDAP client version
    ... you will have no end of problems if you ldap server goes down. ... because of the issues I was having, I figured I needed to configure the 'binddn' and 'bindpw' settings to get a proxy user account to bind to LDAP. ... From what I've gleaned you can do away with these settings, if the directory is setup to allow anonymous binds and reading of the required information via an anonymous bind, or otherwise you need to setup an account with very limited read-only privileges on the required entries. ...
    (freebsd-questions)
  • [NT] Security considerations to keep in mind when using Site Server 3.0
    ... Site Server version 3.0 Commerce Edition ... LDAP_Anonymous user account, which is used by the included LDAP service. ... A valid NT user account is required to upload ...
    (Securiteam)
  • Re: Less Informaion Availiable in LDAP on SBS than Server 2003
    ... Just tried and apparently if a user account is a member of "Domain Power ... Users" then I can query these LDAP attributes. ... While you might upgrade the schema on SBS to v31 note that a SBS R2 ...
    (microsoft.public.windows.server.sbs)
  • Re: Less Informaion Availiable in LDAP on SBS than Server 2003
    ... Compatible Access" we were able to query all attributes just fine on SBS. ... You can also modify your setup to allow anonymous LDAP access... ... Just tried and apparently if a user account is a member of "Domain Power ... causing us not to be able to query the UNIX attributes from ...
    (microsoft.public.windows.server.sbs)
  • Re: Less Informaion Availiable in LDAP on SBS than Server 2003
    ... Compatible Access" we were able to query all attributes just fine on SBS. ... You can also modify your setup to allow anonymous LDAP access... ... we wanted to use a very limited account, like you can use under 2003R2. ... I get the same results using ldapsearch from a UNIX command line ...
    (microsoft.public.windows.server.sbs)