]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
cleanup and document ITS#4781 commit
[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 <dnpattern>
147 is a string representation of the entry's DN.
148 The wildcard
149 .B *
150 stands for all the entries, and it is implied if no
151 .B dn
152 form is given.
153 .LP
154 The 
155 .B <dnstyle> 
156 is optional; however, it is recommended to specify it to avoid ambiguities.
157 .B Base 
158 (synonym of
159 .BR baseObject ),
160 the default,
161 or
162 .B exact 
163 (an alias of 
164 .BR base )
165 indicates the entry whose DN is equal to the
166 .BR <dnpattern> ;
167 .B one
168 (synonym of
169 .BR onelevel )
170 indicates all the entries immediately below the
171 .BR <dnpattern> ,
172 .B sub
173 (synonym of
174 .BR subtree )
175 indicates all entries in the subtree at the
176 .BR <dnpattern> ,
177 .B children
178 indicates all the entries below (subordinate to) the 
179 .BR <dnpattern> .
180 .LP
181 If the
182 .B <dnstyle>
183 qualifier is
184 .BR regex ,
185 then 
186 .B <dnpattern>
187 is a POSIX (''extended'') regular expression pattern,
188 as detailed in
189 .BR regex (7)
190 and/or
191 .BR re_format (7),
192 matching a normalized string representation of the entry's DN.
193 The regex form of the pattern does not (yet) support UTF\-8.
194 .LP
195 The statement
196 .B filter=<ldapfilter>
197 selects the entries based on a valid LDAP filter as described in RFC 4515.
198 A filter of
199 .B (objectClass=*)
200 is implied if no
201 .B filter
202 form is given.
203 .LP
204 The statement
205 .B attrs=<attrlist>
206 selects the attributes the access control rule applies to.
207 It is a comma-separated list of attribute types, plus the special names
208 .BR entry ,
209 indicating access to the entry itself, and
210 .BR children ,
211 indicating access to the entry's children. ObjectClass names may also
212 be specified in this list, which will affect all the attributes that
213 are required and/or allowed by that objectClass.
214 Actually, names in 
215 .B <attrlist>
216 that are prefixed by
217 .B @
218 are directly treated as objectClass names.  A name prefixed by
219 .B !
220 is also treated as an objectClass, but in this case the access rule
221 affects the attributes that are not required nor allowed 
222 by that objectClass.
223 If no
224 .B attrs
225 form is given, 
226 .B attrs=@extensibleObject
227 is implied, i.e. all attributes are addressed.
228 .LP
229 Using the form
230 .B attrs=<attr> val[/matchingRule][.<attrstyle>]=<attrval>
231 specifies access to a particular value of a single attribute.
232 In this case, only a single attribute type may be given. The
233 .B <attrstyle>
234 .B exact
235 (the default) uses the attribute's equality matching rule to compare the
236 value, unless a different (and compatible) matching rule is specified. If the
237 .B <attrstyle>
238 is
239 .BR regex ,
240 the provided value is used as a POSIX (''extended'') regular
241 expression pattern.  If the attribute has DN syntax, the 
242 .B <attrstyle>
243 can be any of
244 .BR base ,
245 .BR onelevel ,
246 .B subtree
247 or
248 .BR children ,
249 resulting in base, onelevel, subtree or children match, respectively.
250 .LP
251 The dn, filter, and attrs statements are additive; they can be used in sequence 
252 to select entities the access rule applies to based on naming context,
253 value and attribute type simultaneously.
254 .SH THE <WHO> FIELD
255 The field
256 .B <who>
257 indicates whom the access rules apply to.
258 Multiple 
259 .B <who>
260 statements can appear in an access control statement, indicating the
261 different access privileges to the same resource that apply to different
262 accessee.
263 It can have the forms
264 .LP
265 .nf
266         *
267         anonymous
268         users
269         self[.<selfstyle>]
270
271         dn[.<dnstyle>[,<modifier>]]=<DN>
272         dnattr=<attrname>
273
274         realanonymous
275         realusers
276         realself[.<selfstyle>]
277
278         realdn[.<dnstyle>[,<modifier>]]=<DN>
279         realdnattr=<attrname>
280
281         group[/<objectclass>[/<attrname>]]
282                 [.<groupstyle>]=<group>
283         peername[.<peernamestyle>]=<peername>
284         sockname[.<style>]=<sockname>
285         domain[.<domainstyle>[,<modifier>]]=<domain>
286         sockurl[.<style>]=<sockurl>
287         set[.<setstyle>]=<pattern>
288
289         ssf=<n>
290         transport_ssf=<n>
291         tls_ssf=<n>
292         sasl_ssf=<n>
293
294         dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
295 .fi
296 .LP
297 with
298 .LP
299 .nf
300         <style>={exact|regex|expand}
301         <selfstyle>={level{<n>}}
302         <dnstyle>={{exact|base(object)}|regex
303                 |one(level)|sub(tree)|children|level{<n>}}
304         <groupstyle>={exact|expand}
305         <peernamestyle>={<style>|ip|ipv6|path}
306         <domainstyle>={exact|regex|sub(tree)}
307         <setstyle>={exact|regex}
308         <modifier>={expand}
309         <name>=aci              <pattern>=<attrname>]
310 .fi
311 .LP
312 They may be specified in combination.
313 .LP
314 .nf
315 .fi
316 .LP
317 The wildcard
318 .B *
319 refers to everybody.
320 .LP
321 The keywords prefixed by
322 .B real
323 act as their counterparts without prefix; the checking respectively occurs
324 with the \fIauthentication\fP DN and the \fIauthorization\fP DN.
325 .LP
326 The keyword
327 .B anonymous
328 means access is granted to unauthenticated clients; it is mostly used 
329 to limit access to authentication resources (e.g. the
330 .B userPassword
331 attribute) to unauthenticated clients for authentication purposes.
332 .LP
333 The keyword
334 .B users
335 means access is granted to authenticated clients.
336 .LP
337 The keyword
338 .B self
339 means access to an entry is allowed to the entry itself (e.g. the entry
340 being accessed and the requesting entry must be the same).
341 It allows the 
342 .B level{<n>}
343 style, where \fI<n>\fP indicates what ancestor of the DN 
344 is to be used in matches.
345 A positive value indicates that the <n>-th ancestor of the user's DN
346 is to be considered; a negative value indicates that the <n>-th ancestor
347 of the target is to be considered.
348 For example, a "\fIby self.level{1} ...\fP" clause would match
349 when the object "\fIdc=example,dc=com\fP" is accessed
350 by "\fIcn=User,dc=example,dc=com\fP".
351 A "\fIby self.level{-1} ...\fP" clause would match when the same user
352 accesses the object "\fIou=Address Book,cn=User,dc=example,dc=com\fP".
353 .LP
354 The statement
355 .B dn=<DN>
356 means that access is granted to the matching DN.
357 The optional style qualifier
358 .B dnstyle
359 allows the same choices of the dn form of the
360 .B <what>
361 field.  In addition, the
362 .B regex
363 style can exploit substring substitution of submatches in the
364 .B <what>
365 dn.regex clause by using the form
366 .BR $<digit> ,
367 with 
368 .B digit
369 ranging from 0 to 9 (where 0 matches the entire string),
370 or the form
371 .BR ${<digit>+} ,
372 for submatches higher than 9.
373 Since the dollar character is used to indicate a substring replacement,
374 the dollar character that is used to indicate match up to the end of
375 the string must be escaped by a second dollar character, e.g.
376 .LP
377 .nf
378     access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$"
379         by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write
380 .fi
381 .LP
382 The style qualifier
383 allows an optional
384 .BR modifier .
385 At present, the only type allowed is 
386 .BR expand ,
387 which causes substring substitution of submatches to take place
388 even if 
389 .B dnstyle
390 is not 
391 .BR regex .
392 Note that the 
393 .B regex 
394 dnstyle in the above example may be of use only if the 
395 .B <by>
396 clause needs to be a regex; otherwise, if the
397 value of the second (from the right)
398 .B dc=
399 portion of the DN in the above example were fixed, the form
400 .LP
401 .nf
402     access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
403         by dn.exact,expand="uid=$2,dc=example,dc=com" write
404 .fi
405 .LP
406 could be used; if it had to match the value in the 
407 .B <what>
408 clause, the form
409 .LP
410 .nf
411     access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$"
412         by dn.exact,expand="uid=$2,dc=$3,dc=com" write
413 .fi
414 .LP
415 could be used.
416 .LP
417 Forms of the 
418 .B <what>
419 clause other than regex may provide submatches as well.
420 The 
421 .BR base(object) ,
422 the
423 .BR sub(tree) ,
424 the
425 .BR one(level) ,
426 and the
427 .BR children
428 forms provide
429 .B $0
430 as the match of the entire string.
431 The 
432 .BR sub(tree) ,
433 the
434 .BR one(level) ,
435 and the
436 .BR children
437 forms also provide
438 .B $1
439 as the match of the rightmost part of the DN as defined in the
440 .B <what>
441 clause.
442 This may be useful, for instance, to provide access to all the 
443 ancestors of a user by defining
444 .LP
445 .nf
446     access to dn.subtree="dc=com"
447         by dn.subtree,expand="$1" read
448 .fi
449 .LP
450 which means that only access to entries that appear in the DN of the
451 .B <by>
452 clause is allowed.
453 .LP
454 The 
455 .BR level{<n>}
456 form is an extension and a generalization of the
457 .BR onelevel
458 form, which matches all DNs whose <n>-th ancestor is the pattern.
459 So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP, 
460 and \fIlevel{0}\fP is equivalent to \fIbase\fP.
461 .LP
462 It is perfectly useless to give any access privileges to a DN 
463 that exactly matches the
464 .B rootdn
465 of the database the ACLs apply to, because it implicitly
466 possesses write privileges for the entire tree of that database.
467 Actually, access control is bypassed for the
468 .BR rootdn ,
469 to solve the intrinsic chicken-and-egg problem.
470 .LP
471 The statement
472 .B dnattr=<attrname>
473 means that access is granted to requests whose DN is listed in the
474 entry being accessed under the 
475 .B <attrname>
476 attribute.
477 .LP
478 The statement
479 .B group=<group>
480 means that access is granted to requests whose DN is listed
481 in the group entry whose DN is given by
482 .BR <group> .
483 The optional parameters
484 .B <objectclass>
485 and
486 .B <attrname>
487 define the objectClass and the member attributeType of the group entry.
488 The defaults are
489 .B groupOfNames
490 and
491 .BR member ,
492 respectively.
493 The optional style qualifier
494 .B <style>
495 can be
496 .BR expand ,
497 which means that
498 .B <group>
499 will be expanded as a replacement string (but not as a regular expression)
500 according to
501 .BR regex (7)
502 and/or
503 .BR re_format (7),
504 and
505 .BR exact ,
506 which means that exact match will be used.
507 If the style of the DN portion of the
508 .B <what>
509 clause is regex, the submatches are made available according to
510 .BR regex (7)
511 and/or
512 .BR re_format (7);
513 other styles provide limited submatches as discussed above about 
514 the DN form of the 
515 .B <by>
516 clause.
517 .LP
518 For static groups, the specified attributeType must have
519 .B DistinguishedName
520 or
521 .B NameAndOptionalUID
522 syntax. For dynamic groups the attributeType must
523 be a subtype of the
524 .B labeledURI
525 attributeType. Only LDAP URIs of the form
526 .B ldap:///<base>??<scope>?<filter>
527 will be evaluated in a dynamic group, by searching the local server only.
528 .LP
529 The statements
530 .BR peername=<peername> ,
531 .BR sockname=<sockname> ,
532 .BR domain=<domain> ,
533 and
534 .BR sockurl=<sockurl>
535 mean that the contacting host IP (in the form 
536 .BR "IP=<ip>:<port>"
537 for IPv4, or
538 .BR "IP=[<ipv6>]:<port>"
539 for IPv6)
540 or the contacting host named pipe file name (in the form
541 .B "PATH=<path>"
542 if connecting through a named pipe) for
543 .BR peername ,
544 the named pipe file name for
545 .BR sockname ,
546 the contacting host name for
547 .BR domain ,
548 and the contacting URL for
549 .BR sockurl
550 are compared against
551 .B pattern
552 to determine access.
553 The same
554 .B style
555 rules for pattern match described for the
556 .B group
557 case apply, plus the
558 .B regex
559 style, which implies submatch
560 .B expand
561 and regex match of the corresponding connection parameters.
562 The
563 .B exact
564 style of the
565 .BR <peername>
566 clause (the default) implies a case-exact match on the client's
567 .BR IP , 
568 including the
569 .B "IP="
570 prefix and the trailing
571 .BR ":<port>" , 
572 or the client's 
573 .BR path ,
574 including the
575 .B "PATH="
576 prefix if connecting through a named pipe.
577 The special
578 .B ip
579 style interprets the pattern as 
580 .BR <peername>=<ip>[%<mask>][{<n>}] ,
581 where
582 .B <ip>
583 and 
584 .B <mask>
585 are dotted digit representations of the IP and the mask, while
586 .BR <n> ,
587 delimited by curly brackets, is an optional port.
588 The same applies to IPv6 addresses when the special
589 .B ipv6
590 style is used.
591 When checking access privileges, the IP portion of the
592 .BR peername 
593 is extracted, eliminating the
594 .B "IP="
595 prefix and the
596 .B ":<port>"
597 part, and it is compared against the
598 .B <ip>
599 portion of the pattern after masking with
600 .BR <mask> .
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|manage
714         <priv> ::= {=|+|-}{m|w|r|s|c|x|d|0}+
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, without affecting other members.
732 .LP
733 The 
734 .B level 
735 access model relies on an incremental interpretation of the access
736 privileges.
737 The possible levels are
738 .BR none ,
739 .BR disclose ,
740 .BR auth ,
741 .BR compare ,
742 .BR search ,
743 .BR read ,
744 and
745 .BR write .
746 Each access level implies all the preceding ones, thus 
747 .B manage
748 grants all access including administrative access,
749 .LP
750 The
751 .B none 
752 access level disallows all access including disclosure on error.
753 .LP
754 The
755 .B disclose
756 access level allows disclosure of information on error.
757 .LP
758 The 
759 .B auth
760 access level means that one is allowed access to an attribute to perform
761 authentication/authorization operations (e.g.
762 .BR bind )
763 with no other access.
764 This is useful to grant unauthenticated clients the least possible 
765 access level to critical resources, like passwords.
766 .LP
767 The
768 .B priv
769 access model relies on the explicit setting of access privileges
770 for each clause.
771 The
772 .B =
773 sign resets previously defined accesses; as a consequence, the final 
774 access privileges will be only those defined by the clause.
775 The 
776 .B +
777 and
778 .B -
779 signs add/remove access privileges to the existing ones.
780 The privileges are
781 .B m
782 for manage,
783 .B w
784 for write,
785 .B r
786 for read,
787 .B s 
788 for search,
789 .B c 
790 for compare,
791 .B x
792 for authentication, and
793 .B d
794 for disclose.
795 More than one of the above privileges can be added in one statement.
796 .B 0
797 indicates no privileges and is used only by itself (e.g., +0).
798 .LP
799 If no access is given, it defaults to 
800 .BR +0 .
801 .SH THE <CONTROL> FIELD
802 The optional field
803 .B <control>
804 controls the flow of access rule application.
805 It can have the forms
806 .LP
807 .nf
808         stop
809         continue
810         break
811 .fi
812 .LP
813 where
814 .BR stop ,
815 the default, means access checking stops in case of match.
816 The other two forms are used to keep on processing access clauses.
817 In detail, the
818 .B continue
819 form allows for other 
820 .B <who>
821 clauses in the same 
822 .B <access>
823 clause to be considered, so that they may result in incrementally altering
824 the privileges, while the
825 .B break
826 form allows for other
827 .B <access>
828 clauses that match the same target to be processed.
829 Consider the (silly) example
830 .LP
831 .nf
832         access to dn.subtree="dc=example,dc=com" attrs=cn
833                 by * =cs break
834
835         access to dn.subtree="ou=People,dc=example,dc=com"
836                 by * +r
837 .fi
838 .LP
839 which allows search and compare privileges to everybody under
840 the "dc=example,dc=com" tree, with the second rule allowing
841 also read in the "ou=People" subtree,
842 or the (even more silly) example
843 .LP
844 .nf
845         access to dn.subtree="dc=example,dc=com" attrs=cn
846                 by * =cs continue
847                 by users +r
848 .fi
849 .LP
850 which grants everybody search and compare privileges, and adds read
851 privileges to authenticated clients.
852 .LP
853 One useful application is to easily grant write privileges to an
854 .B updatedn
855 that is different from the
856 .BR rootdn .
857 In this case, since the
858 .B updatedn
859 needs write access to (almost) all data, one can use
860 .LP
861 .nf
862         access to *
863                 by dn.exact="cn=The Update DN,dc=example,dc=com" write
864                 by * break
865 .fi
866 .LP
867 as the first access rule.
868 As a consequence, unless the operation is performed with the 
869 .B updatedn
870 identity, control is passed straight to the subsequent rules.
871
872 .SH OPERATION REQUIREMENTS
873 Operations require different privileges on different portions of entries.
874 The following summary applies to primary database backends such as
875 the BDB and HDB backends.   Requirements for other backends may
876 (and often do) differ.
877
878 .LP
879 The
880 .B add
881 operation requires
882 .B write (=w)
883 privileges on the pseudo-attribute 
884 .B entry
885 of the entry being added, and 
886 .B write (=w)
887 privileges on the pseudo-attribute
888 .B children
889 of the entry's parent.
890 When adding the suffix entry of a database, write access to
891 .B children
892 of the empty DN ("") is required.
893
894 .LP
895 The 
896 .B bind
897 operation, when credentials are stored in the directory, requires 
898 .B auth (=x)
899 privileges on the attribute the credentials are stored in (usually
900 .BR userPassword ).
901
902 .LP
903 The
904 .B compare
905 operation requires 
906 .B compare (=c)
907 privileges on the attribute that is being compared.
908
909 .LP
910 The
911 .B delete
912 operation requires
913 .B write (=w)
914 privileges on the pseudo-attribute
915 .B entry 
916 of the entry being deleted, and
917 .B write (=w)
918 privileges on the
919 .B children
920 pseudo-attribute of the entry's parent.
921
922 .LP
923 The
924 .B modify
925 operation requires 
926 .B write (=w)
927 privileges on the attributes being modified.
928
929 .LP
930 The
931 .B modrdn
932 operation requires
933 .B write (=w)
934 privileges on the pseudo-attribute
935 .B entry
936 of the entry whose relative DN is being modified,
937 .B write (=w)
938 privileges on the pseudo-attribute
939 .B children
940 of the old and new entry's parents, and
941 .B write (=w)
942 privileges on the attributes that are present in the new relative DN.
943 .B Write (=w)
944 privileges are also required on the attributes that are present 
945 in the old relative DN if 
946 .B deleteoldrdn
947 is set to 1.
948
949 .LP
950 The
951 .B search
952 operation, requires 
953 .B search (=s)
954 privileges on the 
955 .B entry
956 pseudo-attribute of the searchBase (NOTE: this was introduced with 2.3).
957 Then, for each entry, it requires
958 .B search (=s)
959 privileges on the attributes that are defined in the filter.
960 The resulting entries are finally tested for 
961 .B read (=r)
962 privileges on the pseudo-attribute
963 .B entry
964 (for read access to the entry itself)
965 and for
966 .B read (=r)
967 access on each value of each attribute that is requested.
968 Also, for each
969 .B referral
970 object used in generating continuation references, the operation requires
971 .B read (=r)
972 access on the pseudo-attribute
973 .B entry
974 (for read access to the referral object itself),
975 as well as
976 .B read (=r)
977 access to the attribute holding the referral information
978 (generally the
979 .B ref
980 attribute).
981
982 .LP
983 Some internal operations and some
984 .B controls
985 require specific access privileges.
986 The
987 .B authzID
988 mapping and the 
989 .B proxyAuthz
990 control require
991 .B auth (=x)
992 privileges on all the attributes that are present in the search filter
993 of the URI regexp maps (the right-hand side of the
994 .B authz-regexp
995 directives).
996 .B Auth (=x)
997 privileges are also required on the
998 .B authzTo
999 attribute of the authorizing identity and/or on the 
1000 .B authzFrom
1001 attribute of the authorized identity.
1002
1003 .LP
1004 Access control to search entries is checked by the frontend,
1005 so it is fully honored by all backends; for all other operations
1006 and for the discovery phase of the search operation,
1007 full ACL semantics is only supported by the primary backends, i.e.
1008 .BR back-bdb (5),
1009 and
1010 .BR back-hdb (5).
1011
1012 Some other backend, like
1013 .BR back-sql (5),
1014 may fully support them; others may only support a portion of the 
1015 described semantics, or even differ in some aspects.
1016 The relevant details are described in the backend-specific man pages.
1017
1018 .SH CAVEATS
1019 It is strongly recommended to explicitly use the most appropriate
1020 .B <dnstyle>
1021 in
1022 .B <what>
1023 and
1024 .B <who>
1025 clauses, to avoid possible incorrect specifications of the access rules 
1026 as well as for performance (avoid unnecessary regex matching when an exact
1027 match suffices) reasons.
1028 .LP
1029 An administrator might create a rule of the form:
1030 .LP
1031 .nf
1032         access to dn.regex="dc=example,dc=com"
1033                 by ...
1034 .fi
1035 .LP
1036 expecting it to match all entries in the subtree "dc=example,dc=com".
1037 However, this rule actually matches any DN which contains anywhere
1038 the substring "dc=example,dc=com".  That is, the rule matches both
1039 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
1040 .LP
1041 To match the desired subtree, the rule would be more precisely
1042 written:
1043 .LP
1044 .nf
1045         access to dn.regex="^(.+,)?dc=example,dc=com$"
1046                 by ...
1047 .fi
1048 .LP
1049 For performance reasons, it would be better to use the subtree style.
1050 .LP
1051 .nf
1052         access to dn.subtree="dc=example,dc=com"
1053                 by ...
1054 .fi
1055 .LP
1056 When writing submatch rules, it may be convenient to avoid unnecessary
1057 .B regex
1058 .B <dnstyle>
1059 use; for instance, to allow access to the subtree of the user 
1060 that matches the
1061 .B <what>
1062 clause, one could use
1063 .LP
1064 .nf
1065         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1066                 by dn.regex="^uid=$2,dc=example,dc=com$$" write
1067                 by ...
1068 .fi
1069 .LP
1070 However, since all that is required in the 
1071 .B <by>
1072 clause is substring expansion, a more efficient solution is
1073 .LP
1074 .nf
1075         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1076                 by dn.exact,expand="uid=$2,dc=example,dc=com" write
1077                 by ...
1078 .fi
1079 .LP
1080 In fact, while a
1081 .B <dnstyle>
1082 of
1083 .B regex
1084 implies substring expansion, 
1085 .BR exact ,
1086 as well as all the other DN specific
1087 .B <dnstyle>
1088 values, does not, so it must be explicitly requested.
1089 .LP
1090 .SH FILES
1091 .TP
1092 ETCDIR/slapd.conf
1093 default slapd configuration file
1094 .SH SEE ALSO
1095 .BR slapd (8),
1096 .BR slapd-* (5),
1097 .BR slapacl (8),
1098 .BR regex (7),
1099 .BR re_format (7)
1100 .LP
1101 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
1102 .SH ACKNOWLEDGEMENTS
1103 .B OpenLDAP
1104 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
1105 .B OpenLDAP
1106 is derived from University of Michigan LDAP 3.3 Release.