]> git.sur5r.net Git - openldap/blob - contrib/slapd-modules/nssov/slapo-nssov.5
slapo-nssov.5 draft. Please use as starting point.
[openldap] / contrib / slapd-modules / nssov / slapo-nssov.5
1 .TH SLAPO-NSSOV 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2009 The OpenLDAP Foundation, All Rights Reserved.
3 .\" Copying restrictions apply.  See the COPYRIGHT file.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapo-nssov \- NSS lookup requests through a local Unix Domain socket
7 .SH SYNOPSIS
8 ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The
11 .B nssov 
12 overlay to
13 .BR slapd (8)
14 allows NSS lookup requests through a local Unix Domain socket. 
15 It uses the same IPC protocol as Arthur de Jong's nss-ldapd, and 
16 a complete copy of the nss-ldapd source is included here. It also 
17 handles PAM requests.
18 .LP
19 The main objective here was to eliminate the libldap dependencies/clashes that 
20 the current pam_ldap/nss_ldap solutions all suffer from. A secondary objective 
21 was to allow for the possibility of more sophisticated caching than nscd 
22 provides. (E.g., run slapd back-ldap + pcache on each node.) Of course, you 
23 can also completey eliminate cache staleness considerations by running a 
24 regular database with syncrepl.
25 .LP
26 And of course, another major objective was to allow all security policy to be 
27 administered centrally via LDAP, instead of having fragile rules scattered 
28 across multiple flat files. As such, there is no client-side configuration at 
29 all for the pam/nss stub libraries. (They talk to the server via a Unix domain 
30 socket whose path is hardcoded to /var/run/nslcd/). As a side benefit, this 
31 can finally eliminate the perpetual confusion over /etc/ldap.conf vs 
32 /etc/openldap/ldap.conf.
33 .LP
34 User authentication is performed by internal simple Binds. User authorization 
35 leverages the slapd ACL engine, which offers much more power and flexibility 
36 than the simple group/hostname checks in the old pam_ldap code.
37 .LP
38 To use this code, you will need the client-side stub library from
39 nss-ldapd (which resides in nss-ldapd/nss). You will not need the
40 nslcd daemon; this overlay replaces that part. You should already
41 be familiar with the [RFC2307] and [RFC2307bis] schema to use this
42 overlay. See the 
43 .B nss-ldapd/README 
44 for more information on the schema and which features are supported.
45 .LP
46 To use the overlay add:
47 .LP 
48 .RS
49 .nf
50     include <path to>nis.schema
51
52     moduleload <path to>nssov.so
53     ...
54
55     database hdb
56     ...
57     overlay nssov
58 .fi
59 .RE
60 .LP
61 to your slapd configuration file. (The nis.schema file contains
62 the original [RFC2307] schema. Some modifications will be needed to
63 use [RFC2307bis].)
64 .LP
65 The overlay may be configured with 
66 .B Service Search Descriptors (SSDs)
67 for each NSS service that will be used. SSDs are configured using
68 .LP 
69 .RS
70 .nf
71     nssov-ssd <service> <url>
72 .fi
73 .RE
74 .LP
75 where the <service> may be one of
76 .LP 
77 .RS
78 .nf
79     alias
80     ether
81     group
82     host
83     netgroup
84     network
85     passwd
86     protocol
87     rpc
88     service
89     shadow
90 .fi
91 .RE
92 .LP
93 and the <url> must be of the form
94 .LP 
95 .RS
96 .nf
97     ldap:///[<basedn>][??[<scope>][?<filter>]]
98 .fi
99 .RE
100 .LP
101 The 
102 .B <basedn> 
103 will default to the first suffix of the current database.
104 The 
105 .B <scope> 
106 defaults to "subtree". The default 
107 .B <filter> 
108 depends on which service is being used.
109 .LP
110 If the local database is actually a proxy to a foreign LDAP server, some
111 mapping of schema may be needed. Some simple attribute substitutions may
112 be performed using
113 .LP 
114 .RS
115 .nf
116     nssov-map <service> <orig> <new>
117 .fi
118 .RE
119 .LP
120 See the 
121 .B nss-ldapd/README 
122 for the original attribute names used in this code.
123 .LP
124 The overlay also supports dynamic configuration in cn=config. The layout
125 of the config entry is
126 .LP 
127 .RS
128 .nf
129     dn: olcOverlay={0}nssov,ocDatabase={1}hdb,cn=config
130     objectClass: olcOverlayConfig
131     objectClass: olcNssOvConfig
132     olcOverlay: {0}nssov
133     olcNssSvc: passwd ldap:///ou=users,dc=example,dc=com??one
134     olcNssMap: passwd uid accountName
135 .fi
136 .RE
137 .LP
138 which enables the passwd service, and uses the accountName attribute to
139 fetch what is usually retrieved from the uid attribute.
140 .LP
141 PAM authentication, account management, session management, and password
142 management are supported.
143 .LP
144 Authentication is performed using Simple Binds. Since all operations occur
145 inside the slapd overlay, "fake" connections are used and they are
146 inherently secure. Two methods of mapping the PAM username to an LDAP DN
147 are provided:
148   the mapping can be accomplished using slapd's authz-regexp facility. In
149 this case, a DN of the form
150 .B    cn=<service>+uid=<user>,cn=<hostname>,cn=pam,cn=auth
151 is fed into the regexp matcher. If a match is produced, the resulting DN
152 is used. Otherwise, the NSS passwd map is invoked (which means it must already
153 be configured).
154 .LP
155 If no DN is found, the overlay returns PAM_USER_UNKNOWN. If the DN is
156 found, and Password Policy is supported, then the Bind will use the
157 Password Policy control and return expiration information to PAM.
158 .LP
159 Account management also uses two methods. These methods depend on the
160 ldapns.schema included with the nssov source.
161 .LP  
162 The first is identical to the method used in PADL's pam_ldap module:
163 host and authorizedService attributes may be looked up in the user's entry,
164 and checked to determine access. Also a check may be performed to see if
165 the user is a member of a particular group. This method is pretty
166 inflexible and doesn't scale well to large networks of users, hosts,
167 and services.
168 .LP
169   The second uses slapd's ACL engine to check if the user has "compare"
170 privilege on an ipHost object whose name matches the current hostname, and
171 whose authorizedService attribute matches the current service name. This
172 method is preferred, since it allows authorization to be centralized in
173 the ipHost entries instead of scattered across the entire user population.
174 The ipHost entries must have an authorizedService attribute (e.g. by way
175 of the authorizedServiceObject auxiliary class) to use this method.
176 .LP
177 Session management: the overlay may optionally add a "logged in" attribute
178 to a user's entry for successful logins, and delete the corresponding
179 value upon logout. The attribute value is of the form
180 .B    <generalizedTime> <host> <service> <tty> (<ruser@rhost>)
181 Password management: the overlay will perform a PasswordModify exop
182 in the server for the given user.
183 .SH FILES
184 .TP
185 ETCDIR/slapd.conf
186 default slapd configuration file
187 .SH SEE ALSO
188 .BR slapd.conf (5),
189 .BR slapd\-config (5),
190 .BR slapd\-ldap (5),
191 .BR slapd (8).
192 .SH AUTHOR
193 Originally implemented by Howard Chu; man page Gavin Henry, Suretec Systems Ltd.