]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
e1496e29f2286008d7ec13213639b3665008b374
[openldap] / doc / man / man5 / slapd.access.5
1 .TH SLAPD.ACCESS 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2003 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .SH NAME
5 slapd.access \- access configuration for slapd, the stand-alone LDAP daemon
6 .SH SYNOPSIS
7 ETCDIR/slapd.conf
8 .SH DESCRIPTION
9 The 
10 .BR slapd.conf (5)
11 file contains configuration information for the
12 .BR slapd (8)
13 daemon. This configuration file is also used by the
14 .BR slurpd (8)
15 replication daemon and by the SLAPD tools
16 .BR slapadd (8),
17 .BR slapcat (8),
18 and
19 .BR slapindex (8).
20 .LP
21 The
22 .B slapd.conf
23 file consists of a series of global configuration options that apply to
24 .B slapd
25 as a whole (including all backends), followed by zero or more database
26 backend definitions that contain information specific to a backend
27 instance.
28 .LP
29 The general format of
30 .B slapd.conf
31 is as follows:
32 .LP
33 .nf
34     # comment - these options apply to every database
35     <global configuration options>
36     # first database definition & configuration options
37     database    <backend 1 type>
38     <configuration options specific to backend 1>
39     # subsequent database definitions & configuration options
40     ...
41 .fi
42 .LP
43 Both the global configuration and each backend-specific section can
44 contain access information.  Backend-specific access control
45 directives are used for those entries that belong to the backend,
46 according to their naming context.  In case no access control
47 directives are defined for a backend or those which are defined are
48 not applicable, the directives from the global configuration section
49 are then used.
50 .LP
51 For entries not held in any backend (such as a root DSE), the
52 directives of the first backend (and any global directives) are
53 used.
54 .LP
55 Arguments that should be replaced by actual text are shown in
56 brackets <>.
57 .SH THE ACCESS DIRECTIVE
58 The structure of the access control directives is
59 .TP
60 .B access to <what> "[ by <who> <access> [ <control> ] ]+"
61 Grant access (specified by 
62 .BR <access> ) 
63 to a set of entries and/or attributes (specified by 
64 .BR <what> ) 
65 by one or more requestors (specified by 
66 .BR <who> ).
67 .SH THE <WHAT> FIELD
68 The field
69 .BR <what>
70 specifies the entity the access control directive applies to.
71 It can have the forms
72 .LP
73 .nf
74         *
75         [dn[.<dnstyle>]=<DN>] 
76         [filter=<ldapfilter>]
77         [attrs=<attrlist>[ val[.<style>]=<attrval>]]
78 .fi
79 .LP
80 The wildcard
81 .B *
82 stands for all the entries.
83 .LP
84 The statement
85 .B dn=<DN>
86 selects the entries based on their naming context.
87 The pattern is a string representation of the entry's DN.
88 .BR base ,
89 the default,
90 or
91 .B exact 
92 (an alias of 
93 .BR base )
94 indicates the entry whose DN is equal to the pattern.
95 .B one
96 indicates all the entries immediately below the
97 .BR pattern ,
98 .B subtree
99 indicates all entries in the subtree at the pattern,
100 .B children
101 indicates all the entries below (subordinate to) the pattern.
102 .LP
103 If the
104 .B <dnstyle>
105 qualifier is
106 .BR regex ,
107 then the value is a regular expression pattern,
108 as detailed in
109 .BR regex (7),
110 matching a normalized string representation of the entry's DN.
111 The regex form of the pattern does not (yet) support UTF-8.
112 .LP
113 The statement
114 .B filter=<ldapfilter>
115 selects the entries based on a valid LDAP filter as described in RFC 2254.
116 .LP
117 The statement
118 .B attrs=<attrlist>
119 selects the attributes the access control rule applies to.
120 It is a comma-separated list of attribute types, plus the special names
121 .BR entry ,
122 indicating access to the entry itself, and
123 .BR children ,
124 indicating access to the entry's children. ObjectClass names may also
125 be specified in this list, which will affect all the attributes that
126 are required and/or allowed by that objectClass.
127 Actually, names in 
128 .B <attrlist>
129 that are prefixed by
130 .B +
131 are directly treated as objectClass names, while names that 
132 do not correspond to an attribute type are also searched 
133 in the objectclass set.
134 This latter behavior is deprecated and might not be supported
135 in future releases.
136 A name prefixed by
137 .B !
138 is also treated as an objectClass, but in this case the access rule
139 affects the attributes that are not required nor allowed 
140 by that objectClass.
141 .LP
142 Using the form
143 .B attrs=<attr> val[.<style>]=<value>
144 specifies access to a particular value of a single attribute.
145 In this case, only a single attribute type may be given. A value
146 .B <style>
147 of
148 .B exact
149 (the default) uses the attribute's equality matching rule to compare the
150 value. If the value
151 .B <style>
152 is
153 .BR regex ,
154 the provided value is used as a regular expression pattern.
155 If the attribute has DN syntax, the value
156 .B <style>
157 can be any of
158 .BR base ,
159 .BR onelevel ,
160 .B subtree
161 or
162 .BR children ,
163 resulting in base, onelevel, subtree or children match, respectively.
164 .LP
165 The dn, filter, and attrs statements are additive; they can be used in sequence 
166 to select entities the access rule applies to based on naming context,
167 value and attribute type simultaneously.
168 .SH THE <WHO> FIELD
169 The field
170 .B <who>
171 indicates whom the access rules apply to.
172 Multiple 
173 .B <who>
174 statements can appear in an access control statement, indicating the
175 different access privileges to the same resource that apply to different
176 accessee.
177 It can have the forms
178 .LP
179 .nf
180         *
181         anonymous
182         users
183         self
184
185         dn[.<dnstyle>[,<modifier>]]=<DN>
186         dnattr=<attrname>
187         group[/<objectclass>[/<attrname>]]
188                 [.<style>]=<group>
189         peername[.<style>]=<peername>
190         sockname[.<style>]=<sockname>
191         domain[.<domainstyle>[,<modifier>]]=<domain>
192         sockurl[.<style>]=<sockurl>
193         set[.<style>]=<pattern>
194
195         ssf=<n>
196         transport_ssf=<n>
197         tls_ssf=<n>
198         sasl_ssf=<n>
199
200         aci=<attrname>
201 .fi
202 .LP
203 They may be specified in combination.
204 .LP
205 .nf
206 .fi
207 .LP
208 The wildcard
209 .B *
210 refers to everybody.
211 .LP
212 The keyword
213 .B anonymous
214 means access is granted to unauthenticated clients; it is mostly used 
215 to limit access to authentication resources (e.g. the
216 .B userPassword
217 attribute) to unauthenticated clients for authentication purposes.
218 .LP
219 The keyword
220 .B users
221 means access is granted to authenticated clients.
222 .LP
223 The keyword
224 .B self
225 means access to an entry is allowed to the entry itself (e.g. the entry
226 being accessed and the requesting entry must be the same).
227 .LP
228 The statement
229 .B dn=<DN>
230 means that access is granted to the matching DN.
231 The optional style qualifier
232 .B dnstyle
233 allows the same choices of the dn form of the
234 .B <what>
235 field.  In addition, the
236 .B regex
237 style can exploit substring substitution of submatches in the
238 .B <what>
239 dn.regex clause by using the form
240 .BR $<digit> ,
241 with 
242 .B digit
243 ranging from 1 to 9.
244 The style qualifier
245 allows an optional
246 .BR modifier .
247 At present, the only type allowed is 
248 .BR expand ,
249 which causes substring substitution of submatches to take place
250 even if 
251 .B dnstyle
252 is not 
253 .BR regex .
254 .LP
255 The statement
256 .B dnattr=<attrname>
257 means that access is granted to requests whose DN is listed in the
258 entry being accessed under the 
259 .B <attrname>
260 attribute.
261 .LP
262 The statement
263 .B group=<group>
264 means that access is granted to requests whose DN is listed
265 in the group entry whose DN is given by
266 .BR <group> .
267 The optional parameters
268 .B <objectclass>
269 and
270 .B <attrname>
271 define the objectClass and the member attributeType of the group entry.
272 The optional style qualifier
273 .B <style>
274 can be
275 .BR regex ,
276 which means that
277 .B <group>
278 will be expanded as a replacement string (but not as a regular expression)
279 according to regex (7), and
280 .B base
281 or
282 .B exact
283 (an alias of
284 .BR base ),
285 which means that exact match will be used.
286 .LP
287 For static groups, the specified attributeType must have
288 .B DistinguishedName
289 or
290 .B NameAndOptionalUID
291 syntax. For dynamic groups the attributeType must
292 be a subtype of the
293 .B labeledURI
294 attributeType. Only LDAP URIs of the form
295 .B ldap:///<base>??<scope>?<filter>
296 will be evaluated in a dynamic group.
297 .LP
298 The statements
299 .BR peername=<peername> ,
300 .BR sockname=<sockname> ,
301 .BR domain=<domain> ,
302 and
303 .BR sockurl=<sockurl>
304 mean that the contacting host IP for
305 .BR peername ,
306 the named pipe file name for
307 .BR sockname ,
308 the contacting host name for
309 .BR domain ,
310 and the contacting URL for
311 .BR sockurl
312 are compared against
313 .B pattern
314 to determine access.
315 The same
316 .B style
317 rules for pattern match described for the
318 .B group
319 case apply. 
320 The
321 .BR domain 
322 clause also allows the
323 .B subtree
324 style, which succeeds when a fully qualified name exactly matches the
325 .BR domain
326 pattern, or its trailing part, after a 
327 .BR dot ,
328 exactly matches the 
329 .BR domain
330 pattern.
331 The
332 .B domain
333 of the contacting host is determined by performing a DNS reverse lookup.
334 As this lookup can easily be spoofed, use of the
335 .B domain
336 statement is strongly discouraged.  By default, reverse lookups are disabled.
337 The optional
338 .B domainstyle
339 qualifier of the
340 .B domain
341 clause allows a
342 .B modifier
343 option; the only value currently supported is
344 .BR expand ,
345 which causes substring substitution of submatches to take place even if
346 the 
347 .B domainstyle
348 is not 
349 .BR regex ,
350 much like the analogous usage in 
351 .B dn
352 clause.
353 .LP
354 The statement
355 .B set=<pattern>
356 is undocumented yet.
357 .LP
358 The statement
359 .B aci=<attrname>
360 means that the access control is determined by the values in the
361 .B attrname
362 of the entry itself.
363 ACIs are experimental; they must be enabled at compile time.
364 .LP
365 The statements
366 .BR ssf=<n> ,
367 .BR transport_ssf=<n> ,
368 .BR tls_ssf=<n> ,
369 and
370 .BR sasl_ssf=<n>
371 set the required Security Strength Factor (ssf) required to grant access.
372 .SH THE <ACCESS> FIELD
373 The field
374 .B <access> ::= [self]{<level>|<priv>}
375 determines the access level or the specific access privileges the
376 .B who 
377 field will have.
378 Its component are defined as
379 .LP
380 .nf
381         <level> ::= none|auth|compare|search|read|write
382         <priv> ::= {=|+|-}{w|r|s|c|x}+
383 .fi
384 .LP
385 The modifier
386 .B self
387 allows special operations like having a certain access level or privilege
388 only in case the operation involves the name of the user that's requesting
389 the access.
390 It implies the user that requests access is bound.
391 An example is the
392 .B selfwrite
393 access to the member attribute of a group, which allows one to add/delete
394 its own DN from the member list of a group, without affecting other members.
395 .LP
396 The 
397 .B level 
398 access model relies on an incremental interpretation of the access
399 privileges.
400 The possible levels are
401 .BR none ,
402 .BR auth ,
403 .BR compare ,
404 .BR search ,
405 .BR read ,
406 and
407 .BR write .
408 Each access level implies all the preceding ones, thus 
409 .B write
410 access will imply all accesses.
411 While
412 .B none
413 is trivial, 
414 .B auth
415 access means that one is allowed access to an attribute to perform
416 authentication/authorization operations (e.g.
417 .BR bind )
418 with no other access.
419 This is useful to grant unauthenticated clients the least possible 
420 access level to critical resources, like passwords.
421 .LP
422 The
423 .B priv
424 access model relies on the explicit setting of access privileges
425 for each clause.
426 The
427 .B =
428 sign resets previously defined accesses; as a consequence, the final 
429 access privileges will be only those defined by the clause.
430 The 
431 .B +
432 and
433 .B -
434 signs add/remove access privileges to the existing ones.
435 The privileges are
436 .B w
437 for write,
438 .B r
439 for read,
440 .B s 
441 for search,
442 .B c 
443 for compare, and
444 .B x
445 for authentication.
446 More than one privilege can be added in one statement.
447 .LP
448 The optional field
449 .B <control>
450 controls the flow of access rule application.
451 It can have the forms
452 .LP
453 .nf
454         stop
455         continue
456         break
457 .fi
458 .LP
459 where
460 .BR stop ,
461 the default, means access checking stops in case of match.
462 The other two forms are used to keep on processing access clauses.
463 In detail, the
464 .B continue
465 form allows for other 
466 .B <who>
467 clauses in the same 
468 .B <access>
469 clause to be considered, so that they may result in incrementally altering
470 the privileges, while the
471 .B break
472 form allows for other
473 .B <access>
474 clauses that match the same target to be processed.
475 Consider the (silly) example
476 .LP
477 .nf
478         access to dn.subtree="dc=example,dc=com" attrs=cn
479                 by * =cs break
480
481         access to dn.subtree="ou=People,dc=example,dc=com"
482                 by * +r
483 .fi
484 .LP
485 which allows search and compare privileges to everybody under
486 the "dc=example,dc=com" tree, with the second rule allowing
487 also read in the "ou=People" subtree,
488 or the (even more silly) example
489 .LP
490 .nf
491         access to dn.subtree="dc=example,dc=com" attrs=cn
492                 by * =cs continue
493                 by users +r
494 .fi
495 .LP
496 which grants everybody search and compare privileges, and adds read
497 privileges to authenticated clients.
498 .SH OPERATION REQUIREMENTS
499 Operations require different privileges on different portions of entries.
500 The following summary applies to primary database backends such as
501 the LDBM, BDB, and HDB backends.   Requirements for other backends may
502 (and often do) differ.
503 .LP
504 The
505 .B add
506 operation requires
507 .B write (=w)
508 privileges on the pseudo-attribute 
509 .B entry
510 of the entry being added, and 
511 .B write (=w)
512 privileges on the pseudo-attribute
513 .B children
514 of the entry's parent.
515 .LP
516 The 
517 .B bind
518 operation, when credentials are stored in the directory, requires 
519 .B auth (=x)
520 privileges on the attribute the credentials are stored in (usually
521 .BR userPassword ).
522 .LP
523 The
524 .B compare
525 operation requires 
526 .B compare (=c)
527 privileges on the attribute that is being compared.
528 .LP
529 The
530 .B delete
531 operation requires
532 .B write (=w)
533 privileges on the pseudo-attribute
534 .B entry 
535 of the entry being deleted, and
536 .B write (=w)
537 privileges on the
538 .B children
539 pseudo-attribute of the entry's parent.
540 .LP
541 The
542 .B modify
543 operation requires 
544 .B write (=w)
545 privileges on the attibutes being modified.
546 .LP
547 The
548 .B modrdn
549 operation requires
550 .B write (=w)
551 privileges on the pseudo-attribute
552 .B entry
553 of the entry whose relative DN is being modified,
554 .B write (=w)
555 privileges on the pseudo-attribute
556 .B children
557 of the old and new entry's parents, and
558 .B write (=w)
559 privileges on the attributes that are present in the new relative DN.
560 .B Write (=w)
561 privileges are also required on the attributes that are present 
562 in the old relative DN if 
563 .B deleteoldrdn
564 is set to 1.
565 .LP
566 The
567 .B search
568 operation, for each entry, requires
569 .B search (=s)
570 privileges on the attributes that are defined in the filter.
571 Then, the resulting entries are tested for 
572 .B read (=r)
573 privileges on the pseudo-attribute
574 .B entry
575 (for read access to the entry itself)
576 and for
577 .B read (=r)
578 access on each value of each attribute that is requested.
579 Also, for each
580 .B referral
581 object used in generating continuation references, the operation requires
582 .B read (=r)
583 access on the pseudo-attribute
584 .B entry
585 (for read access to the referral object itself),
586 as well as
587 .B read (=r)
588 access to the attribute holding the referral information
589 (generally the
590 .B ref
591 attribute).
592 .SH CAVEATS
593 It is strongly recommended to explicitly use the most appropriate
594 DN 
595 .BR style ,
596 to avoid possible incorrect specifications of the access rules as well
597 as for performance (avoid unrequired regex matching when an exact
598 match suffices) reasons.
599 .LP
600 An adminisistrator might create a rule of the form:
601 .LP
602 .nf
603         access to dn.regex="dc=example,dc=com"
604                 by ...
605 .fi
606 .LP
607 expecting it to match all entries in the subtree "dc=example,dc=com".
608 However, this rule actually matches any DN which contains anywhere
609 the substring "dc=example,dc=com".  That is, the rule matches both
610 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
611 .LP
612 To match the desired subtree, the rule would be more precisely
613 written:
614 .LP
615 .nf
616         access to dn.regex="^(.+,)?dc=example,dc=com$$"
617                 by ...
618 .fi
619 .LP
620 For performance reasons, it would be better to use the subtree style.
621 .LP
622 .nf
623         access to dn.subtree="dc=example,dc=com"
624                 by ...
625 .fi
626 .LP
627 .SH FILES
628 .TP
629 ETCDIR/slapd.conf
630 default slapd configuration file
631 .SH SEE ALSO
632 .BR slapd (8),
633 .LP
634 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
635 .SH ACKNOWLEDGEMENTS
636 .B OpenLDAP
637 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
638 .B OpenLDAP
639 is derived from University of Michigan LDAP 3.3 Release.