]> git.sur5r.net Git - openldap/blob - doc/guide/admin/slapdconfig.sdf
(ITS#5479) Pasword Policy docs from Symas
[openldap] / doc / guide / admin / slapdconfig.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2008 The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: The slapd Configuration File
6
7 Once the software has been built and installed, you are ready
8 to configure {{slapd}}(8) for use at your site. The slapd
9 runtime configuration is primarily accomplished through the
10 {{slapd.conf}}(5) file, normally installed in the
11 {{EX:/usr/local/etc/openldap}} directory.
12
13 An alternate configuration file location can be specified via a command-line
14 option to {{slapd}}(8). This chapter describes the general format
15 of the {{slapd.conf}}(5) configuration file, followed by a detailed
16 description of commonly used config file directives.
17
18
19 H2: Configuration File Format
20
21 The {{slapd.conf}}(5) file consists of three types of configuration
22 information: global, backend specific, and database specific.  Global
23 information is specified first, followed by information associated
24 with a particular backend type, which is then followed by information
25 associated with a particular database instance.  Global directives can
26 be overridden in backend and/or database directives, and backend directives
27 can be overridden by database directives.
28
29 Blank lines and comment lines beginning with a '{{EX:#}}' character
30 are ignored.  If a line begins with white space, it is considered a
31 continuation of the previous line (even if the previous line is a
32 comment).
33
34 The general format of slapd.conf is as follows:
35
36 >       # global configuration directives
37 >       <global config directives>
38 >
39 >       # backend definition
40 >       backend <typeA>
41 >       <backend-specific directives>
42 >
43 >       # first database definition & config directives
44 >       database <typeA>
45 >       <database-specific directives>
46 >
47 >       # second database definition & config directives
48 >       database <typeB>
49 >       <database-specific directives>
50 >
51 >       # second database definition & config directives
52 >       database <typeA>
53 >       <database-specific directives>
54 >
55 >       # subsequent backend & database definitions & config directives
56 >       ...
57
58 A configuration directive may take arguments.  If so, they are
59 separated by white space.  If an argument contains white space,
60 the argument should be enclosed in double quotes {{EX:"like this"}}. If
61 an argument contains a double quote or a backslash character `{{EX:\}}',
62 the character should be preceded by a backslash character `{{EX:\}}'.
63
64 The distribution contains an example configuration file that will
65 be installed in the {{F: /usr/local/etc/openldap}} directory.
66 A number of files containing schema definitions (attribute types
67 and object classes) are also provided in the
68 {{F: /usr/local/etc/openldap/schema}} directory.
69
70
71 H2: Configuration File Directives
72
73 This section details commonly used configuration directives.  For
74 a complete list, see the {{slapd.conf}}(5) manual page.  This section
75 separates the configuration file directives into global,
76 backend-specific and data-specific categories, describing each
77 directive and its default value (if any), and giving an example of
78 its use.
79
80
81
82 H3: Global Directives
83
84 Directives described in this section apply to all backends
85 and databases unless specifically overridden in a backend or
86 database definition.  Arguments that should be replaced
87 by actual text are shown in brackets {{EX:<>}}.
88
89
90 H4: access to <what> [ by <who> [<accesslevel>] [<control>] ]+
91
92 This directive grants access (specified by <accesslevel>) to a set
93 of entries and/or attributes (specified by <what>) by one or more
94 requestors (specified by <who>).  See the {{SECT:Access Control}} section of 
95 this guide for basic usage.
96
97 !if 0
98 More details discussion of this directive can be found in the
99 {{SECT:Advanced Access Control}} chapter.
100 !endif
101
102 Note: If no {{EX:access}} directives are specified, the default
103 access control policy, {{EX:access to * by * read}}, allows all
104 both authenticated and anonymous users read access.
105
106
107 H4: attributetype <{{REF:RFC4512}} Attribute Type Description>
108
109 This directive defines an attribute type.
110 Please see the {{SECT:Schema Specification}} chapter
111 for information regarding how to use this directive.
112
113 H4: idletimeout <integer>
114
115 Specify the number of seconds to wait before forcibly closing
116 an idle client connection.  An idletimeout of 0, the default,
117 disables this feature.
118
119
120 H4: include <filename>
121
122 This directive specifies that slapd should read additional
123 configuration information from the given file before continuing
124 with the next line of the current file. The included file should
125 follow the normal slapd config file format.  The file is commonly
126 used to include files containing schema specifications.
127
128 Note: You should be careful when using this directive - there is
129 no small limit on the number of nested include directives, and no
130 loop detection is done.
131
132 H4: loglevel <integer>
133
134 This directive specifies the level at which debugging statements
135 and operation statistics should be syslogged (currently logged to
136 the {{syslogd}}(8) {{EX:LOG_LOCAL4}} facility). You must have
137 configured OpenLDAP {{EX:--enable-debug}} (the default) for this
138 to work (except for the two statistics levels, which are always
139 enabled).  Log levels are additive. To display what numbers
140 correspond to what kind of debugging, invoke slapd with {{EX:-?}}
141 or consult the table below. The possible values for <integer> are:
142
143 !block table; colaligns="RL"; align=Center; \
144         title="Table 6.1: Debugging Levels"
145 Level   Description
146 -1      enable all debugging
147 0       no debugging
148 1       trace function calls
149 2       debug packet handling
150 4       heavy trace debugging
151 8       connection management
152 16      print out packets sent and received
153 32      search filter processing
154 64      configuration file processing
155 128     access control list processing
156 256     stats log connections/operations/results
157 512     stats log entries sent
158 1024    print communication with shell backends
159 2048    print entry parsing debugging
160 !endblock
161
162 \Example:
163
164 E: loglevel -1
165
166 This will cause lots and lots of debugging information to be
167 logged.
168
169 \Default:
170
171 E: loglevel 256
172
173
174 H4: objectclass <{{REF:RFC4512}} Object Class Description>
175
176 This directive defines an object class.
177 Please see the {{SECT:Schema Specification}} chapter for
178 information regarding how to use this directive.
179
180
181 H4: referral <URI>
182
183 This directive specifies the referral to pass back when slapd
184 cannot find a local database to handle a request.
185
186 \Example:
187
188 >       referral ldap://root.openldap.org
189
190 This will refer non-local queries to the global root LDAP server
191 at the OpenLDAP Project. Smart LDAP clients can re-ask their
192 query at that server, but note that most of these clients are
193 only going to know how to handle simple LDAP URLs that
194 contain a host part and optionally a distinguished name part.
195
196
197 H4: sizelimit <integer>
198
199 This directive specifies the maximum number of entries to return
200 from a search operation.
201
202 \Default:
203
204 >       sizelimit 500
205
206
207 H4: timelimit <integer>
208
209 This directive specifies the maximum number of seconds (in real
210 time) slapd will spend answering a search request. If a
211 request is not finished in this time, a result indicating an
212 exceeded timelimit will be returned.
213
214 \Default:
215
216 >       timelimit 3600
217
218
219 H3: General Backend Directives
220
221 Directives in this section apply only to the backend in which
222 they are defined. They are supported by every type of backend.
223 Backend directives apply to all databases instances of the
224 same type and, depending on the directive, may be overridden
225 by database directives.
226
227 H4: backend <type>
228
229 This directive marks the beginning of a backend declaration.
230 {{EX:<type>}} should be one of the
231 supported backend types listed in Table 6.2.
232
233 !block table; align=Center; coltags="EX,N"; \
234         title="Table 5.2: Database Backends"
235 Types   Description
236 bdb     Berkeley DB transactional backend
237 dnssrv  DNS SRV backend
238 hdb     Hierarchical variant of bdb backend
239 ldap    Lightweight Directory Access Protocol (Proxy) backend
240 meta    Meta Directory backend
241 monitor Monitor backend
242 passwd  Provides read-only access to {{passwd}}(5)
243 perl    Perl Programmable backend
244 shell   Shell (extern program) backend
245 sql     SQL Programmable backend
246 !endblock
247
248 \Example:
249
250 >       backend bdb
251
252 This marks the beginning of a new {{TERM:BDB}} backend
253 definition.
254
255
256 H3: General Database Directives
257
258 Directives in this section apply only to the database in which
259 they are defined. They are supported by every type of database.
260
261 H4: database <type>
262
263 This directive marks the beginning of a database instance
264 declaration.
265 {{EX:<type>}} should be one of the
266 supported backend types listed in Table 6.2.
267
268 \Example:
269
270 >       database bdb
271
272 This marks the beginning of a new {{TERM:BDB}} database instance
273 declaration.
274
275
276 H4: readonly { on | off }
277
278 This directive puts the database into "read-only" mode. Any
279 attempts to modify the database will return an "unwilling to
280 perform" error.
281
282 \Default:
283
284 >       readonly off
285
286
287 H4: rootdn <DN>
288
289 This directive specifies the DN that is not subject to
290 access control or administrative limit restrictions for
291 operations on this database.  The DN need not refer to
292 an entry in this database or even in the directory. The
293 DN may refer to a SASL identity.
294
295 Entry-based Example:
296
297 >       rootdn "cn=Manager,dc=example,dc=com"
298
299 SASL-based Example:
300
301 >       rootdn "uid=root,cn=example.com,cn=digest-md5,cn=auth"
302
303 See the {{SECT:SASL Authentication}} section for information on
304 SASL authentication identities.
305
306
307 H4: rootpw <password>
308
309 This directive can be used to specifies a password for the DN for
310 the rootdn (when the rootdn is set to a DN within the database).
311
312 \Example:
313
314 >       rootpw secret
315
316 It is also permissible to provide hash of the password in {{REF:RFC2307}}
317 form.  {{slappasswd}}(8) may be used to generate the password hash.
318
319 \Example:
320
321 >       rootpw {SSHA}ZKKuqbEKJfKSXhUbHG3fG8MDn9j1v4QN
322
323 The hash was generated using the command {{EX:slappasswd -s secret}}.
324
325
326 H4: suffix <dn suffix>
327
328 This directive specifies the DN suffix of queries that will be
329 passed to this backend database. Multiple suffix lines can be
330 given, and at least one is required for each database
331 definition.
332
333 \Example:
334
335 >       suffix "dc=example,dc=com"
336
337 Queries with a DN ending in "dc=example,dc=com"
338 will be passed to this backend.
339
340 Note: When the backend to pass a query to is selected, slapd
341 looks at the suffix line(s) in each database definition in the
342 order they appear in the file. Thus, if one database suffix is a
343 prefix of another, it must appear after it in the config file.
344
345
346 H4: syncrepl
347
348 >       syncrepl rid=<replica ID>
349 >               provider=ldap[s]://<hostname>[:port]
350 >               [type=refreshOnly|refreshAndPersist]
351 >               [interval=dd:hh:mm:ss]
352 >               [retry=[<retry interval> <# of retries>]+]
353 >               searchbase=<base DN>
354 >               [filter=<filter str>]
355 >               [scope=sub|one|base]
356 >               [attrs=<attr list>]
357 >               [attrsonly]
358 >               [sizelimit=<limit>]
359 >               [timelimit=<limit>]
360 >               [schemachecking=on|off]
361 >               [bindmethod=simple|sasl]
362 >               [binddn=<DN>]
363 >               [saslmech=<mech>]
364 >               [authcid=<identity>]
365 >               [authzid=<identity>]
366 >               [credentials=<passwd>]
367 >               [realm=<realm>]
368 >               [secprops=<properties>]
369 >               [starttls=yes|critical]
370 >               [tls_cert=<file>]
371 >               [tls_key=<file>]
372 >               [tls_cacert=<file>]
373 >               [tls_cacertdir=<path>]
374 >               [tls_reqcert=never|allow|try|demand]
375 >               [tls_ciphersuite=<ciphers>]
376 >               [tls_crlcheck=none|peer|all]
377 >               [logbase=<base DN>]
378 >               [logfilter=<filter str>]
379 >               [syncdata=default|accesslog|changelog]
380
381
382 This directive specifies the current database as a replica of the
383 master content by establishing the current {{slapd}}(8) as a
384 replication consumer site running a syncrepl replication engine.
385 The master database is located at the replication provider site
386 specified by the {{EX:provider}} parameter. The replica database is
387 kept up-to-date with the master content using the LDAP Content
388 Synchronization protocol. See {{REF:RFC4533}}
389 for more information on the protocol.
390
391 The {{EX:rid}} parameter is used for identification of the current
392 {{EX:syncrepl}} directive within the replication consumer server,
393 where {{EX:<replica ID>}} uniquely identifies the syncrepl specification
394 described by the current {{EX:syncrepl}} directive. {{EX:<replica ID>}}
395 is non-negative and is no more than three decimal digits in length.
396
397 The {{EX:provider}} parameter specifies the replication provider site
398 containing the master content as an LDAP URI. The {{EX:provider}}
399 parameter specifies a scheme, a host and optionally a port where the
400 provider slapd instance can be found. Either a domain name or IP
401 address may be used for <hostname>. Examples are
402 {{EX:ldap://provider.example.com:389}} or {{EX:ldaps://192.168.1.1:636}}.
403 If <port> is not given, the standard LDAP port number (389 or 636) is used.
404 Note that the syncrepl uses a consumer-initiated protocol, and hence its
405 specification is located at the consumer site, whereas the {{EX:replica}}
406 specification is located at the provider site. {{EX:syncrepl}} and
407 {{EX:replica}} directives define two independent replication
408 mechanisms. They do not represent the replication peers of each other.
409
410 The content of the syncrepl replica is defined using a search
411 specification as its result set. The consumer slapd will
412 send search requests to the provider slapd according to the search
413 specification. The search specification includes {{EX:searchbase}},
414 {{EX:scope}}, {{EX:filter}}, {{EX:attrs}}, {{EX:attrsonly}},
415 {{EX:sizelimit}}, and {{EX:timelimit}} parameters as in the normal
416 search specification. The {{EX:searchbase}} parameter has no
417 default value and must always be specified. The {{EX:scope}} defaults
418 to {{EX:sub}}, the {{EX:filter}} defaults to {{EX:(objectclass=*)}},
419 {{EX:attrs}} defaults to {{EX:"*,+"}} to replicate all user and operational
420 attributes, and {{EX:attrsonly}} is unset by default. Both {{EX:sizelimit}}
421 and {{EX:timelimit}} default to "unlimited", and only positive integers
422 or "unlimited" may be specified.
423
424 The {{TERM[expand]LDAP Sync}} protocol has two operation
425 types: {{EX:refreshOnly}} and {{EX:refreshAndPersist}}.
426 The operation type is specified by the {{EX:type}} parameter.
427 In the {{EX:refreshOnly}} operation, the next synchronization search operation
428 is periodically rescheduled at an interval time after each
429 synchronization operation finishes. The interval is specified
430 by the {{EX:interval}} parameter. It is set to one day by default.
431 In the {{EX:refreshAndPersist}} operation, a synchronization search
432 remains persistent in the provider {{slapd}} instance. Further updates to the
433 master replica will generate {{EX:searchResultEntry}} to the consumer slapd
434 as the search responses to the persistent synchronization search.
435
436 If an error occurs during replication, the consumer will attempt to reconnect
437 according to the retry parameter which is a list of the <retry interval>
438 and <# of retries> pairs. For example, retry="60 10 300 3" lets the consumer
439 retry every 60 seconds for the first 10 times and then retry every 300 seconds
440 for the next three times before stop retrying. + in <#  of retries> means
441 indefinite number of retries until success.
442
443 The schema checking can be enforced at the LDAP Sync consumer site
444 by turning on the {{EX:schemachecking}} parameter.
445 If it is turned on, every replicated entry will be checked for its
446 schema as the entry is stored into the replica content.
447 Every entry in the replica should contain those attributes
448 required by the schema definition.
449 If it is turned off, entries will be stored without checking
450 schema conformance. The default is off.
451
452 The {{EX:binddn}} parameter gives the DN to bind as for the
453 syncrepl searches to the provider slapd. It should be a DN
454 which has read access to the replication content in the
455 master database. 
456
457 The {{EX:bindmethod}} is {{EX:simple}} or {{EX:sasl}},
458 depending on whether simple password-based authentication or
459 {{TERM:SASL}} authentication is to be used when connecting
460 to the provider {{slapd}} instance.
461
462 Simple authentication should not be used unless adequate data
463 integrity and confidentiality protections are in place (e.g. TLS
464 or IPsec). Simple authentication requires specification of {{EX:binddn}}
465 and {{EX:credentials}} parameters.
466
467 SASL authentication is generally recommended.  SASL authentication
468 requires specification of a mechanism using the {{EX:saslmech}} parameter.
469 Depending on the mechanism, an authentication identity and/or
470 credentials can be specified using {{EX:authcid}} and {{EX:credentials}},
471 respectively.  The {{EX:authzid}} parameter may be used to specify
472 an authorization identity.
473
474 The {{EX:realm}} parameter specifies a realm which a certain
475 mechanisms authenticate the identity within. The {{EX:secprops}}
476 parameter specifies Cyrus SASL security properties.
477
478 The {{EX:starttls}} parameter specifies use of the StartTLS extended
479 operation to establish a TLS session before authenticating to the provider.
480 If the {{EX:critical}} argument is supplied, the session will be aborted
481 if the StartTLS request fails.  Otherwise the syncrepl session continues
482 without TLS.  Note that the main slapd TLS settings are not used by the
483 syncrepl engine; by default the TLS parameters from a {{ldap.conf}}(5)
484 configuration file will be used.  TLS settings may be specified here,
485 in which case any {{ldap.conf}}(5) settings will be completely ignored.
486
487 Rather than replicating whole entries, the consumer can query logs
488 of data modifications.  This mode of operation is referred to as
489 {{delta syncrepl}}.  In addition to the above parameters, the
490 {{EX:logbase}} and {{EX:logfilter}} parameters must be set appropriately
491 for the log that will be used. The {{EX:syncdata}} parameter must
492 be set to either {{EX:"accesslog"}} if the log conforms to the
493 {{slapo-accesslog}}(5) log format, or {{EX:"changelog"}} if the log
494 conforms to the obsolete {{changelog}} format. If the {{EX:syncdata}}
495 parameter is omitted or set to {{EX:"default"}} then the log
496 parameters are ignored.
497
498 The {{syncrepl}} replication mechanism is supported by the {{bdb}} and
499 {{hdb}} backends.
500
501 See the {{SECT:LDAP Sync Replication}} chapter of this guide for
502 more information on how to use this directive.
503
504
505 H4: updateref <URL>
506
507 This directive is only applicable in a {{slave}} (or {{shadow}})
508 {{slapd}}(8) instance. It
509 specifies the URL to return to clients which submit update
510 requests upon the replica.
511 If specified multiple times, each {{TERM:URL}} is provided.
512
513 \Example:
514
515 >       updateref       ldap://master.example.net
516
517
518 H3: BDB and HDB Database Directives
519
520 Directives in this category only apply to both the {{TERM:BDB}}
521 and the {{TERM:HDB}} database.
522 That is, they must follow a "database bdb" or "database hdb" line
523 and come before any
524 subsequent "backend" or "database" line.  For a complete reference
525 of BDB/HDB configuration directives, see {{slapd-bdb}}(5).
526
527
528 H4: directory <directory>
529
530 This directive specifies the directory where the BDB files
531 containing the database and associated indices live.
532
533 \Default:
534
535 >       directory /usr/local/var/openldap-data