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