]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
e6cb8ae95a5e3a2404753e54d524b80460c613ac
[openldap] / doc / man / man5 / slapd.access.5
1 .TH SLAPD.ACCESS 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.access \- access configuration for slapd, the stand-alone LDAP daemon
7 .SH SYNOPSIS
8 ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The 
11 .BR slapd.conf (5)
12 file contains configuration information for the
13 .BR slapd (8)
14 daemon. This configuration file is also used by the SLAPD tools
15 .BR slapacl (8),
16 .BR slapadd (8),
17 .BR slapauth (8),
18 .BR slapcat (8),
19 .BR slapdn (8),
20 .BR slapindex (8),
21 and
22 .BR slaptest (8).
23 .LP
24 The
25 .B slapd.conf
26 file consists of a series of global configuration options that apply to
27 .B slapd
28 as a whole (including all backends), followed by zero or more database
29 backend definitions that contain information specific to a backend
30 instance.
31 .LP
32 The general format of
33 .B slapd.conf
34 is as follows:
35 .LP
36 .nf
37     # comment - these options apply to every database
38     <global configuration options>
39     # first database definition & configuration options
40     database    <backend 1 type>
41     <configuration options specific to backend 1>
42     # subsequent database definitions & configuration options
43     ...
44 .fi
45 .LP
46 Both the global configuration and each backend-specific section can
47 contain access information.  Backend-specific access control
48 directives are used for those entries that belong to the backend,
49 according to their naming context.  In case no access control
50 directives are defined for a backend or those which are defined are
51 not applicable, the directives from the global configuration section
52 are then used.
53 .LP
54 If no access controls are present, the default policy
55 allows anyone and everyone to read anything but restricts
56 updates to rootdn.  (e.g., "access to * by * read").
57 The rootdn can always read and write EVERYTHING!
58 .LP
59 For entries not held in any backend (such as a root DSE), the
60 global directives are used.
61 .LP
62 Arguments that should be replaced by actual text are shown in
63 brackets <>.
64 .SH THE ACCESS DIRECTIVE
65 The structure of the access control directives is
66 .TP
67 .B access to <what> "[ by <who> [ <access> ] [ <control> ] ]+"
68 Grant access (specified by 
69 .BR <access> ) 
70 to a set of entries and/or attributes (specified by 
71 .BR <what> ) 
72 by one or more requestors (specified by 
73 .BR <who> ).
74
75 .LP
76 Lists of access directives are evaluated in the order they appear
77 in \fIslapd.conf\fP.
78 When a
79 .B <what>
80 clause matches the datum whose access is being evaluated, its
81 .B <who>
82 clause list is checked.
83 When a
84 .B <who>
85 clause matches the accessor's properties, its
86 .B <access>
87 and
88 .B <control>
89 clauses are evaluated.
90 Access control checking stops at the first match of the
91 .B <what>
92 and
93 .B <who>
94 clause, unless otherwise dictated by the
95 .B <control>
96 clause.
97 Each
98 .B <who>
99 clause list is implicitly terminated by a
100 .LP
101 .nf
102         by * none stop
103 .fi
104 .LP
105 clause that results in stopping the access control with no access 
106 privileges granted.
107 Each
108 .B <what>
109 clause list is implicitly terminated by a
110 .LP
111 .nf
112         access to *
113                 by * none
114 .fi
115 .LP
116 clause that results in granting no access privileges to an otherwise
117 unspecified datum.
118 .SH THE <WHAT> FIELD
119 The field
120 .BR <what>
121 specifies the entity the access control directive applies to.
122 It can have the forms
123 .LP
124 .nf
125         dn[.<dnstyle>]=<dnpattern>
126         filter=<ldapfilter>
127         attrs=<attrlist>[ val[/matchingRule][.<attrstyle>]=<attrval>]
128 .fi
129 .LP
130 with
131 .LP
132 .nf
133         <dnstyle>={{exact|base(object)}|regex
134                 |one(level)|sub(tree)|children}
135         <attrlist>={<attr>|[{!|@}]<objectClass>}[,<attrlist>]
136         <attrstyle>={{exact|base(object)}|regex
137                 |one(level)|sub(tree)|children}
138 .fi
139 .LP
140 The statement
141 .B dn=<dnpattern>
142 selects the entries based on their naming context.
143 The
144 .B <dnpattern>
145 is a string representation of the entry's DN.
146 The wildcard
147 .B *
148 stands for all the entries, and it is implied if no
149 .B dn
150 form is given.
151 .LP
152 The 
153 .B <dnstyle> 
154 is optional; however, it is recommended to specify it to avoid ambiguities.
155 .B Base 
156 (synonym of
157 .BR baseObject ),
158 the default,
159 or
160 .B exact 
161 (an alias of 
162 .BR base )
163 indicates the entry whose DN is equal to the
164 .BR <dnpattern> ;
165 .B one
166 (synonym of
167 .BR onelevel )
168 indicates all the entries immediately below the
169 .BR <dnpattern> ,
170 .B sub
171 (synonym of
172 .BR subtree )
173 indicates all entries in the subtree at the
174 .BR <dnpattern> ,
175 .B children
176 indicates all the entries below (subordinate to) the 
177 .BR <dnpattern> .
178 .LP
179 If the
180 .B <dnstyle>
181 qualifier is
182 .BR regex ,
183 then 
184 .B <dnpattern>
185 is a POSIX (''extended'') regular expression pattern,
186 as detailed in
187 .BR regex (7)
188 and/or
189 .BR re_format (7),
190 matching a normalized string representation of the entry's DN.
191 The regex form of the pattern does not (yet) support UTF\-8.
192 .LP
193 The statement
194 .B filter=<ldapfilter>
195 selects the entries based on a valid LDAP filter as described in RFC 4515.
196 A filter of
197 .B (objectClass=*)
198 is implied if no
199 .B filter
200 form is given.
201 .LP
202 The statement
203 .B attrs=<attrlist>
204 selects the attributes the access control rule applies to.
205 It is a comma-separated list of attribute types, plus the special names
206 .BR entry ,
207 indicating access to the entry itself, and
208 .BR children ,
209 indicating access to the entry's children. ObjectClass names may also
210 be specified in this list, which will affect all the attributes that
211 are required and/or allowed by that objectClass.
212 Actually, names in 
213 .B <attrlist>
214 that are prefixed by
215 .B @
216 are directly treated as objectClass names.  A name prefixed by
217 .B !
218 is also treated as an objectClass, but in this case the access rule
219 affects the attributes that are not required nor allowed 
220 by that objectClass.
221 If no
222 .B attrs
223 form is given, 
224 .B attrs=@extensibleObject
225 is implied, i.e. all attributes are addressed.
226 .LP
227 Using the form
228 .B attrs=<attr> val[/matchingRule][.<attrstyle>]=<attrval>
229 specifies access to a particular value of a single attribute.
230 In this case, only a single attribute type may be given. The
231 .B <attrstyle>
232 .B exact
233 (the default) uses the attribute's equality matching rule to compare the
234 value, unless a different (and compatible) matching rule is specified. If the
235 .B <attrstyle>
236 is
237 .BR regex ,
238 the provided value is used as a POSIX (''extended'') regular
239 expression pattern.  If the attribute has DN syntax, the 
240 .B <attrstyle>
241 can be any of
242 .BR base ,
243 .BR onelevel ,
244 .B subtree
245 or
246 .BR children ,
247 resulting in base, onelevel, subtree or children match, respectively.
248 .LP
249 The dn, filter, and attrs statements are additive; they can be used in sequence 
250 to select entities the access rule applies to based on naming context,
251 value and attribute type simultaneously.
252 .SH THE <WHO> FIELD
253 The field
254 .B <who>
255 indicates whom the access rules apply to.
256 Multiple 
257 .B <who>
258 statements can appear in an access control statement, indicating the
259 different access privileges to the same resource that apply to different
260 accessee.
261 It can have the forms
262 .LP
263 .nf
264         *
265         anonymous
266         users
267         self[.<selfstyle>]
268
269         dn[.<dnstyle>[,<modifier>]]=<DN>
270         dnattr=<attrname>
271
272         realanonymous
273         realusers
274         realself[.<selfstyle>]
275
276         realdn[.<dnstyle>[,<modifier>]]=<DN>
277         realdnattr=<attrname>
278
279         group[/<objectclass>[/<attrname>]]
280                 [.<groupstyle>]=<group>
281         peername[.<peernamestyle>]=<peername>
282         sockname[.<style>]=<sockname>
283         domain[.<domainstyle>[,<modifier>]]=<domain>
284         sockurl[.<style>]=<sockurl>
285         set[.<setstyle>]=<pattern>
286
287         ssf=<n>
288         transport_ssf=<n>
289         tls_ssf=<n>
290         sasl_ssf=<n>
291
292         dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
293 .fi
294 .LP
295 with
296 .LP
297 .nf
298         <style>={exact|regex|expand}
299         <selfstyle>={level{<n>}}
300         <dnstyle>={{exact|base(object)}|regex
301                 |one(level)|sub(tree)|children|level{<n>}}
302         <groupstyle>={exact|expand}
303         <peernamestyle>={<style>|ip|ipv6|path}
304         <domainstyle>={exact|regex|sub(tree)}
305         <setstyle>={exact|regex}
306         <modifier>={expand}
307         <name>=aci              <pattern>=<attrname>]
308 .fi
309 .LP
310 They may be specified in combination.
311 .LP
312 .nf
313 .fi
314 .LP
315 The wildcard
316 .B *
317 refers to everybody.
318 .LP
319 The keywords prefixed by
320 .B real
321 act as their counterparts without prefix; the checking respectively occurs
322 with the \fIauthentication\fP DN and the \fIauthorization\fP DN.
323 .LP
324 The keyword
325 .B anonymous
326 means access is granted to unauthenticated clients; it is mostly used 
327 to limit access to authentication resources (e.g. the
328 .B userPassword
329 attribute) to unauthenticated clients for authentication purposes.
330 .LP
331 The keyword
332 .B users
333 means access is granted to authenticated clients.
334 .LP
335 The keyword
336 .B self
337 means access to an entry is allowed to the entry itself (e.g. the entry
338 being accessed and the requesting entry must be the same).
339 It allows the 
340 .B level{<n>}
341 style, where \fI<n>\fP indicates what ancestor of the DN 
342 is to be used in matches.
343 A positive value indicates that the <n>-th ancestor of the user's DN
344 is to be considered; a negative value indicates that the <n>-th ancestor
345 of the target is to be considered.
346 For example, a "\fIby self.level{1} ...\fP" clause would match
347 when the object "\fIdc=example,dc=com\fP" is accessed
348 by "\fIcn=User,dc=example,dc=com\fP".
349 A "\fIby self.level{-1} ...\fP" clause would match when the same user
350 accesses the object "\fIou=Address Book,cn=User,dc=example,dc=com\fP".
351 .LP
352 The statement
353 .B dn=<DN>
354 means that access is granted to the matching DN.
355 The optional style qualifier
356 .B dnstyle
357 allows the same choices of the dn form of the
358 .B <what>
359 field.  In addition, the
360 .B regex
361 style can exploit substring substitution of submatches in the
362 .B <what>
363 dn.regex clause by using the form
364 .BR $<digit> ,
365 with 
366 .B digit
367 ranging from 0 to 9 (where 0 matches the entire string),
368 or the form
369 .BR ${<digit>+} ,
370 for submatches higher than 9.
371 Substring substitution from attribute value can
372 be done in 
373 using the form
374 .BR ${v<digit>+} .
375 Since the dollar character is used to indicate a substring replacement,
376 the dollar character that is used to indicate match up to the end of
377 the string must be escaped by a second dollar character, e.g.
378 .LP
379 .nf
380     access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$"
381         by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write
382 .fi
383 .LP
384 The style qualifier
385 allows an optional
386 .BR modifier .
387 At present, the only type allowed is 
388 .BR expand ,
389 which causes substring substitution of submatches to take place
390 even if 
391 .B dnstyle
392 is not 
393 .BR regex .
394 Note that the 
395 .B regex 
396 dnstyle in the above example may be of use only if the 
397 .B <by>
398 clause needs to be a regex; otherwise, if the
399 value of the second (from the right)
400 .B dc=
401 portion of the DN in the above example were fixed, the form
402 .LP
403 .nf
404     access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
405         by dn.exact,expand="uid=$2,dc=example,dc=com" write
406 .fi
407 .LP
408 could be used; if it had to match the value in the 
409 .B <what>
410 clause, the form
411 .LP
412 .nf
413     access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$"
414         by dn.exact,expand="uid=$2,dc=$3,dc=com" write
415 .fi
416 .LP
417 could be used.
418 .LP
419 Forms of the 
420 .B <what>
421 clause other than regex may provide submatches as well.
422 The 
423 .BR base(object) ,
424 the
425 .BR sub(tree) ,
426 the
427 .BR one(level) ,
428 and the
429 .BR children
430 forms provide
431 .B $0
432 as the match of the entire string.
433 The 
434 .BR sub(tree) ,
435 the
436 .BR one(level) ,
437 and the
438 .BR children
439 forms also provide
440 .B $1
441 as the match of the rightmost part of the DN as defined in the
442 .B <what>
443 clause.
444 This may be useful, for instance, to provide access to all the 
445 ancestors of a user by defining
446 .LP
447 .nf
448     access to dn.subtree="dc=com"
449         by dn.subtree,expand="$1" read
450 .fi
451 .LP
452 which means that only access to entries that appear in the DN of the
453 .B <by>
454 clause is allowed.
455 .LP
456 The 
457 .BR level{<n>}
458 form is an extension and a generalization of the
459 .BR onelevel
460 form, which matches all DNs whose <n>-th ancestor is the pattern.
461 So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP, 
462 and \fIlevel{0}\fP is equivalent to \fIbase\fP.
463 .LP
464 It is perfectly useless to give any access privileges to a DN 
465 that exactly matches the
466 .B rootdn
467 of the database the ACLs apply to, because it implicitly
468 possesses write privileges for the entire tree of that database.
469 Actually, access control is bypassed for the
470 .BR rootdn ,
471 to solve the intrinsic chicken-and-egg problem.
472 .LP
473 The statement
474 .B dnattr=<attrname>
475 means that access is granted to requests whose DN is listed in the
476 entry being accessed under the 
477 .B <attrname>
478 attribute.
479 .LP
480 The statement
481 .B group=<group>
482 means that access is granted to requests whose DN is listed
483 in the group entry whose DN is given by
484 .BR <group> .
485 The optional parameters
486 .B <objectclass>
487 and
488 .B <attrname>
489 define the objectClass and the member attributeType of the group entry.
490 The defaults are
491 .B groupOfNames
492 and
493 .BR member ,
494 respectively.
495 The optional style qualifier
496 .B <style>
497 can be
498 .BR expand ,
499 which means that
500 .B <group>
501 will be expanded as a replacement string (but not as a regular expression)
502 according to
503 .BR regex (7)
504 and/or
505 .BR re_format (7),
506 and
507 .BR exact ,
508 which means that exact match will be used.
509 If the style of the DN portion of the
510 .B <what>
511 clause is regex, the submatches are made available according to
512 .BR regex (7)
513 and/or
514 .BR re_format (7);
515 other styles provide limited submatches as discussed above about 
516 the DN form of the 
517 .B <by>
518 clause.
519 .LP
520 For static groups, the specified attributeType must have
521 .B DistinguishedName
522 or
523 .B NameAndOptionalUID
524 syntax. For dynamic groups the attributeType must
525 be a subtype of the
526 .B labeledURI
527 attributeType. Only LDAP URIs of the form
528 .B ldap:///<base>??<scope>?<filter>
529 will be evaluated in a dynamic group, by searching the local server only.
530 .LP
531 The statements
532 .BR peername=<peername> ,
533 .BR sockname=<sockname> ,
534 .BR domain=<domain> ,
535 and
536 .BR sockurl=<sockurl>
537 mean that the contacting host IP (in the form 
538 .BR "IP=<ip>:<port>"
539 for IPv4, or
540 .BR "IP=[<ipv6>]:<port>"
541 for IPv6)
542 or the contacting host named pipe file name (in the form
543 .B "PATH=<path>"
544 if connecting through a named pipe) for
545 .BR peername ,
546 the named pipe file name for
547 .BR sockname ,
548 the contacting host name for
549 .BR domain ,
550 and the contacting URL for
551 .BR sockurl
552 are compared against
553 .B pattern
554 to determine access.
555 The same
556 .B style
557 rules for pattern match described for the
558 .B group
559 case apply, plus the
560 .B regex
561 style, which implies submatch
562 .B expand
563 and regex match of the corresponding connection parameters.
564 The
565 .B exact
566 style of the
567 .BR <peername>
568 clause (the default) implies a case-exact match on the client's
569 .BR IP , 
570 including the
571 .B "IP="
572 prefix and the trailing
573 .BR ":<port>" , 
574 or the client's 
575 .BR path ,
576 including the
577 .B "PATH="
578 prefix if connecting through a named pipe.
579 The special
580 .B ip
581 style interprets the pattern as 
582 .BR <peername>=<ip>[%<mask>][{<n>}] ,
583 where
584 .B <ip>
585 and 
586 .B <mask>
587 are dotted digit representations of the IP and the mask, while
588 .BR <n> ,
589 delimited by curly brackets, is an optional port.
590 The same applies to IPv6 addresses when the special
591 .B ipv6
592 style is used.
593 When checking access privileges, the IP portion of the
594 .BR peername 
595 is extracted, eliminating the
596 .B "IP="
597 prefix and the
598 .B ":<port>"
599 part, and it is compared against the
600 .B <ip>
601 portion of the pattern after masking with
602 .BR <mask> :
603 \fI((peername & <mask>) == <ip>)\fP.
604 As an example, 
605 .B peername.ip=127.0.0.1
606 and
607 .B peername.ipv6=::1
608 allow connections only from localhost,
609 .B peername.ip=192.168.1.0%255.255.255.0 
610 allows connections from any IP in the 192.168.1 class C domain, and
611 .B peername.ip=192.168.1.16%255.255.255.240{9009}
612 allows connections from any IP in the 192.168.1.[16-31] range 
613 of the same domain, only if port 9009 is used.
614 The special 
615 .B path
616 style eliminates the 
617 .B "PATH="
618 prefix from the 
619 .B peername
620 when connecting through a named pipe, and performs an exact match 
621 on the given pattern.
622 The
623 .BR <domain>
624 clause also allows the
625 .B subtree
626 style, which succeeds when a fully qualified name exactly matches the
627 .BR domain
628 pattern, or its trailing part, after a 
629 .BR dot ,
630 exactly matches the 
631 .BR domain
632 pattern.
633 The 
634 .B expand
635 style is allowed, implying an
636 .B exact 
637 match with submatch expansion; the use of 
638 .B expand 
639 as a style modifier is considered more appropriate.
640 As an example,
641 .B domain.subtree=example.com
642 will match www.example.com, but will not match www.anotherexample.com.
643 The
644 .B domain
645 of the contacting host is determined by performing a DNS reverse lookup.
646 As this lookup can easily be spoofed, use of the
647 .B domain
648 statement is strongly discouraged.  By default, reverse lookups are disabled.
649 The optional
650 .B domainstyle
651 qualifier of the
652 .B <domain>
653 clause allows a
654 .B modifier
655 option; the only value currently supported is
656 .BR expand ,
657 which causes substring substitution of submatches to take place even if
658 the 
659 .B domainstyle
660 is not 
661 .BR regex ,
662 much like the analogous usage in 
663 .B <dn>
664 clause.
665 .LP
666 The statement
667 .B set=<pattern>
668 is undocumented yet.
669 .LP
670 The statement
671 .B dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
672 means that access checking is delegated to the admin-defined method
673 indicated by
674 .BR <name> ,
675 which can be registered at run-time by means of the
676 .B moduleload
677 statement.
678 The fields
679 .BR <options> ,
680 .B <dynstyle>
681 and
682 .B <pattern>
683 are optional, and are directly passed to the registered parsing routine.
684 Dynacl is experimental; it must be enabled at compile time.
685 .LP
686 The statement
687 .B dynacl/aci[=<attrname>]
688 means that the access control is determined by the values in the
689 .B attrname
690 of the entry itself.
691 The optional
692 .B <attrname>
693 indicates what attributeType holds the ACI information in the entry.
694 By default, the 
695 .B OpenLDAPaci
696 operational attribute is used.
697 ACIs are experimental; they must be enabled at compile time.
698 .LP
699 The statements
700 .BR ssf=<n> ,
701 .BR transport_ssf=<n> ,
702 .BR tls_ssf=<n> ,
703 and
704 .BR sasl_ssf=<n>
705 set the minimum required Security Strength Factor (ssf) needed
706 to grant access.  The value should be positive integer.
707 .SH THE <ACCESS> FIELD
708 The optional field
709 .B <access> ::= [[real]self]{<level>|<priv>}
710 determines the access level or the specific access privileges the
711 .B who 
712 field will have.
713 Its component are defined as
714 .LP
715 .nf
716         <level> ::= none|disclose|auth|compare|search|read|{write|add|delete}|manage
717         <priv> ::= {=|+|-}{0|d|x|c|s|r|{w|a|z}|m}+
718 .fi
719 .LP
720 The modifier
721 .B self
722 allows special operations like having a certain access level or privilege
723 only in case the operation involves the name of the user that's requesting
724 the access.
725 It implies the user that requests access is authorized.
726 The modifier
727 .B realself
728 refers to the authenticated DN as opposed to the authorized DN of the
729 .B self
730 modifier.
731 An example is the
732 .B selfwrite
733 access to the member attribute of a group, which allows one to add/delete
734 its own DN from the member list of a group, while being not allowed
735 to affect other members.
736 .LP
737 The 
738 .B level 
739 access model relies on an incremental interpretation of the access
740 privileges.
741 The possible levels are
742 .BR none ,
743 .BR disclose ,
744 .BR auth ,
745 .BR compare ,
746 .BR search ,
747 .BR read ,
748 .BR write ,
749 and
750 .BR manage .
751 Each access level implies all the preceding ones, thus 
752 .B manage
753 grants all access including administrative access.
754 The 
755 .BR write
756 access is actually the combination of
757 .BR add
758 and
759 .BR delete ,
760 which respectively restrict the write privilege to add or delete
761 the specified
762 .BR <what> .
763
764 .LP
765 The
766 .B none 
767 access level disallows all access including disclosure on error.
768 .LP
769 The
770 .B disclose
771 access level allows disclosure of information on error.
772 .LP
773 The 
774 .B auth
775 access level means that one is allowed access to an attribute to perform
776 authentication/authorization operations (e.g.
777 .BR bind )
778 with no other access.
779 This is useful to grant unauthenticated clients the least possible 
780 access level to critical resources, like passwords.
781 .LP
782 The
783 .B priv
784 access model relies on the explicit setting of access privileges
785 for each clause.
786 The
787 .B =
788 sign resets previously defined accesses; as a consequence, the final 
789 access privileges will be only those defined by the clause.
790 The 
791 .B +
792 and
793 .B -
794 signs add/remove access privileges to the existing ones.
795 The privileges are
796 .B m
797 for manage,
798 .B w
799 for write,
800 .B a
801 for add,
802 .B z
803 for delete,
804 .B r
805 for read,
806 .B s 
807 for search,
808 .B c 
809 for compare,
810 .B x
811 for authentication, and
812 .B d
813 for disclose.
814 More than one of the above privileges can be added in one statement.
815 .B 0
816 indicates no privileges and is used only by itself (e.g., +0).
817 Note that
818 .B +az
819 is equivalent to
820 .BR +w .
821 .LP
822 If no access is given, it defaults to 
823 .BR +0 .
824 .SH THE <CONTROL> FIELD
825 The optional field
826 .B <control>
827 controls the flow of access rule application.
828 It can have the forms
829 .LP
830 .nf
831         stop
832         continue
833         break
834 .fi
835 .LP
836 where
837 .BR stop ,
838 the default, means access checking stops in case of match.
839 The other two forms are used to keep on processing access clauses.
840 In detail, the
841 .B continue
842 form allows for other 
843 .B <who>
844 clauses in the same 
845 .B <access>
846 clause to be considered, so that they may result in incrementally altering
847 the privileges, while the
848 .B break
849 form allows for other
850 .B <access>
851 clauses that match the same target to be processed.
852 Consider the (silly) example
853 .LP
854 .nf
855         access to dn.subtree="dc=example,dc=com" attrs=cn
856                 by * =cs break
857
858         access to dn.subtree="ou=People,dc=example,dc=com"
859                 by * +r
860 .fi
861 .LP
862 which allows search and compare privileges to everybody under
863 the "dc=example,dc=com" tree, with the second rule allowing
864 also read in the "ou=People" subtree,
865 or the (even more silly) example
866 .LP
867 .nf
868         access to dn.subtree="dc=example,dc=com" attrs=cn
869                 by * =cs continue
870                 by users +r
871 .fi
872 .LP
873 which grants everybody search and compare privileges, and adds read
874 privileges to authenticated clients.
875 .LP
876 One useful application is to easily grant write privileges to an
877 .B updatedn
878 that is different from the
879 .BR rootdn .
880 In this case, since the
881 .B updatedn
882 needs write access to (almost) all data, one can use
883 .LP
884 .nf
885         access to *
886                 by dn.exact="cn=The Update DN,dc=example,dc=com" write
887                 by * break
888 .fi
889 .LP
890 as the first access rule.
891 As a consequence, unless the operation is performed with the 
892 .B updatedn
893 identity, control is passed straight to the subsequent rules.
894
895 .SH OPERATION REQUIREMENTS
896 Operations require different privileges on different portions of entries.
897 The following summary applies to primary database backends such as
898 the BDB and HDB backends.   Requirements for other backends may
899 (and often do) differ.
900
901 .LP
902 The
903 .B add
904 operation requires
905 .B add (=a)
906 privileges on the pseudo-attribute 
907 .B entry
908 of the entry being added, and 
909 .B add (=a)
910 privileges on the pseudo-attribute
911 .B children
912 of the entry's parent.
913 When adding the suffix entry of a database,
914 .B add
915 access to
916 .B children
917 of the empty DN ("") is required. Also if
918 Add content ACL checking has been configured on
919 the database (see the
920 .BR slapd.conf (5)
921 or
922 .BR slapd-config (5)
923 manual page),
924 .B add (=a)
925 will be required on all of the attributes being added.
926
927 .LP
928 The 
929 .B bind
930 operation, when credentials are stored in the directory, requires 
931 .B auth (=x)
932 privileges on the attribute the credentials are stored in (usually
933 .BR userPassword ).
934
935 .LP
936 The
937 .B compare
938 operation requires 
939 .B compare (=c)
940 privileges on the attribute that is being compared.
941
942 .LP
943 The
944 .B delete
945 operation requires
946 .B delete (=z)
947 privileges on the pseudo-attribute
948 .B entry 
949 of the entry being deleted, and
950 .B delete (=d)
951 privileges on the
952 .B children
953 pseudo-attribute of the entry's parent.
954
955 .LP
956 The
957 .B modify
958 operation requires 
959 .B write (=w)
960 privileges on the attributes being modified.
961 In detail, 
962 .B add (=a)
963 is required to add new values,
964 .B delete (=z)
965 is required to delete existing values,
966 and both
967 .B delete
968 and
969 .BR "add (=az)" ,
970 or
971 .BR "write (=w)" ,
972 are required to replace existing values.
973
974 .LP
975 The
976 .B modrdn
977 operation requires
978 .B write (=w)
979 privileges on the pseudo-attribute
980 .B entry
981 of the entry whose relative DN is being modified,
982 .B delete (=z)
983 privileges on the pseudo-attribute
984 .B children
985 of the old entry's parents,
986 .B add (=a)
987 privileges on the pseudo-attribute
988 .B children
989 of the new entry's parents, and
990 .B add (=a)
991 privileges on the attributes that are present in the new relative DN.
992 .B Delete (=z)
993 privileges are also required on the attributes that are present 
994 in the old relative DN if 
995 .B deleteoldrdn
996 is set to 1.
997
998 .LP
999 The
1000 .B search
1001 operation, requires 
1002 .B search (=s)
1003 privileges on the 
1004 .B entry
1005 pseudo-attribute of the searchBase
1006 (NOTE: this was introduced with OpenLDAP 2.4).
1007 Then, for each entry, it requires
1008 .B search (=s)
1009 privileges on the attributes that are defined in the filter.
1010 The resulting entries are finally tested for 
1011 .B read (=r)
1012 privileges on the pseudo-attribute
1013 .B entry
1014 (for read access to the entry itself)
1015 and for
1016 .B read (=r)
1017 access on each value of each attribute that is requested.
1018 Also, for each
1019 .B referral
1020 object used in generating continuation references, the operation requires
1021 .B read (=r)
1022 access on the pseudo-attribute
1023 .B entry
1024 (for read access to the referral object itself),
1025 as well as
1026 .B read (=r)
1027 access to the attribute holding the referral information
1028 (generally the
1029 .B ref
1030 attribute).
1031
1032 .LP
1033 Some internal operations and some
1034 .B controls
1035 require specific access privileges.
1036 The
1037 .B authzID
1038 mapping and the 
1039 .B proxyAuthz
1040 control require
1041 .B auth (=x)
1042 privileges on all the attributes that are present in the search filter
1043 of the URI regexp maps (the right-hand side of the
1044 .B authz-regexp
1045 directives).
1046 .B Auth (=x)
1047 privileges are also required on the
1048 .B authzTo
1049 attribute of the authorizing identity and/or on the 
1050 .B authzFrom
1051 attribute of the authorized identity.
1052 In general, when an internal lookup is performed for authentication
1053 or authorization purposes, search-specific privileges (see the access
1054 requirements for the search operation illustrated above) are relaxed to
1055 .BR auth .
1056
1057 .LP
1058 Access control to search entries is checked by the frontend,
1059 so it is fully honored by all backends; for all other operations
1060 and for the discovery phase of the search operation,
1061 full ACL semantics is only supported by the primary backends, i.e.
1062 .BR back-bdb (5),
1063 and
1064 .BR back-hdb (5).
1065
1066 Some other backend, like
1067 .BR back-sql (5),
1068 may fully support them; others may only support a portion of the 
1069 described semantics, or even differ in some aspects.
1070 The relevant details are described in the backend-specific man pages.
1071
1072 .SH CAVEATS
1073 It is strongly recommended to explicitly use the most appropriate
1074 .B <dnstyle>
1075 in
1076 .B <what>
1077 and
1078 .B <who>
1079 clauses, to avoid possible incorrect specifications of the access rules 
1080 as well as for performance (avoid unnecessary regex matching when an exact
1081 match suffices) reasons.
1082 .LP
1083 An administrator might create a rule of the form:
1084 .LP
1085 .nf
1086         access to dn.regex="dc=example,dc=com"
1087                 by ...
1088 .fi
1089 .LP
1090 expecting it to match all entries in the subtree "dc=example,dc=com".
1091 However, this rule actually matches any DN which contains anywhere
1092 the substring "dc=example,dc=com".  That is, the rule matches both
1093 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
1094 .LP
1095 To match the desired subtree, the rule would be more precisely
1096 written:
1097 .LP
1098 .nf
1099         access to dn.regex="^(.+,)?dc=example,dc=com$"
1100                 by ...
1101 .fi
1102 .LP
1103 For performance reasons, it would be better to use the subtree style.
1104 .LP
1105 .nf
1106         access to dn.subtree="dc=example,dc=com"
1107                 by ...
1108 .fi
1109 .LP
1110 When writing submatch rules, it may be convenient to avoid unnecessary
1111 .B regex
1112 .B <dnstyle>
1113 use; for instance, to allow access to the subtree of the user 
1114 that matches the
1115 .B <what>
1116 clause, one could use
1117 .LP
1118 .nf
1119         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1120                 by dn.regex="^uid=$2,dc=example,dc=com$$" write
1121                 by ...
1122 .fi
1123 .LP
1124 However, since all that is required in the 
1125 .B <by>
1126 clause is substring expansion, a more efficient solution is
1127 .LP
1128 .nf
1129         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1130                 by dn.exact,expand="uid=$2,dc=example,dc=com" write
1131                 by ...
1132 .fi
1133 .LP
1134 In fact, while a
1135 .B <dnstyle>
1136 of
1137 .B regex
1138 implies substring expansion, 
1139 .BR exact ,
1140 as well as all the other DN specific
1141 .B <dnstyle>
1142 values, does not, so it must be explicitly requested.
1143 .LP
1144 .SH FILES
1145 .TP
1146 ETCDIR/slapd.conf
1147 default slapd configuration file
1148 .SH SEE ALSO
1149 .BR slapd (8),
1150 .BR slapd-* (5),
1151 .BR slapacl (8),
1152 .BR regex (7),
1153 .BR re_format (7)
1154 .LP
1155 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
1156 .SH ACKNOWLEDGEMENTS
1157 .so ../Project