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