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