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