Open Source Unified User Management System
Open Source Unified User Management System
{tedcheng,hyc,mhardin}@[Link]
Introduction
Enterprises can deploy services in a modular and scalable manner based on corporate
geographical regions and organizational units. One or more servers can be deployed for
each geographical region to minimize cross-region access latency. Clients can further
be configured to access services for their respective organizational units from the
regional servers. The cache configuration on the client systems stores information
locally, eliminating redundant accesses to the regional but remote servers. This is
particularly critical for heavily loaded systems in which repeated service requests for the
same information can be handled via local cache.
This paper reviews the evolution of related technologies and provides an overview of
the architecture. The presentation then focuses on two distinct enhancements, i.e.,
LDAP client-side caching and disconnected operations, using the OpenLDAP Name-
Service Overlay (nssov) and the Proxy Cache [6] engine. The nssov overlay improves
the robustness of the design by addressing many issues in the PADL approach, while
the Proxy Cache engine offers persistent caching capability and takes advantage of the
connection pooling of the ldap backend.
Evolution of Related Technologies
Traditionally Unix-like systems require various name services to function properly. The
system local storage using flat files is constrained in terms of performance and
scalability. Furthermore, flat files cannot be readily shared by multiple systems, even
when those systems share the same configuration. Additional name service modules,
such as Network Information Services (NIS/NIS+), were developed to support
alternative database stores and facilitate data sharing.
The PADL approach was a big step forward and has become popular in many large
deployments. As the approach gained popularity, a number of opportunities for
improvement also surfaced. For example, the libraries that nss_ldap depends on may
conflict with those loaded by applications, when nss_ldap is built as a shared library. On
the other hand, applications may become bloated if nss_ldap is built as a static library.
In addition, applications loaded with nss_ldap may not be thread-safe due to the fact
that nss_ldap makes use of libraries that are not themselves thread-safe.
Furthermore, nss_ldap and pam_ldap provide very limited caching capability, which
poses performance issues, particularly over high latency or low-bandwidth networks.
Also there is no resource management for connections to LDAP servers, and both
nss_ldap and pam_ldap become non-functional when the LDAP servers are
disconnected.
The nss-pam-ldapd daemon [8] developed by Arthur de Jong and Howard Chu also
provides LDAP support for system name resolution, authentication, and authorization
services. The design includes nss_ldap and pam_ldap similar to the PADL’s approach,
except that those libraries do not issue LDAP client calls directly to LDAP servers.
Instead, the libraries communicate with the nss-pam-ldapd daemon via the NSLCD
protocol through a Unix domain socket. The approach modularized LDAP-related
functionalities into a separate process, which addressed many issues in the original
PADL design.
Unified Authentication, Authorization, and User Administration using OpenLDAP SLAPD and
its Extensions
The unified authentication, authorization, and user administration design replaces the
nss-pam-ldapd daemon with the SLAPD server, further making available full-fledged
SLAPD features such as performance, scalability, and high availability.
PAM-enabled applications
ssh telnet ftp rsh ... sudo
Unix Domain
Socket (IPC)
NSLCD NSLCD
nss_ldap
protocol protocol nssov ldap
backend
SLAPD
pam_ldap + proxy
cache
LDAP
SLAPD + extensions
Figure 1 The unified authentication, authorization, and user administration architecture using
OpenLDAP SLAPD with Name-Service Overlay (nssov), ldap backend, and proxy cache
The design inherits the architecture enhancements from nss_ldap, pam_ldap, and nss-
pam-ldapd, with the added features of client-side caching, support for disconnected
operations, and LDAP connection sharing:
The system works alongside with existing solutions, such as NIS, NIS+, DNS,
and flat files.
The LDAP library is not loaded with every process that accesses the services.
There is no deadlock in host name lookup of LDAP server during boot process.
Regional clients are serviced by their respective regional SLAPD servers. Cross-
region accesses by clients are reduced to a minimum, if not completely
eliminated.
Each client is equipped with cache configuration. Repeated client accesses will
be resolved locally, which eliminates latencies for remote server accesses.
dc=com
SLAPD SLAPD
ou=NA ou=EMEA
syncrepl
... ...
PAM-enabled applications
ssh telnet ftp rsh ... sudo
Unix Domain
Socket (IPC)
NSLCD
nss_ldap ldap
protocol nssov
backend
SLAPD
pam_ldap + proxy
cache
LDAP
SLAPD + extensions
The OpenLDAP overlays are software components that can be stacked together to
customize SLAPD behavior. The nssov overlay offers the additional NSLCD client
communication protocol to the SLAPD server.
The nssov overlay may be configured with Service Search Descriptors (SSDs) for each
NSS service:
where <service> may be one of the following: aliases, ethers, group, hosts, netgroup,
networks, passwd, protocols, rpc, services, shadow. The <url> must be of the form:
ldap:///[<basedn>][??[<scope>][?<filter>]]
The default <basedn> and <scope> are respectively first suffix of the current database
and subtree. The default <filter> depends on which service is being used.
For example, the nssov overlay may be configured with the OpenLDAP ldap backend
by adding the following to [Link]:
include <path to>[Link]
moduleload <path to>[Link]
database ldap
overlay nssov
If the local database is actually a proxy to a foreign LDAP server, mapping of schema
may be needed. Simple attribute substitutions may be performed using the following:
nssov-map <service> <original attribute> <new attribute>
The overlay also supports dynamic configuration under “cn=config”. The layout of an
example configuration entry is as follows:
dn: olcOverlay={0}nssov,olcDatabase={1}hdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcNssOvConfig
olcOverlay: {0}nssov
olcNssSsd: passwd ldap:///ou=users,dc=example,dc=com??one
olcNssMap: passwd uid accountName
which enables the passwd service and uses the accountName attribute to
fetch what is usually retrieved from the uid attribute.
The OpenLDAP Proxy Cache engine was designed to improve the responsiveness of
the ldap and meta backends. Instead of caching only individual entries, the proxy cache
stores data and semantic information corresponding to recently answered queries. The
cache manager implements the following three algorithms:
The proxy cache handles a search query by first determining whether it is contained in
any cached search filter. Contained requests are answered from the proxy cache's local
database. Other requests are passed on to the underlying ldap or meta backend and
processed as usual. The LDAP matching rules and syntaxes are used while comparing
assertions for query containment.
To simplify the query containment implementation, a list of cacheable templates
(defined below) is specified at configuration time. A query is cached or answered only if
it belongs to one of these templates. The entries corresponding to cached queries are
stored in the proxy cache local database, Berkeley DB or Memory-Mapped Database [9],
while their associated meta-information (filter, scope, base, attributes) is stored in main
memory. The design of Memory-Mapped Database improves over Berkeley DB on
cache management and lock management.
The string representation of prototype filters is similar to LDAP filters [10], except that
the assertion values are missing. A template is a prototype filter for generating LDAP
search requests. Search filters are templates associated with their respective list of
attribute values. Examples of prototype filters are (sn=) and (&(sn=)(givenname=))
which are instantiated by search filters (sn=Doe) and (&(sn=Doe)(givenname=John))
respectively.
The cache replacement policy removes the least recently used (LRU) query and entries
belonging to only that query. Queries are allowed a maximum time to live (TTL) in the
cache thus providing weak consistency. A background task periodically checks the
cache for expired queries and removes them.
The following directive enables proxy caching and defines the configuration parameters:
The <db> parameter specifies the underlying database type which is used to hold the
cache entries. The <maxentries> parameter specifies the total number of entries that
may be held in the cache. The <nattrsets> parameter specifies the total number of
attribute sets that may be defined. The <entrylimit> parameter specifies the maximum
number of entries in a cacheable query. The <period> parameter specifies the
consistency checking period (in seconds). In each check period, queries with expired
TTL are removed.
The proxyTemplate directive further associates a cacheable prototype filter and the
time-to-live (TTL) parameter with an index of an attribute set:
overlay proxycache
proxycache bdb 100000 11 1000 100
# posixAccount
proxyAttrset 0 cn uid uidNumber gidNumber homeDirectory userPassword loginShell gecos
description objectClass
# shadowAccount
proxyAttrset 1 uid userPassword shadowLastChange shadowMin shadowMax shadowWarning
shadowInactive shadowExpire shadowFlag description objectClass
# posixGroup
proxyAttrset 2 cn gidNumber userPassword memberUid uniqueMember description objectClass
# proxy templates
proxyTemplate (&(objectClass=)(uid=)) 0 3600
proxyTemplate (&(objectClass=)(uidNumber=)) 0 3600
proxyTemplate (objectClass=) 0 3600
proxyTemplate (&(objectClass=)(uid=)) 1 3600
proxyTemplate (&(objectClass=)(cn=)) 2 3600
proxyTemplate (objectClass=) 2 3600
proxyTemplate (&(objectClass=)(gidNumber=)) 2 3600
proxyTemplate (&(objectClass=)(|(memberUid=)(uniqueMember=)) 2 3600
Summary
References
*2+ K. Zeilenga, J.H. Choi, “The Lightweight Directory Access Protocol (LDAP) Content
Synchronization Operation,” RFC 4533, June 2006
[3+ V. Samar, “Unified login with pluggable authentication modules (PAM),” Proceedings of
the 3rd ACM conference on computer and communications security, 1996, pp. 1-10
[4] J. Sermersheim, Ed., “Lightweight Directory Access Protocol (LDAP): The Protocol,” RFC
4511, June 2006
*5+ T. Dierks, C. Allen, “The TLS Protocol Version 1.0,” RFC 2246, January 1999
[6+ A. Kumar, “The OpenLDAP Proxy Cache,” IBM, India Research Lab,
[Link]
[9+ H. Chu, “MDB: A Memory-Mapped Database and Backend for OpenLDAP,” LDAPConf
2011, October 10-11, Heidelberg, Germany
Biographies