]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-ldap.5
refuse illegal values for "threads" (ITS#4433)
[openldap] / doc / man / man5 / slapd-ldap.5
1 .TH SLAPD-LDAP 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2006 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapd-ldap \- LDAP backend to slapd
7 .SH SYNOPSIS
8 ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The LDAP backend to
11 .BR slapd (8)
12 is not an actual database; instead it acts as a proxy to forward incoming
13 requests to another LDAP server. While processing requests it will also
14 chase referrals, so that referrals are fully processed instead of being
15 returned to the slapd client.
16
17 Sessions that explicitly Bind to the back-ldap database always create their
18 own private connection to the remote LDAP server. Anonymous sessions will
19 share a single anonymous connection to the remote server. For sessions bound
20 through other mechanisms, all sessions with the same DN will share the
21 same connection. This connection pooling strategy can enhance the proxy's
22 efficiency by reducing the overhead of repeatedly making/breaking multiple
23 connections.
24
25 The ldap database can also act as an information service, i.e. the identity
26 of locally authenticated clients is asserted to the remote server, possibly
27 in some modified form.
28 For this purpose, the proxy binds to the remote server with some 
29 administrative identity, and, if required, authorizes the asserted identity.
30 See the 
31 .IR idassert- *
32 rules below.
33 The administrative identity of the proxy, on the remote server, must be 
34 allowed to authorize by means of appropriate
35 .B authzTo
36 rules; see 
37 .BR slapd.conf (5)
38 for details.
39
40 .LP
41 Note: When looping back to the same instance of \fBslapd\fP(8), 
42 each connection requires a new thread; as a consequence, \fBslapd\fP(8)
43 must be compiled with thread support, and the \fBthreads\fP parameter 
44 may need some tuning; in those cases, one may consider using 
45 \fBslapd-relay\fP(5) instead, which performs the relayed operation 
46 internally and thus reuses the same connection.
47
48 .SH CONFIGURATION
49 These
50 .B slapd.conf
51 options apply to the LDAP backend database.
52 That is, they must follow a "database ldap" line and come before any
53 subsequent "backend" or "database" lines.
54 Other database options are described in the
55 .BR slapd.conf (5)
56 manual page.
57
58 .LP
59 Note: In early versions of back-ldap it was recommended to always set
60 .LP
61 .RS
62 .nf
63 lastmod  off
64 .fi
65 .RE
66 .LP
67 for every
68 .B ldap
69 and
70 .B meta
71 database.
72 This is because operational attributes related to entry creation and
73 modification should not be proxied, as they could be mistakenly written
74 to the target server(s), generating an error.
75 The current implementation automatically sets lastmod to off, so its use
76 is redundant and should be omitted, because the lastmod directive will
77 be deprecated in the future.
78
79 .TP
80 .B uri <ldapurl>
81 LDAP server to use.  Multiple URIs can be set in in a single
82 .B ldapurl
83 argument, resulting in the underlying library automatically 
84 call the first server of the list that responds, e.g. 
85
86 \fBuri "ldap://host/ ldap://backup-host"\fP
87
88 The URI list is space- or comma-separated.
89 This statement is mandatory.
90 .\".TP
91 .\".B server <hostport>
92 .\"Obsolete option; same as `uri ldap://<hostport>/'.
93 .HP
94 .hy 0
95 .B acl-bind
96 .B bindmethod=simple|sasl [binddn=<simple DN>] [credentials=<simple password>]
97 .B [saslmech=<SASL mech>] [secprops=<properties>] [realm=<realm>]
98 .B [authcId=<authentication ID>] [authzId=<authorization ID>]
99 .RS
100 Allows to define the parameters of the authentication method that is 
101 internally used by the proxy to collect info related to access control.
102 The identity defined by this directive, according to the properties
103 associated to the authentication method, is supposed to have read access 
104 on the target server to attributes used on the proxy for ACL checking.
105 There is no risk of giving away such values; they are only used to
106 check permissions.
107 The default is to use
108 .BR simple 
109 bind, with empty \fIbinddn\fP and \fIcredentials\fP,
110 which means that the related operations will be performed anonymously.
111
112 .B This identity is by no means implicitly used by the proxy 
113 .B when the client connects anonymously.
114 The
115 .B idassert-bind
116 feature, instead, in some cases can be crafted to implement that behavior,
117 which is \fIintrinsically unsafe and should be used with extreme care\fP.
118 This directive obsoletes
119 .BR acl-authcDN ,
120 and
121 .BR acl-passwd .
122 .RE
123
124 .HP
125 .hy 0
126 .B idassert-bind
127 .B bindmethod=none|simple|sasl [binddn=<simple DN>] [credentials=<simple password>]
128 .B [saslmech=<SASL mech>] [secprops=<properties>] [realm=<realm>]
129 .B [authcId=<authentication ID>] [authzId=<authorization ID>]
130 .B [authz={native|proxyauthz}] [mode=<mode>] [flags=<flags>]
131 .RS
132 Allows to define the parameters of the authentication method that is 
133 internally used by the proxy to authorize connections that are 
134 authenticated by other databases.
135 The identity defined by this directive, according to the properties
136 associated to the authentication method, is supposed to have auth access 
137 on the target server to attributes used on the proxy for authentication
138 and authorization, and to be allowed to authorize the users.
139 This requires to have
140 .B proxyAuthz
141 privileges on a wide set of DNs, e.g.
142 .BR authzTo=dn.subtree:"" ,
143 and the remote server to have
144 .B authz-policy
145 set to
146 .B to
147 or
148 .BR both .
149 See
150 .BR slapd.conf (5)
151 for details on these statements and for remarks and drawbacks about
152 their usage.
153 The supported bindmethods are
154
155 \fBnone|simple|sasl\fP
156
157 where
158 .B none
159 is the default, i.e. no \fIidentity assertion\fP is performed.
160
161 The authz parameter is used to instruct the SASL bind to exploit 
162 .B native 
163 SASL authorization, if available; since connections are cached,
164 this should only be used when authorizing with a fixed identity
165 (e.g. by means of the 
166 .B authzDN
167 or
168 .B authzID
169 parameters).
170 Otherwise, the default
171 .B proxyauthz
172 is used, i.e. the proxyAuthz control is added to all operations.
173
174 The supported modes are:
175
176 \fB<mode> := {legacy|anonymous|none|self}\fP
177
178 If 
179 .B <mode>
180 is not present, and 
181 .B authzId
182 is given, the proxy always authorizes that identity.
183 .B <authorization ID>
184 can be 
185
186 \fBu:<user>\fP
187
188 \fB[dn:]<DN>\fP
189
190 The former is supposed to be expanded by the remote server according 
191 to the authz rules; see
192 .BR slapd.conf (5)
193 for details.
194 In the latter case, whether or not the 
195 .B dn:
196 prefix is present, the string must pass DN validation and normalization.
197
198 The default mode is 
199 .BR legacy ,
200 which implies that the proxy will either perform a simple bind as the
201 .I authcDN
202 or a SASL bind as the
203 .I authcID
204 and assert the client's identity when it is not anonymous.
205 Direct binds are always proxied.
206 The other modes imply that the proxy will always either perform a simple bind 
207 as the
208 .IR authcDN
209 or a SASL bind as the
210 .IR authcID ,
211 unless restricted by
212 .BR idassert-authzFrom
213 rules (see below), in which case the operation will fail;
214 eventually, it will assert some other identity according to
215 .BR <mode> .
216 Other identity assertion modes are
217 .BR anonymous
218 and
219 .BR self ,
220 which respectively mean that the 
221 .I empty 
222 or the 
223 .IR client 's 
224 identity
225 will be asserted;
226 .BR none ,
227 which means that no proxyAuthz control will be used, so the
228 .I authcDN
229 or the
230 .I authcID
231 identity will be asserted.
232 For all modes that require the use of the
233 .I proxyAuthz 
234 control, on the remote server the proxy identity must have appropriate 
235 .I authzTo
236 permissions, or the asserted identities must have appropriate
237 .I authzFrom 
238 permissions.  Note, however, that the ID assertion feature is mostly 
239 useful when the asserted identities do not exist on the remote server.
240
241 Flags can be
242
243 \fBoverride,{prescriptive|non-prescriptive}\fP
244
245 When the 
246 .B override
247 flag is used, identity assertion takes place even when the database
248 is authorizing for the identity of the client, i.e. after binding
249 with the provided identity, and thus authenticating it, the proxy
250 performs the identity assertion using the configured identity and
251 authentication method.
252
253 When the
254 .B prescriptive
255 flag is used (the default), operations fail with
256 \fIinappropriateAuthentication\fP
257 for those identities whose assertion is not allowed by the
258 .B idassert-authzFrom
259 patterns.
260 If the 
261 .B non-prescriptive
262 flag is used, operations are performed anonymously for those identities 
263 whose assertion is not allowed by the
264 .B idassert-authzFrom
265 patterns.
266
267 This directive obsoletes
268 .BR idassert-authcDN ,
269 .BR idassert-passwd ,
270 .BR idassert-mode ,
271 and
272 .BR idassert-method .
273 .RE
274
275 .TP
276 .B idassert-authzFrom <authz-regexp>
277 if defined, selects what
278 .I local
279 identities are authorized to exploit the identity assertion feature.
280 The string
281 .B <authz-regexp>
282 follows the rules defined for the
283 .I authzFrom
284 attribute.
285 See 
286 .BR slapd.conf (5),
287 section related to
288 .BR authz-policy ,
289 for details on the syntax of this field.
290
291 .TP
292 .B proxy-whoami {NO|yes}
293 Turns on proxying of the WhoAmI extended operation. If this option is
294 given, back-ldap will replace slapd's original WhoAmI routine with its
295 own. On slapd sessions that were authenticated by back-ldap, the WhoAmI
296 request will be forwarded to the remote LDAP server. Other sessions will
297 be handled by the local slapd, as before. This option is mainly useful
298 in conjunction with Proxy Authorization.
299
300 .TP
301 .B rebind-as-user {NO|yes}
302 If this option is given, the client's bind credentials are remembered
303 for rebinds when chasing referrals.  Useful when
304 \fBchase-referrals\fP is set to \fByes\fP, useless otherwise.
305
306 .TP
307 .B chase-referrals {YES|no}
308 enable/disable automatic referral chasing, which is delegated to the
309 underlying libldap, with rebinding eventually performed if the
310 \fBrebind-as-user\fP directive is used.  The default is to chase referrals.
311
312 .TP
313 .B tls {[try-]start|[try-]propagate}
314 execute the StartTLS extended operation when the connection is initialized;
315 only works if the URI directive protocol scheme is not \fBldaps://\fP.
316 \fBpropagate\fP issues the StartTLS operation only if the original
317 connection did.
318 The \fBtry-\fP prefix instructs the proxy to continue operations
319 if the StartTLS operation failed; its use is highly deprecated.
320
321 .TP
322 .B t-f-support {NO|yes|discover}
323 enable if the remote server supports absolute filters
324 (see \fIdraft-zeilenga-ldap-t-f\fP for details).
325 If set to
326 .BR discover ,
327 support is detected by reading the remote server's root DSE.
328
329 .TP
330 .B timeout [{add|delete|modify|modrdn}=]<val> [...]
331 This directive allows to set per-operation timeouts.
332 If no operation is specified, it affects all.
333 Currently, only write operations are addressed, because searches
334 can already be limited by means of the
335 .B limits
336 directive (see 
337 .BR slapd.conf (5)
338 for details), and other operations are not supposed to incur into the
339 need for timeouts.
340 Note: if the timelimit is exceeded, the operation is abandoned;
341 the protocol does not provide any means to rollback the operation,
342 so the client will not know if the operation eventually succeeded or not.
343
344 .TP
345 .B idle-timeout <time>
346 This directive causes a cached connection to be dropped an recreated
347 after it has been idle for the specified time.
348
349 .TP
350 .B conn-ttl <time>
351 This directive causes a cached connection to be dropped an recreated
352 after a given ttl, regardless of being idle or not.
353
354 .SH BACKWARD COMPATIBILITY
355 The LDAP backend has been heavily reworked between releases 2.2 and 2.3;
356 as a side-effect, some of the traditional directives have been
357 deprecated and should be no longer used, as they might disappear
358 in future releases.
359
360 .TP
361 .B server <hostname[:port]>
362 this directive is no longer supported.  Use the 
363 .B uri
364 directive as described above.
365
366 .TP
367 .B acl-authcDN "<administrative DN for access control purposes>"
368 DN which is used to query the target server for acl checking; it
369 is supposed to have read access on the target server to attributes used
370 on the proxy for acl checking.
371 There is no risk of giving away such values; they are only used to
372 check permissions.
373 .B The acl-authcDN identity is by no means implicitly used by the proxy 
374 .B when the client connects anonymously.
375 See the
376 .B idassert-*
377 feature instead.
378 This directive is obsoleted by the
379 .B binddn
380 arg of
381 .B acl-bind
382 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
383
384 .TP
385 .B acl-passwd <password>
386 Password used with the above
387 .B acl-authcDN
388 directive.
389 This directive is obsoleted by the
390 .B binddn
391 arg of
392 .B acl-bind
393 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
394
395 .TP
396 .B idassert-authcDN "<administrative DN for proxyAuthz purposes>"
397 DN which is used to propagate the client's identity to the target
398 by means of the proxyAuthz control when the client does not
399 belong to the DIT fragment that is being proxied by back-ldap.
400 This directive is obsoleted by the
401 .B binddn
402 arg of
403 .BR idassert-bind
404 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
405
406 .TP
407 .B idassert-passwd <password>
408 Password used with the
409 .B idassert-authcDN
410 above.
411 This directive is obsoleted by the
412 .B crendentials
413 of
414 .B idassert-bind
415 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
416
417 .TP
418 .B idassert-mode <mode> [<flags>]
419 defines what type of
420 .I identity assertion
421 is used.
422 This directive is obsoleted by the
423 .B mode
424 arg of 
425 .BR idassert-bind ,
426 and will be dismissed in the future.
427
428 .TP
429 .B idassert-method <method> [<saslargs>]
430 This directive is obsoleted by the
431 .B bindmethod
432 arg of
433 .BR idassert-bind ,
434 and will be dismissed in the future.
435
436 .TP
437 .B suffixmassage, map, rewrite*
438 These directives are no longer supported by back-ldap; their 
439 functionality is now delegated to the
440 .B rwm
441 overlay.  Essentially, add a statement
442
443 .B overlay rwm
444
445 first, and prefix all rewrite/map statements with
446 .B rwm-
447 to obtain the original behavior.
448 See
449 .BR slapo-rwm (5)
450 for details.
451 .\" However, to ease update from existing configurations, back-ldap still 
452 .\" recognizes them and automatically instantiates the
453 .\" .B rwm
454 .\" overlay if available and not instantiated yet.
455 .\" This behavior may change in the future.
456
457 .SH ACCESS CONTROL
458 The
459 .B ldap
460 backend does not honor all ACL semantics as described in
461 .BR slapd.access (5).
462 In general, access checking is delegated to the remote server(s).
463 Only
464 .B read (=r)
465 access to the
466 .B entry
467 pseudo-attribute and to the other attribute values of the entries
468 returned by the
469 .B search
470 operation is honored, which is performed by the frontend.
471
472 .SH OVERLAYS
473 The LDAP backend provides basic proxying functionalities to many overlays.
474 The 
475 .B chain
476 overlay, described in
477 .BR slapo\-chain (5),
478 and the
479 .B translucent
480 overlay, described in
481 .BR slapo\-translucent (5),
482 deserve a special mention.
483
484 Conversely, there are many overlays that are best used in conjunction
485 with the LDAP backend.
486 The
487 .B proxycache 
488 overlay allows caching of LDAP search requests (queries) 
489 in a local database.
490 See 
491 .BR slapo\-pcache (5)
492 for details.
493 The
494 .B rwm
495 overlay provides DN rewrite and attribute/objectClass mapping
496 capabilities to the underlying database.
497 See 
498 .BR slapo\-rwm (5)
499 for details.
500
501 .SH FILES
502 .TP
503 ETCDIR/slapd.conf
504 default slapd configuration file
505 .SH SEE ALSO
506 .BR slapd.conf (5),
507 .BR slapd\-meta (5),
508 .BR slapo\-chain (5),
509 .BR slapo\-pcache (5),
510 .BR slapo\-rwm (5),
511 .BR slapo\-translucent (5),
512 .BR slapd (8),
513 .BR ldap (3).
514 .SH AUTHOR
515 Howard Chu, with enhancements by Pierangelo Masarati