]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
5fe76f684e63213addb35006667491b9cb0a3edb
[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 Since the dollar character is used to indicate a substring replacement,
373 the dollar character that is used to indicate match up to the end of
374 the string must be escaped by a second dollar character, e.g.
375 .LP
376 .nf
377     access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$"
378         by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write
379 .fi
380 .LP
381 The style qualifier
382 allows an optional
383 .BR modifier .
384 At present, the only type allowed is 
385 .BR expand ,
386 which causes substring substitution of submatches to take place
387 even if 
388 .B dnstyle
389 is not 
390 .BR regex .
391 Note that the 
392 .B regex 
393 dnstyle in the above example may be of use only if the 
394 .B <by>
395 clause needs to be a regex; otherwise, if the
396 value of the second (from the right)
397 .B dc=
398 portion of the DN in the above example were fixed, the form
399 .LP
400 .nf
401     access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
402         by dn.exact,expand="uid=$2,dc=example,dc=com" write
403 .fi
404 .LP
405 could be used; if it had to match the value in the 
406 .B <what>
407 clause, the form
408 .LP
409 .nf
410     access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$"
411         by dn.exact,expand="uid=$2,dc=$3,dc=com" write
412 .fi
413 .LP
414 could be used.
415 .LP
416 Forms of the 
417 .B <what>
418 clause other than regex may provide submatches as well.
419 The 
420 .BR base(object) ,
421 the
422 .BR sub(tree) ,
423 the
424 .BR one(level) ,
425 and the
426 .BR children
427 forms provide
428 .B $0
429 as the match of the entire string.
430 The 
431 .BR sub(tree) ,
432 the
433 .BR one(level) ,
434 and the
435 .BR children
436 forms also provide
437 .B $1
438 as the match of the rightmost part of the DN as defined in the
439 .B <what>
440 clause.
441 This may be useful, for instance, to provide access to all the 
442 ancestors of a user by defining
443 .LP
444 .nf
445     access to dn.subtree="dc=com"
446         by dn.subtree,expand="$1" read
447 .fi
448 .LP
449 which means that only access to entries that appear in the DN of the
450 .B <by>
451 clause is allowed.
452 .LP
453 The 
454 .BR level{<n>}
455 form is an extension and a generalization of the
456 .BR onelevel
457 form, which matches all DNs whose <n>-th ancestor is the pattern.
458 So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP, 
459 and \fIlevel{0}\fP is equivalent to \fIbase\fP.
460 .LP
461 It is perfectly useless to give any access privileges to a DN 
462 that exactly matches the
463 .B rootdn
464 of the database the ACLs apply to, because it implicitly
465 possesses write privileges for the entire tree of that database.
466 Actually, access control is bypassed for the
467 .BR rootdn ,
468 to solve the intrinsic chicken-and-egg problem.
469 .LP
470 The statement
471 .B dnattr=<attrname>
472 means that access is granted to requests whose DN is listed in the
473 entry being accessed under the 
474 .B <attrname>
475 attribute.
476 .LP
477 The statement
478 .B group=<group>
479 means that access is granted to requests whose DN is listed
480 in the group entry whose DN is given by
481 .BR <group> .
482 The optional parameters
483 .B <objectclass>
484 and
485 .B <attrname>
486 define the objectClass and the member attributeType of the group entry.
487 The defaults are
488 .B groupOfNames
489 and
490 .BR member ,
491 respectively.
492 The optional style qualifier
493 .B <style>
494 can be
495 .BR expand ,
496 which means that
497 .B <group>
498 will be expanded as a replacement string (but not as a regular expression)
499 according to
500 .BR regex (7)
501 and/or
502 .BR re_format (7),
503 and
504 .BR exact ,
505 which means that exact match will be used.
506 If the style of the DN portion of the
507 .B <what>
508 clause is regex, the submatches are made available according to
509 .BR regex (7)
510 and/or
511 .BR re_format (7);
512 other styles provide limited submatches as discussed above about 
513 the DN form of the 
514 .B <by>
515 clause.
516 .LP
517 For static groups, the specified attributeType must have
518 .B DistinguishedName
519 or
520 .B NameAndOptionalUID
521 syntax. For dynamic groups the attributeType must
522 be a subtype of the
523 .B labeledURI
524 attributeType. Only LDAP URIs of the form
525 .B ldap:///<base>??<scope>?<filter>
526 will be evaluated in a dynamic group, by searching the local server only.
527 .LP
528 The statements
529 .BR peername=<peername> ,
530 .BR sockname=<sockname> ,
531 .BR domain=<domain> ,
532 and
533 .BR sockurl=<sockurl>
534 mean that the contacting host IP (in the form 
535 .BR "IP=<ip>:<port>"
536 for IPv4, or
537 .BR "IP=[<ipv6>]:<port>"
538 for IPv6)
539 or the contacting host named pipe file name (in the form
540 .B "PATH=<path>"
541 if connecting through a named pipe) for
542 .BR peername ,
543 the named pipe file name for
544 .BR sockname ,
545 the contacting host name for
546 .BR domain ,
547 and the contacting URL for
548 .BR sockurl
549 are compared against
550 .B pattern
551 to determine access.
552 The same
553 .B style
554 rules for pattern match described for the
555 .B group
556 case apply, plus the
557 .B regex
558 style, which implies submatch
559 .B expand
560 and regex match of the corresponding connection parameters.
561 The
562 .B exact
563 style of the
564 .BR <peername>
565 clause (the default) implies a case-exact match on the client's
566 .BR IP , 
567 including the
568 .B "IP="
569 prefix and the trailing
570 .BR ":<port>" , 
571 or the client's 
572 .BR path ,
573 including the
574 .B "PATH="
575 prefix if connecting through a named pipe.
576 The special
577 .B ip
578 style interprets the pattern as 
579 .BR <peername>=<ip>[%<mask>][{<n>}] ,
580 where
581 .B <ip>
582 and 
583 .B <mask>
584 are dotted digit representations of the IP and the mask, while
585 .BR <n> ,
586 delimited by curly brackets, is an optional port.
587 The same applies to IPv6 addresses when the special
588 .B ipv6
589 style is used.
590 When checking access privileges, the IP portion of the
591 .BR peername 
592 is extracted, eliminating the
593 .B "IP="
594 prefix and the
595 .B ":<port>"
596 part, and it is compared against the
597 .B <ip>
598 portion of the pattern after masking with
599 .BR <mask> :
600 \fI((peername & <mask>) == <ip>)\fP.
601 As an example, 
602 .B peername.ip=127.0.0.1
603 and
604 .B peername.ipv6=::1
605 allow connections only from localhost,
606 .B peername.ip=192.168.1.0%255.255.255.0 
607 allows connections from any IP in the 192.168.1 class C domain, and
608 .B peername.ip=192.168.1.16%255.255.255.240{9009}
609 allows connections from any IP in the 192.168.1.[16-31] range 
610 of the same domain, only if port 9009 is used.
611 The special 
612 .B path
613 style eliminates the 
614 .B "PATH="
615 prefix from the 
616 .B peername
617 when connecting through a named pipe, and performs an exact match 
618 on the given pattern.
619 The
620 .BR <domain>
621 clause also allows the
622 .B subtree
623 style, which succeeds when a fully qualified name exactly matches the
624 .BR domain
625 pattern, or its trailing part, after a 
626 .BR dot ,
627 exactly matches the 
628 .BR domain
629 pattern.
630 The 
631 .B expand
632 style is allowed, implying an
633 .B exact 
634 match with submatch expansion; the use of 
635 .B expand 
636 as a style modifier is considered more appropriate.
637 As an example,
638 .B domain.subtree=example.com
639 will match www.example.com, but will not match www.anotherexample.com.
640 The
641 .B domain
642 of the contacting host is determined by performing a DNS reverse lookup.
643 As this lookup can easily be spoofed, use of the
644 .B domain
645 statement is strongly discouraged.  By default, reverse lookups are disabled.
646 The optional
647 .B domainstyle
648 qualifier of the
649 .B <domain>
650 clause allows a
651 .B modifier
652 option; the only value currently supported is
653 .BR expand ,
654 which causes substring substitution of submatches to take place even if
655 the 
656 .B domainstyle
657 is not 
658 .BR regex ,
659 much like the analogous usage in 
660 .B <dn>
661 clause.
662 .LP
663 The statement
664 .B set=<pattern>
665 is undocumented yet.
666 .LP
667 The statement
668 .B dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
669 means that access checking is delegated to the admin-defined method
670 indicated by
671 .BR <name> ,
672 which can be registered at run-time by means of the
673 .B moduleload
674 statement.
675 The fields
676 .BR <options> ,
677 .B <dynstyle>
678 and
679 .B <pattern>
680 are optional, and are directly passed to the registered parsing routine.
681 Dynacl is experimental; it must be enabled at compile time.
682 .LP
683 The statement
684 .B dynacl/aci[=<attrname>]
685 means that the access control is determined by the values in the
686 .B attrname
687 of the entry itself.
688 The optional
689 .B <attrname>
690 indicates what attributeType holds the ACI information in the entry.
691 By default, the 
692 .B OpenLDAPaci
693 operational attribute is used.
694 ACIs are experimental; they must be enabled at compile time.
695 .LP
696 The statements
697 .BR ssf=<n> ,
698 .BR transport_ssf=<n> ,
699 .BR tls_ssf=<n> ,
700 and
701 .BR sasl_ssf=<n>
702 set the minimum required Security Strength Factor (ssf) needed
703 to grant access.  The value should be positive integer.
704 .SH THE <ACCESS> FIELD
705 The optional field
706 .B <access> ::= [[real]self]{<level>|<priv>}
707 determines the access level or the specific access privileges the
708 .B who 
709 field will have.
710 Its component are defined as
711 .LP
712 .nf
713         <level> ::= none|disclose|auth|compare|search|read|{write|add|delete}|manage
714         <priv> ::= {=|+|-}{0|d|x|c|s|r|{w|a|z}|m}+
715 .fi
716 .LP
717 The modifier
718 .B self
719 allows special operations like having a certain access level or privilege
720 only in case the operation involves the name of the user that's requesting
721 the access.
722 It implies the user that requests access is authorized.
723 The modifier
724 .B realself
725 refers to the authenticated DN as opposed to the authorized DN of the
726 .B self
727 modifier.
728 An example is the
729 .B selfwrite
730 access to the member attribute of a group, which allows one to add/delete
731 its own DN from the member list of a group, while being not allowed
732 to affect other members.
733 .LP
734 The 
735 .B level 
736 access model relies on an incremental interpretation of the access
737 privileges.
738 The possible levels are
739 .BR none ,
740 .BR disclose ,
741 .BR auth ,
742 .BR compare ,
743 .BR search ,
744 .BR read ,
745 .BR write ,
746 and
747 .BR manage .
748 Each access level implies all the preceding ones, thus 
749 .B manage
750 grants all access including administrative access.
751 The 
752 .BR write
753 access is actually the combination of
754 .BR add
755 and
756 .BR delete ,
757 which respectively restrict the write privilege to add or delete
758 the specified
759 .BR <what> .
760
761 .LP
762 The
763 .B none 
764 access level disallows all access including disclosure on error.
765 .LP
766 The
767 .B disclose
768 access level allows disclosure of information on error.
769 .LP
770 The 
771 .B auth
772 access level means that one is allowed access to an attribute to perform
773 authentication/authorization operations (e.g.
774 .BR bind )
775 with no other access.
776 This is useful to grant unauthenticated clients the least possible 
777 access level to critical resources, like passwords.
778 .LP
779 The
780 .B priv
781 access model relies on the explicit setting of access privileges
782 for each clause.
783 The
784 .B =
785 sign resets previously defined accesses; as a consequence, the final 
786 access privileges will be only those defined by the clause.
787 The 
788 .B +
789 and
790 .B -
791 signs add/remove access privileges to the existing ones.
792 The privileges are
793 .B m
794 for manage,
795 .B w
796 for write,
797 .B a
798 for add,
799 .B z
800 for delete,
801 .B r
802 for read,
803 .B s 
804 for search,
805 .B c 
806 for compare,
807 .B x
808 for authentication, and
809 .B d
810 for disclose.
811 More than one of the above privileges can be added in one statement.
812 .B 0
813 indicates no privileges and is used only by itself (e.g., +0).
814 Note that
815 .B +az
816 is equivalent to
817 .BR +w .
818 .LP
819 If no access is given, it defaults to 
820 .BR +0 .
821 .SH THE <CONTROL> FIELD
822 The optional field
823 .B <control>
824 controls the flow of access rule application.
825 It can have the forms
826 .LP
827 .nf
828         stop
829         continue
830         break
831 .fi
832 .LP
833 where
834 .BR stop ,
835 the default, means access checking stops in case of match.
836 The other two forms are used to keep on processing access clauses.
837 In detail, the
838 .B continue
839 form allows for other 
840 .B <who>
841 clauses in the same 
842 .B <access>
843 clause to be considered, so that they may result in incrementally altering
844 the privileges, while the
845 .B break
846 form allows for other
847 .B <access>
848 clauses that match the same target to be processed.
849 Consider the (silly) example
850 .LP
851 .nf
852         access to dn.subtree="dc=example,dc=com" attrs=cn
853                 by * =cs break
854
855         access to dn.subtree="ou=People,dc=example,dc=com"
856                 by * +r
857 .fi
858 .LP
859 which allows search and compare privileges to everybody under
860 the "dc=example,dc=com" tree, with the second rule allowing
861 also read in the "ou=People" subtree,
862 or the (even more silly) example
863 .LP
864 .nf
865         access to dn.subtree="dc=example,dc=com" attrs=cn
866                 by * =cs continue
867                 by users +r
868 .fi
869 .LP
870 which grants everybody search and compare privileges, and adds read
871 privileges to authenticated clients.
872 .LP
873 One useful application is to easily grant write privileges to an
874 .B updatedn
875 that is different from the
876 .BR rootdn .
877 In this case, since the
878 .B updatedn
879 needs write access to (almost) all data, one can use
880 .LP
881 .nf
882         access to *
883                 by dn.exact="cn=The Update DN,dc=example,dc=com" write
884                 by * break
885 .fi
886 .LP
887 as the first access rule.
888 As a consequence, unless the operation is performed with the 
889 .B updatedn
890 identity, control is passed straight to the subsequent rules.
891
892 .SH OPERATION REQUIREMENTS
893 Operations require different privileges on different portions of entries.
894 The following summary applies to primary database backends such as
895 the BDB and HDB backends.   Requirements for other backends may
896 (and often do) differ.
897
898 .LP
899 The
900 .B add
901 operation requires
902 .B add (=a)
903 privileges on the pseudo-attribute 
904 .B entry
905 of the entry being added, and 
906 .B add (=a)
907 privileges on the pseudo-attribute
908 .B children
909 of the entry's parent.
910 When adding the suffix entry of a database,
911 .B add
912 access to
913 .B children
914 of the empty DN ("") is required.
915
916 .LP
917 The 
918 .B bind
919 operation, when credentials are stored in the directory, requires 
920 .B auth (=x)
921 privileges on the attribute the credentials are stored in (usually
922 .BR userPassword ).
923
924 .LP
925 The
926 .B compare
927 operation requires 
928 .B compare (=c)
929 privileges on the attribute that is being compared.
930
931 .LP
932 The
933 .B delete
934 operation requires
935 .B delete (=z)
936 privileges on the pseudo-attribute
937 .B entry 
938 of the entry being deleted, and
939 .B delete (=d)
940 privileges on the
941 .B children
942 pseudo-attribute of the entry's parent.
943
944 .LP
945 The
946 .B modify
947 operation requires 
948 .B write (=w)
949 privileges on the attributes being modified.
950 In detail, 
951 .B add (=a)
952 is required to add new values,
953 .B delete (=z)
954 is required to delete existing values,
955 and both
956 .B delete
957 and
958 .BR "add (=az)" ,
959 or
960 .BR "write (=w)" ,
961 are required to replace existing values.
962
963 .LP
964 The
965 .B modrdn
966 operation requires
967 .B write (=w)
968 privileges on the pseudo-attribute
969 .B entry
970 of the entry whose relative DN is being modified,
971 .B delete (=z)
972 privileges on the pseudo-attribute
973 .B children
974 of the old entry's parents,
975 .B add (=a)
976 privileges on the pseudo-attribute
977 .B children
978 of the new entry's parents, and
979 .B add (=a)
980 privileges on the attributes that are present in the new relative DN.
981 .B Delete (=z)
982 privileges are also required on the attributes that are present 
983 in the old relative DN if 
984 .B deleteoldrdn
985 is set to 1.
986
987 .LP
988 The
989 .B search
990 operation, requires 
991 .B search (=s)
992 privileges on the 
993 .B entry
994 pseudo-attribute of the searchBase
995 (NOTE: this was introduced with OpenLDAP 2.4).
996 Then, for each entry, it requires
997 .B search (=s)
998 privileges on the attributes that are defined in the filter.
999 The resulting entries are finally tested for 
1000 .B read (=r)
1001 privileges on the pseudo-attribute
1002 .B entry
1003 (for read access to the entry itself)
1004 and for
1005 .B read (=r)
1006 access on each value of each attribute that is requested.
1007 Also, for each
1008 .B referral
1009 object used in generating continuation references, the operation requires
1010 .B read (=r)
1011 access on the pseudo-attribute
1012 .B entry
1013 (for read access to the referral object itself),
1014 as well as
1015 .B read (=r)
1016 access to the attribute holding the referral information
1017 (generally the
1018 .B ref
1019 attribute).
1020
1021 .LP
1022 Some internal operations and some
1023 .B controls
1024 require specific access privileges.
1025 The
1026 .B authzID
1027 mapping and the 
1028 .B proxyAuthz
1029 control require
1030 .B auth (=x)
1031 privileges on all the attributes that are present in the search filter
1032 of the URI regexp maps (the right-hand side of the
1033 .B authz-regexp
1034 directives).
1035 .B Auth (=x)
1036 privileges are also required on the
1037 .B authzTo
1038 attribute of the authorizing identity and/or on the 
1039 .B authzFrom
1040 attribute of the authorized identity.
1041 In general, when an internal lookup is performed for authentication
1042 or authorization purposes, search-specific privileges (see the access
1043 requirements for the search operation illustrated above) are relaxed to
1044 .BR auth .
1045
1046 .LP
1047 Access control to search entries is checked by the frontend,
1048 so it is fully honored by all backends; for all other operations
1049 and for the discovery phase of the search operation,
1050 full ACL semantics is only supported by the primary backends, i.e.
1051 .BR back-bdb (5),
1052 and
1053 .BR back-hdb (5).
1054
1055 Some other backend, like
1056 .BR back-sql (5),
1057 may fully support them; others may only support a portion of the 
1058 described semantics, or even differ in some aspects.
1059 The relevant details are described in the backend-specific man pages.
1060
1061 .SH CAVEATS
1062 It is strongly recommended to explicitly use the most appropriate
1063 .B <dnstyle>
1064 in
1065 .B <what>
1066 and
1067 .B <who>
1068 clauses, to avoid possible incorrect specifications of the access rules 
1069 as well as for performance (avoid unnecessary regex matching when an exact
1070 match suffices) reasons.
1071 .LP
1072 An administrator might create a rule of the form:
1073 .LP
1074 .nf
1075         access to dn.regex="dc=example,dc=com"
1076                 by ...
1077 .fi
1078 .LP
1079 expecting it to match all entries in the subtree "dc=example,dc=com".
1080 However, this rule actually matches any DN which contains anywhere
1081 the substring "dc=example,dc=com".  That is, the rule matches both
1082 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
1083 .LP
1084 To match the desired subtree, the rule would be more precisely
1085 written:
1086 .LP
1087 .nf
1088         access to dn.regex="^(.+,)?dc=example,dc=com$"
1089                 by ...
1090 .fi
1091 .LP
1092 For performance reasons, it would be better to use the subtree style.
1093 .LP
1094 .nf
1095         access to dn.subtree="dc=example,dc=com"
1096                 by ...
1097 .fi
1098 .LP
1099 When writing submatch rules, it may be convenient to avoid unnecessary
1100 .B regex
1101 .B <dnstyle>
1102 use; for instance, to allow access to the subtree of the user 
1103 that matches the
1104 .B <what>
1105 clause, one could use
1106 .LP
1107 .nf
1108         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1109                 by dn.regex="^uid=$2,dc=example,dc=com$$" write
1110                 by ...
1111 .fi
1112 .LP
1113 However, since all that is required in the 
1114 .B <by>
1115 clause is substring expansion, a more efficient solution is
1116 .LP
1117 .nf
1118         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1119                 by dn.exact,expand="uid=$2,dc=example,dc=com" write
1120                 by ...
1121 .fi
1122 .LP
1123 In fact, while a
1124 .B <dnstyle>
1125 of
1126 .B regex
1127 implies substring expansion, 
1128 .BR exact ,
1129 as well as all the other DN specific
1130 .B <dnstyle>
1131 values, does not, so it must be explicitly requested.
1132 .LP
1133 .SH FILES
1134 .TP
1135 ETCDIR/slapd.conf
1136 default slapd configuration file
1137 .SH SEE ALSO
1138 .BR slapd (8),
1139 .BR slapd-* (5),
1140 .BR slapacl (8),
1141 .BR regex (7),
1142 .BR re_format (7)
1143 .LP
1144 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
1145 .SH ACKNOWLEDGEMENTS
1146 .so ../Project