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