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