]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-ldap.5
Sync with HEAD
[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 protocol\-version {0,2,3}
352 This directive indicates what protocol version must be used to contact
353 the remote server.
354 If set to 0 (the default), the proxy uses the same protocol version 
355 used by the client, otherwise the requested protocol is used.
356 The proxy returns \fIunwillingToPerform\fP if an operation that is 
357 incompatible with the requested protocol is attempted.
358
359 .TP
360 .B proxy\-whoami {NO|yes}
361 Turns on proxying of the WhoAmI extended operation. If this option is
362 given, back-ldap will replace slapd's original WhoAmI routine with its
363 own. On slapd sessions that were authenticated by back-ldap, the WhoAmI
364 request will be forwarded to the remote LDAP server. Other sessions will
365 be handled by the local slapd, as before. This option is mainly useful
366 in conjunction with Proxy Authorization.
367
368 .TP
369 .B quarantine <interval>,<num>[;<interval>,<num>[...]]
370 Turns on quarantine of URIs that returned
371 .IR LDAP_UNAVAILABLE ,
372 so that an attempt to reconnect only occurs at given intervals instead
373 of any time a client requests an operation.
374 The pattern is: retry only after at least
375 .I interval
376 seconds elapsed since last attempt, for exactly
377 .I num
378 times; then use the next pattern.
379 If
380 .I num
381 for the last pattern is "\fB+\fP", it retries forever; otherwise, 
382 no more retries occur.
383 The process can be restarted by resetting the \fIolcDbQuarantine\fP
384 attribute of the database entry in the configuration backend.
385
386 .TP
387 .B rebind-as-user {NO|yes}
388 If this option is given, the client's bind credentials are remembered
389 for rebinds when chasing referrals.  Useful when
390 \fBchase-referrals\fP is set to \fByes\fP, useless otherwise.
391
392 .TP
393 .B single\-conn {NO|yes}
394 Discards current cached connection when the client rebinds.
395
396 .TP
397 .B t-f-support {NO|yes|discover}
398 enable if the remote server supports absolute filters
399 (see \fIdraft-zeilenga-ldap-t-f\fP for details).
400 If set to
401 .BR discover ,
402 support is detected by reading the remote server's root DSE.
403
404 .TP
405 .B timeout [<op>=]<val> [...]
406 This directive allows to set per-operation timeouts.
407 Operations can be
408
409 \fB<op> ::= bind, add, delete, modrdn, modify, compare\fP
410
411 The \fBsearch\fP operation is already controlled either
412 by the \fBtimelimit\fP parameter or by server-side enforced
413 time limits (see \fBtimelimit\fP and \fBlimits\fP in
414 .BR slapd.conf (5)
415 for details).
416 Timeout is meaningless for the remaining operations,
417 \fBunbind\fP and \fBabandon\fP, which do not imply any response,
418 while it is not yet implemented in currently supported \fBextended\fP 
419 operations.
420 If no operation is specified, the timeout \fBval\fP affects all
421 supported operations.
422
423 Note: if the timelimit is exceeded, the operation is cancelled
424 (according to the \fBcancel\fP directive);
425 the protocol does not provide any means to rollback operations,
426 so the client will not be notified about the result of the operation,
427 which may eventually succeeded or not.
428 In case the timeout is exceeded during a bind operation, the connection
429 is destroyed, according to RFC4511.
430
431 Note: in some cases, this backend may issue binds prior
432 to other operations (e.g. to bind anonymously or with some prescribed
433 identity according to the \fBidassert-bind\fP directive).
434 In this case, the timeout of the operation that resulted in the bind
435 is used.
436
437 .TP
438 .B tls {[try-]start|[try-]propagate}
439 execute the StartTLS extended operation when the connection is initialized;
440 only works if the URI directive protocol scheme is not \fBldaps://\fP.
441 \fBpropagate\fP issues the StartTLS operation only if the original
442 connection did.
443 The \fBtry-\fP prefix instructs the proxy to continue operations
444 if the StartTLS operation failed; its use is \fBnot\fP recommended.
445
446 .SH BACKWARD COMPATIBILITY
447 The LDAP backend has been heavily reworked between releases 2.2 and 2.3,
448 and subsequently between 2.3 and 2.4.
449 As a side-effect, some of the traditional directives have been
450 deprecated and should be no longer used, as they might disappear
451 in future releases.
452
453 .TP
454 .B acl-authcDN "<administrative DN for access control purposes>"
455 Formerly known as the
456 .BR binddn ,
457 it is the DN that is used to query the target server for acl checking;
458 it is supposed to have read access on the target server to attributes used
459 on the proxy for acl checking.
460 There is no risk of giving away such values; they are only used to
461 check permissions.
462
463 .B The acl-authcDN identity is by no means implicitly used by the proxy 
464 .B when the client connects anonymously.
465 The
466 .B idassert-*
467 feature can be used (at own risk) for that purpose instead.
468
469 This directive is obsoleted by the
470 .B binddn
471 arg of
472 .B acl-bind
473 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
474
475 .TP
476 .B acl-passwd <password>
477 Formerly known as the
478 .BR bindpw ,
479 it is the password used with the above
480 .B acl-authcDN
481 directive.
482 This directive is obsoleted by the
483 .B credentials
484 arg of
485 .B acl-bind
486 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
487
488 .TP
489 .B idassert-authcDN "<administrative DN for proxyAuthz purposes>"
490 DN which is used to propagate the client's identity to the target
491 by means of the proxyAuthz control when the client does not
492 belong to the DIT fragment that is being proxied by back-ldap.
493 This directive is obsoleted by the
494 .B binddn
495 arg of
496 .BR idassert-bind
497 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
498
499 .TP
500 .B idassert-passwd <password>
501 Password used with the
502 .B idassert-authcDN
503 above.
504 This directive is obsoleted by the
505 .B crendentials
506 arg of
507 .B idassert-bind
508 when \fIbindmethod\fP=\fBsimple\fP, and will be dismissed in the future.
509
510 .TP
511 .B idassert-mode <mode> [<flags>]
512 defines what type of
513 .I identity assertion
514 is used.
515 This directive is obsoleted by the
516 .B mode
517 arg of 
518 .BR idassert-bind ,
519 and will be dismissed in the future.
520
521 .TP
522 .B idassert-method <method> [<saslargs>]
523 This directive is obsoleted by the
524 .B bindmethod
525 arg of
526 .BR idassert-bind ,
527 and will be dismissed in the future.
528
529 .TP
530 .B port <port>
531 this directive is no longer supported.  Use the 
532 .B uri
533 directive as described above.
534
535 .TP
536 .B server <hostname[:port]>
537 this directive is no longer supported.  Use the 
538 .B uri
539 directive as described above.
540
541 .TP
542 .B suffixmassage, map, rewrite*
543 These directives are no longer supported by back-ldap; their 
544 functionality is now delegated to the
545 .B rwm
546 overlay.  Essentially, add a statement
547
548 .B overlay rwm
549
550 first, and prefix all rewrite/map statements with
551 .B rwm-
552 to obtain the original behavior.
553 See
554 .BR slapo-rwm (5)
555 for details.
556 .\" However, to ease update from existing configurations, back-ldap still 
557 .\" recognizes them and automatically instantiates the
558 .\" .B rwm
559 .\" overlay if available and not instantiated yet.
560 .\" This behavior may change in the future.
561
562 .SH ACCESS CONTROL
563 The
564 .B ldap
565 backend does not honor all ACL semantics as described in
566 .BR slapd.access (5).
567 In general, access checking is delegated to the remote server(s).
568 Only
569 .B read (=r)
570 access to the
571 .B entry
572 pseudo-attribute and to the other attribute values of the entries
573 returned by the
574 .B search
575 operation is honored, which is performed by the frontend.
576
577 .SH OVERLAYS
578 The LDAP backend provides basic proxying functionalities to many overlays.
579 The 
580 .B chain
581 overlay, described in
582 .BR slapo\-chain (5),
583 and the
584 .B translucent
585 overlay, described in
586 .BR slapo\-translucent (5),
587 deserve a special mention.
588
589 Conversely, there are many overlays that are best used in conjunction
590 with the LDAP backend.
591 The
592 .B proxycache 
593 overlay allows caching of LDAP search requests (queries) 
594 in a local database.
595 See 
596 .BR slapo\-pcache (5)
597 for details.
598 The
599 .B rwm
600 overlay provides DN rewrite and attribute/objectClass mapping
601 capabilities to the underlying database.
602 See 
603 .BR slapo\-rwm (5)
604 for details.
605
606 .SH FILES
607 .TP
608 ETCDIR/slapd.conf
609 default slapd configuration file
610 .SH SEE ALSO
611 .BR slapd.conf (5),
612 .BR slapd\-meta (5),
613 .BR slapo\-chain (5),
614 .BR slapo\-pcache (5),
615 .BR slapo\-rwm (5),
616 .BR slapo\-translucent (5),
617 .BR slapd (8),
618 .BR ldap (3).
619 .SH AUTHOR
620 Howard Chu, with enhancements by Pierangelo Masarati