]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-ldap.5
cleanup and document ITS#4781 commit
[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 
68 .B ldap
69 and
70 .B meta
71 databases.
72 This was required because operational attributes related to entry creation 
73 and 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 \fBoff\fP, 
76 so its use is redundant and should be omitted.
77
78 .TP
79 .B uri <ldapurl>
80 LDAP server to use.  Multiple URIs can be set in a single
81 .B ldapurl
82 argument, resulting in the underlying library automatically 
83 call the first server of the list that responds, e.g. 
84
85 \fBuri "ldap://host/ ldap://backup-host/"\fP
86
87 The URI list is space- or comma-separated.
88 Whenever the server that responds is not the first one in the list,
89 the list is rearranged and the responsive server is moved to the head,
90 so that it will be first contacted the next time a connection
91 needs be created.
92 .HP
93 .hy 0
94 .B acl-bind
95 .B bindmethod=simple|sasl [binddn=<simple DN>] [credentials=<simple password>]
96 .B [saslmech=<SASL mech>] [secprops=<properties>] [realm=<realm>]
97 .B [authcId=<authentication ID>] [authzId=<authorization ID>]
98 .RS
99 Allows to define the parameters of the authentication method that is 
100 internally used by the proxy to collect info related to access control,
101 and whenever an operation occurs with the identity of the rootdn
102 of the LDAP proxy database.
103 The identity defined by this directive, according to the properties
104 associated to the authentication method, is supposed to have read access 
105 on the target server to attributes used on the proxy for ACL checking.
106
107 There is no risk of giving away such values; they are only used to
108 check permissions.
109 The default is to use
110 .BR simple 
111 bind, with empty \fIbinddn\fP and \fIcredentials\fP,
112 which means that the related operations will be performed anonymously.
113 If not set, and if \fBidassert-bind\fP is defined, this latter identity
114 is used instead.  See \fBidassert-bind\fP for details.
115
116 The connection between the proxy database and the remote server
117 associated to this identity is cached regardless of the lifespan
118 of the client-proxy connection that first established it.
119
120 .B This identity is by no means implicitly used by the proxy 
121 .B when the client connects anonymously.
122 The
123 .B idassert-bind
124 feature, instead, in some cases can be crafted to implement that behavior,
125 which is \fIintrinsically unsafe and should be used with extreme care\fP.
126 This directive obsoletes
127 .BR acl-authcDN ,
128 and
129 .BR acl-passwd .
130 .RE
131
132 .TP
133 .B cancel {ABANDON|ignore|exop[-discover]}
134 Defines how to handle operation cancellation.
135 By default,
136 .B abandon
137 is invoked, so the operation is abandoned immediately.
138 If set to
139 .BR ignore ,
140 no action is taken and any further response is ignored; this may result
141 in further response messages to be queued for that connection, so it is
142 recommended that long lasting connections are timed out either by
143 .I idle-timeout
144 or
145 .IR conn-ttl ,
146 so that resources eventually get released.
147 If set to
148 .BR exop ,
149 a
150 .I cancel
151 operation (RFC 3909) is issued, resulting in the cancellation 
152 of the current operation; the
153 .I cancel
154 operation waits for remote server response, so its use 
155 may not be recommended.
156 If set to
157 .BR exop-discover ,
158 support of the
159 .I cancel 
160 extended operation is detected by reading the remote server's root DSE.
161
162 .TP
163 .B chase-referrals {YES|no}
164 enable/disable automatic referral chasing, which is delegated to the
165 underlying libldap, with rebinding eventually performed if the
166 \fBrebind-as-user\fP directive is used.  The default is to chase referrals.
167
168 .TP
169 .B conn-ttl <time>
170 This directive causes a cached connection to be dropped an recreated
171 after a given ttl, regardless of being idle or not.
172
173 .TP
174 .B idassert-authzFrom <authz-regexp>
175 if defined, selects what
176 .I local
177 identities are authorized to exploit the identity assertion feature.
178 The string
179 .B <authz-regexp>
180 follows the rules defined for the
181 .I authzFrom
182 attribute.
183 See 
184 .BR slapd.conf (5),
185 section related to
186 .BR authz-policy ,
187 for details on the syntax of this field.
188
189 .HP
190 .hy 0
191 .B idassert-bind
192 .B bindmethod=none|simple|sasl [binddn=<simple DN>] [credentials=<simple password>]
193 .B [saslmech=<SASL mech>] [secprops=<properties>] [realm=<realm>]
194 .B [authcId=<authentication ID>] [authzId=<authorization ID>]
195 .B [authz={native|proxyauthz}] [mode=<mode>] [flags=<flags>]
196 .RS
197 Allows to define the parameters of the authentication method that is 
198 internally used by the proxy to authorize connections that are 
199 authenticated by other databases.
200 The identity defined by this directive, according to the properties
201 associated to the authentication method, is supposed to have auth access 
202 on the target server to attributes used on the proxy for authentication
203 and authorization, and to be allowed to authorize the users.
204 This requires to have
205 .B proxyAuthz
206 privileges on a wide set of DNs, e.g.
207 .BR authzTo=dn.subtree:"" ,
208 and the remote server to have
209 .B authz-policy
210 set to
211 .B to
212 or
213 .BR both .
214 See
215 .BR slapd.conf (5)
216 for details on these statements and for remarks and drawbacks about
217 their usage.
218 The supported bindmethods are
219
220 \fBnone|simple|sasl\fP
221
222 where
223 .B none
224 is the default, i.e. no \fIidentity assertion\fP is performed.
225
226 The authz parameter is used to instruct the SASL bind to exploit 
227 .B native 
228 SASL authorization, if available; since connections are cached,
229 this should only be used when authorizing with a fixed identity
230 (e.g. by means of the 
231 .B authzDN
232 or
233 .B authzID
234 parameters).
235 Otherwise, the default
236 .B proxyauthz
237 is used, i.e. the proxyAuthz control (Proxied Authorization, RFC 4370)
238 is added to all operations.
239
240 The supported modes are:
241
242 \fB<mode> := {legacy|anonymous|none|self}\fP
243
244 If 
245 .B <mode>
246 is not present, and 
247 .B authzId
248 is given, the proxy always authorizes that identity.
249 .B <authorization ID>
250 can be 
251
252 \fBu:<user>\fP
253
254 \fB[dn:]<DN>\fP
255
256 The former is supposed to be expanded by the remote server according 
257 to the authz rules; see
258 .BR slapd.conf (5)
259 for details.
260 In the latter case, whether or not the 
261 .B dn:
262 prefix is present, the string must pass DN validation and normalization.
263
264 The default mode is 
265 .BR legacy ,
266 which implies that the proxy will either perform a simple bind as the
267 .I authcDN
268 or a SASL bind as the
269 .I authcID
270 and assert the client's identity when it is not anonymous.
271 Direct binds are always proxied.
272 The other modes imply that the proxy will always either perform a simple bind 
273 as the
274 .IR authcDN
275 or a SASL bind as the
276 .IR authcID ,
277 unless restricted by
278 .BR idassert-authzFrom
279 rules (see below), in which case the operation will fail;
280 eventually, it will assert some other identity according to
281 .BR <mode> .
282 Other identity assertion modes are
283 .BR anonymous
284 and
285 .BR self ,
286 which respectively mean that the 
287 .I empty 
288 or the 
289 .IR client 's 
290 identity
291 will be asserted;
292 .BR none ,
293 which means that no proxyAuthz control will be used, so the
294 .I authcDN
295 or the
296 .I authcID
297 identity will be asserted.
298 For all modes that require the use of the
299 .I proxyAuthz 
300 control, on the remote server the proxy identity must have appropriate 
301 .I authzTo
302 permissions, or the asserted identities must have appropriate
303 .I authzFrom 
304 permissions.  Note, however, that the ID assertion feature is mostly 
305 useful when the asserted identities do not exist on the remote server.
306
307 Flags can be
308
309 \fBoverride,[non-]prescriptive\fP
310
311 When the 
312 .B override
313 flag is used, identity assertion takes place even when the database
314 is authorizing for the identity of the client, i.e. after binding
315 with the provided identity, and thus authenticating it, the proxy
316 performs the identity assertion using the configured identity and
317 authentication method.
318
319 When the
320 .B prescriptive
321 flag is used (the default), operations fail with
322 \fIinappropriateAuthentication\fP
323 for those identities whose assertion is not allowed by the
324 .B idassert-authzFrom
325 patterns.
326 If the 
327 .B non-prescriptive
328 flag is used, operations are performed anonymously for those identities 
329 whose assertion is not allowed by the
330 .B idassert-authzFrom
331 patterns.
332
333 The identity associated to this directive is also used for privileged
334 operations whenever \fBidassert-bind\fP is defined and \fBacl-bind\fP
335 is not.  See \fBacl-bind\fP for details.
336
337 This directive obsoletes
338 .BR idassert-authcDN ,
339 .BR idassert-passwd ,
340 .BR idassert-mode ,
341 and
342 .BR idassert-method .
343 .RE
344
345 .TP
346 .B idle-timeout <time>
347 This directive causes a cached connection to be dropped an recreated
348 after it has been idle for the specified time.
349
350 .TP
351 .B network-timeout <time>
352 Sets the network timeout value after which
353 .BR poll (2)/ select (2) 
354 following a 
355 .BR connect (2) 
356 returns in case of no activity.
357 The value is in seconds, and it can be specified as for
358 .BR idle-timeout .
359
360 .TP
361 .B protocol\-version {0,2,3}
362 This directive indicates what protocol version must be used to contact
363 the remote server.
364 If set to 0 (the default), the proxy uses the same protocol version 
365 used by the client, otherwise the requested protocol is used.
366 The proxy returns \fIunwillingToPerform\fP if an operation that is 
367 incompatible with the requested protocol is attempted.
368
369 .TP
370 .B proxy\-whoami {NO|yes}
371 Turns on proxying of the WhoAmI extended operation. If this option is
372 given, back-ldap will replace slapd's original WhoAmI routine with its
373 own. On slapd sessions that were authenticated by back-ldap, the WhoAmI
374 request will be forwarded to the remote LDAP server. Other sessions will
375 be handled by the local slapd, as before. This option is mainly useful
376 in conjunction with Proxy Authorization.
377
378 .TP
379 .B quarantine <interval>,<num>[;<interval>,<num>[...]]
380 Turns on quarantine of URIs that returned
381 .IR LDAP_UNAVAILABLE ,
382 so that an attempt to reconnect only occurs at given intervals instead
383 of any time a client requests an operation.
384 The pattern is: retry only after at least
385 .I interval
386 seconds elapsed since last attempt, for exactly
387 .I num
388 times; then use the next pattern.
389 If
390 .I num
391 for the last pattern is "\fB+\fP", it retries forever; otherwise, 
392 no more retries occur.
393 The process can be restarted by resetting the \fIolcDbQuarantine\fP
394 attribute of the database entry in the configuration backend.
395
396 .TP
397 .B rebind-as-user {NO|yes}
398 If this option is given, the client's bind credentials are remembered
399 for rebinds, when trying to re-establish a broken connection,
400 or when chasing a referral, if 
401 .B chase-referrals
402 is set to
403 .IR yes .
404
405 .TP
406 .B single\-conn {NO|yes}
407 Discards current cached connection when the client rebinds.
408
409 .TP
410 .B t-f-support {NO|yes|discover}
411 enable if the remote server supports absolute filters
412 (see \fIdraft-zeilenga-ldap-t-f\fP for details).
413 If set to
414 .BR discover ,
415 support is detected by reading the remote server's root DSE.
416
417 .TP
418 .B timeout [<op>=]<val> [...]
419 This directive allows to set per-operation timeouts.
420 Operations can be
421
422 \fB<op> ::= bind, add, delete, modrdn, modify, compare\fP
423
424 The \fBsearch\fP operation is already controlled either
425 by the \fBtimelimit\fP parameter or by server-side enforced
426 time limits (see \fBtimelimit\fP and \fBlimits\fP in
427 .BR slapd.conf (5)
428 for details).
429 Timeout is meaningless for the remaining operations,
430 \fBunbind\fP and \fBabandon\fP, which do not imply any response,
431 while it is not yet implemented in currently supported \fBextended\fP 
432 operations.
433 If no operation is specified, the timeout \fBval\fP affects all
434 supported operations.
435
436 Note: if the timelimit is exceeded, the operation is cancelled
437 (according to the \fBcancel\fP directive);
438 the protocol does not provide any means to rollback operations,
439 so the client will not be notified about the result of the operation,
440 which may eventually succeeded or not.
441 In case the timeout is exceeded during a bind operation, the connection
442 is destroyed, according to RFC4511.
443
444 Note: in some cases, this backend may issue binds prior
445 to other operations (e.g. to bind anonymously or with some prescribed
446 identity according to the \fBidassert-bind\fP directive).
447 In this case, the timeout of the operation that resulted in the bind
448 is used.
449
450 .TP
451 .B tls {[try-]start|[try-]propagate}
452 execute the StartTLS extended operation when the connection is initialized;
453 only works if the URI directive protocol scheme is not \fBldaps://\fP.
454 \fBpropagate\fP issues the StartTLS operation only if the original
455 connection did.
456 The \fBtry-\fP prefix instructs the proxy to continue operations
457 if the StartTLS operation failed; its use is \fBnot\fP recommended.
458
459 .TP
460 .B use-temporary-conn {NO|yes}
461 when set to 
462 .BR yes ,
463 create a temporary connection whenever competing with other threads
464 for a shared one; otherwise, wait until the shared connection is available.
465
466 .SH BACKWARD COMPATIBILITY
467 The LDAP backend has been heavily reworked between releases 2.2 and 2.3,
468 and subsequently between 2.3 and 2.4.
469 As a side-effect, some of the traditional directives have been
470 deprecated and should be no longer used, as they might disappear
471 in future releases.
472
473 .TP
474 .B acl-authcDN "<administrative DN for access control purposes>"
475 Formerly known as the
476 .BR binddn ,
477 it is the DN that is used to query the target server for acl checking;
478 it is supposed to have read access on the target server to attributes used
479 on the proxy for acl checking.
480 There is no risk of giving away such values; they are only used to
481 check permissions.
482
483 .B The acl-authcDN identity is by no means implicitly used by the proxy 
484 .B when the client connects anonymously.
485 The
486 .B idassert-*
487 feature can be used (at own risk) for that purpose instead.
488
489 This directive is obsoleted by the
490 .B binddn
491 arg of
492 .B acl-bind
493 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
494
495 .TP
496 .B acl-passwd <password>
497 Formerly known as the
498 .BR bindpw ,
499 it is the password used with the above
500 .B acl-authcDN
501 directive.
502 This directive is obsoleted by the
503 .B credentials
504 arg of
505 .B acl-bind
506 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
507
508 .TP
509 .B idassert-authcDN "<administrative DN for proxyAuthz purposes>"
510 DN which is used to propagate the client's identity to the target
511 by means of the proxyAuthz control when the client does not
512 belong to the DIT fragment that is being proxied by back-ldap.
513 This directive is obsoleted by the
514 .B binddn
515 arg of
516 .BR idassert-bind
517 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
518
519 .TP
520 .B idassert-passwd <password>
521 Password used with the
522 .B idassert-authcDN
523 above.
524 This directive is obsoleted by the
525 .B crendentials
526 arg of
527 .B idassert-bind
528 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
529
530 .TP
531 .B idassert-mode <mode> [<flags>]
532 defines what type of
533 .I identity assertion
534 is used.
535 This directive is obsoleted by the
536 .B mode
537 arg of 
538 .BR idassert-bind ,
539 and will be dismissed in the future.
540
541 .TP
542 .B idassert-method <method> [<saslargs>]
543 This directive is obsoleted by the
544 .B bindmethod
545 arg of
546 .BR idassert-bind ,
547 and will be dismissed in the future.
548
549 .TP
550 .B port <port>
551 this directive is no longer supported.  Use the 
552 .B uri
553 directive as described above.
554
555 .TP
556 .B server <hostname[:port]>
557 this directive is no longer supported.  Use the 
558 .B uri
559 directive as described above.
560
561 .TP
562 .B suffixmassage, map, rewrite*
563 These directives are no longer supported by back-ldap; their 
564 functionality is now delegated to the
565 .B rwm
566 overlay.  Essentially, add a statement
567
568 .B overlay rwm
569
570 first, and prefix all rewrite/map statements with
571 .B rwm-
572 to obtain the original behavior.
573 See
574 .BR slapo-rwm (5)
575 for details.
576 .\" However, to ease update from existing configurations, back-ldap still 
577 .\" recognizes them and automatically instantiates the
578 .\" .B rwm
579 .\" overlay if available and not instantiated yet.
580 .\" This behavior may change in the future.
581
582 .SH ACCESS CONTROL
583 The
584 .B ldap
585 backend does not honor all ACL semantics as described in
586 .BR slapd.access (5).
587 In general, access checking is delegated to the remote server(s).
588 Only
589 .B read (=r)
590 access to the
591 .B entry
592 pseudo-attribute and to the other attribute values of the entries
593 returned by the
594 .B search
595 operation is honored, which is performed by the frontend.
596
597 .SH OVERLAYS
598 The LDAP backend provides basic proxying functionalities to many overlays.
599 The 
600 .B chain
601 overlay, described in
602 .BR slapo\-chain (5),
603 and the
604 .B translucent
605 overlay, described in
606 .BR slapo\-translucent (5),
607 deserve a special mention.
608
609 Conversely, there are many overlays that are best used in conjunction
610 with the LDAP backend.
611 The
612 .B proxycache 
613 overlay allows caching of LDAP search requests (queries) 
614 in a local database.
615 See 
616 .BR slapo\-pcache (5)
617 for details.
618 The
619 .B rwm
620 overlay provides DN rewrite and attribute/objectClass mapping
621 capabilities to the underlying database.
622 See 
623 .BR slapo\-rwm (5)
624 for details.
625
626 .SH FILES
627 .TP
628 ETCDIR/slapd.conf
629 default slapd configuration file
630 .SH SEE ALSO
631 .BR slapd.conf (5),
632 .BR slapd\-meta (5),
633 .BR slapo\-chain (5),
634 .BR slapo\-pcache (5),
635 .BR slapo\-rwm (5),
636 .BR slapo\-translucent (5),
637 .BR slapd (8),
638 .BR ldap (3).
639 .SH AUTHOR
640 Howard Chu, with enhancements by Pierangelo Masarati