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