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