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.
6 slapd.access \- access configuration for slapd, the stand-alone LDAP daemon
12 file contains configuration information for the
14 daemon. This configuration file is also used by the SLAPD tools
26 file consists of a series of global configuration options that apply to
28 as a whole (including all backends), followed by zero or more database
29 backend definitions that contain information specific to a backend
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
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
54 If no access controls are present, the default policy
55 allows anyone and everyone to read anything but restricts
56 updates to rootdn. (e.g., "access to * by * read").
57 The rootdn can always read and write EVERYTHING!
59 For entries not held in any backend (such as a root DSE), the
60 global directives are used.
62 Arguments that should be replaced by actual text are shown in
64 .SH THE ACCESS DIRECTIVE
65 The structure of the access control directives is
67 .B access to <what> "[ by <who> [ <access> ] [ <control> ] ]+"
68 Grant access (specified by
70 to a set of entries and/or attributes (specified by
72 by one or more requestors (specified by
76 Lists of access directives are evaluated in the order they appear
80 clause matches the datum whose access is being evaluated, its
82 clause list is checked.
85 clause matches the accessor's properties, its
89 clauses are evaluated.
90 Access control checking stops at the first match of the
94 clause, unless otherwise dictated by the
99 clause list is implicitly terminated by a
105 clause that results in stopping the access control with no access
109 clause list is implicitly terminated by a
116 clause that results in granting no access privileges to an otherwise
121 specifies the entity the access control directive applies to.
122 It can have the forms
125 dn[.<dnstyle>]=<dnpattern>
127 attrs=<attrlist>[ val[/matchingRule][.<attrstyle>]=<attrval>]
133 <dnstyle>={{exact|base(object)}|regex
134 |one(level)|sub(tree)|children}
135 <attrlist>={<attr>|[{!|@}]<objectClass>}[,<attrlist>]
136 <attrstyle>={{exact|base(object)}|regex
137 |one(level)|sub(tree)|children}
142 selects the entries based on their naming context.
145 is a string representation of the entry's DN.
148 stands for all the entries, and it is implied if no
154 is optional; however, it is recommended to specify it to avoid ambiguities.
163 indicates the entry whose DN is equal to the
168 indicates all the entries immediately below the
173 indicates all entries in the subtree at the
176 indicates all the entries below (subordinate to) the
185 is a POSIX (''extended'') regular expression pattern,
190 matching a normalized string representation of the entry's DN.
191 The regex form of the pattern does not (yet) support UTF\-8.
194 .B filter=<ldapfilter>
195 selects the entries based on a valid LDAP filter as described in RFC 4515.
204 selects the attributes the access control rule applies to.
205 It is a comma-separated list of attribute types, plus the special names
207 indicating access to the entry itself, and
209 indicating access to the entry's children. ObjectClass names may also
210 be specified in this list, which will affect all the attributes that
211 are required and/or allowed by that objectClass.
216 are directly treated as objectClass names. A name prefixed by
218 is also treated as an objectClass, but in this case the access rule
219 affects the attributes that are not required nor allowed
224 .B attrs=@extensibleObject
225 is implied, i.e. all attributes are addressed.
228 .B attrs=<attr> val[/matchingRule][.<attrstyle>]=<attrval>
229 specifies access to a particular value of a single attribute.
230 In this case, only a single attribute type may be given. The
233 (the default) uses the attribute's equality matching rule to compare the
234 value, unless a different (and compatible) matching rule is specified. If the
238 the provided value is used as a POSIX (''extended'') regular
239 expression pattern. If the attribute has DN syntax, the
247 resulting in base, onelevel, subtree or children match, respectively.
249 The dn, filter, and attrs statements are additive; they can be used in sequence
250 to select entities the access rule applies to based on naming context,
251 value and attribute type simultaneously.
255 indicates whom the access rules apply to.
258 statements can appear in an access control statement, indicating the
259 different access privileges to the same resource that apply to different
261 It can have the forms
269 dn[.<dnstyle>[,<modifier>]]=<DN>
274 realself[.<selfstyle>]
276 realdn[.<dnstyle>[,<modifier>]]=<DN>
277 realdnattr=<attrname>
279 group[/<objectclass>[/<attrname>]]
280 [.<groupstyle>]=<group>
281 peername[.<peernamestyle>]=<peername>
282 sockname[.<style>]=<sockname>
283 domain[.<domainstyle>[,<modifier>]]=<domain>
284 sockurl[.<style>]=<sockurl>
285 set[.<setstyle>]=<pattern>
292 dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
298 <style>={exact|regex|expand}
299 <selfstyle>={level{<n>}}
300 <dnstyle>={{exact|base(object)}|regex
301 |one(level)|sub(tree)|children|level{<n>}}
302 <groupstyle>={exact|expand}
303 <peernamestyle>={<style>|ip|ipv6|path}
304 <domainstyle>={exact|regex|sub(tree)}
305 <setstyle>={exact|regex}
307 <name>=aci <pattern>=<attrname>]
310 They may be specified in combination.
319 The keywords prefixed by
321 act as their counterparts without prefix; the checking respectively occurs
322 with the \fIauthentication\fP DN and the \fIauthorization\fP DN.
326 means access is granted to unauthenticated clients; it is mostly used
327 to limit access to authentication resources (e.g. the
329 attribute) to unauthenticated clients for authentication purposes.
333 means access is granted to authenticated clients.
337 means access to an entry is allowed to the entry itself (e.g. the entry
338 being accessed and the requesting entry must be the same).
341 style, where \fI<n>\fP indicates what ancestor of the DN
342 is to be used in matches.
343 A positive value indicates that the <n>-th ancestor of the user's DN
344 is to be considered; a negative value indicates that the <n>-th ancestor
345 of the target is to be considered.
346 For example, a "\fIby self.level{1} ...\fP" clause would match
347 when the object "\fIdc=example,dc=com\fP" is accessed
348 by "\fIcn=User,dc=example,dc=com\fP".
349 A "\fIby self.level{-1} ...\fP" clause would match when the same user
350 accesses the object "\fIou=Address Book,cn=User,dc=example,dc=com\fP".
354 means that access is granted to the matching DN.
355 The optional style qualifier
357 allows the same choices of the dn form of the
359 field. In addition, the
361 style can exploit substring substitution of submatches in the
363 dn.regex clause by using the form
367 ranging from 0 to 9 (where 0 matches the entire string),
370 for submatches higher than 9.
371 Substring substitution from attribute value can
375 Since the dollar character is used to indicate a substring replacement,
376 the dollar character that is used to indicate match up to the end of
377 the string must be escaped by a second dollar character, e.g.
380 access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$"
381 by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write
387 At present, the only type allowed is
389 which causes substring substitution of submatches to take place
396 dnstyle in the above example may be of use only if the
398 clause needs to be a regex; otherwise, if the
399 value of the second (from the right)
401 portion of the DN in the above example were fixed, the form
404 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
405 by dn.exact,expand="uid=$2,dc=example,dc=com" write
408 could be used; if it had to match the value in the
413 access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$"
414 by dn.exact,expand="uid=$2,dc=$3,dc=com" write
421 clause other than regex may provide submatches as well.
432 as the match of the entire string.
441 as the match of the rightmost part of the DN as defined in the
444 This may be useful, for instance, to provide access to all the
445 ancestors of a user by defining
448 access to dn.subtree="dc=com"
449 by dn.subtree,expand="$1" read
452 which means that only access to entries that appear in the DN of the
458 form is an extension and a generalization of the
460 form, which matches all DNs whose <n>-th ancestor is the pattern.
461 So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP,
462 and \fIlevel{0}\fP is equivalent to \fIbase\fP.
464 It is perfectly useless to give any access privileges to a DN
465 that exactly matches the
467 of the database the ACLs apply to, because it implicitly
468 possesses write privileges for the entire tree of that database.
469 Actually, access control is bypassed for the
471 to solve the intrinsic chicken-and-egg problem.
475 means that access is granted to requests whose DN is listed in the
476 entry being accessed under the
482 means that access is granted to requests whose DN is listed
483 in the group entry whose DN is given by
485 The optional parameters
489 define the objectClass and the member attributeType of the group entry.
495 The optional style qualifier
501 will be expanded as a replacement string (but not as a regular expression)
508 which means that exact match will be used.
509 If the style of the DN portion of the
511 clause is regex, the submatches are made available according to
515 other styles provide limited submatches as discussed above about
520 For static groups, the specified attributeType must have
523 .B NameAndOptionalUID
524 syntax. For dynamic groups the attributeType must
527 attributeType. Only LDAP URIs of the form
528 .B ldap:///<base>??<scope>?<filter>
529 will be evaluated in a dynamic group, by searching the local server only.
532 .BR peername=<peername> ,
533 .BR sockname=<sockname> ,
534 .BR domain=<domain> ,
536 .BR sockurl=<sockurl>
537 mean that the contacting host IP (in the form
540 .BR "IP=[<ipv6>]:<port>"
542 or the contacting host named pipe file name (in the form
544 if connecting through a named pipe) for
546 the named pipe file name for
548 the contacting host name for
550 and the contacting URL for
557 rules for pattern match described for the
561 style, which implies submatch
563 and regex match of the corresponding connection parameters.
568 clause (the default) implies a case-exact match on the client's
572 prefix and the trailing
578 prefix if connecting through a named pipe.
581 style interprets the pattern as
582 .BR <peername>=<ip>[%<mask>][{<n>}] ,
587 are dotted digit representations of the IP and the mask, while
589 delimited by curly brackets, is an optional port.
590 The same applies to IPv6 addresses when the special
593 When checking access privileges, the IP portion of the
595 is extracted, eliminating the
599 part, and it is compared against the
601 portion of the pattern after masking with
603 \fI((peername & <mask>) == <ip>)\fP.
605 .B peername.ip=127.0.0.1
608 allow connections only from localhost,
609 .B peername.ip=192.168.1.0%255.255.255.0
610 allows connections from any IP in the 192.168.1 class C domain, and
611 .B peername.ip=192.168.1.16%255.255.255.240{9009}
612 allows connections from any IP in the 192.168.1.[16-31] range
613 of the same domain, only if port 9009 is used.
620 when connecting through a named pipe, and performs an exact match
621 on the given pattern.
624 clause also allows the
626 style, which succeeds when a fully qualified name exactly matches the
628 pattern, or its trailing part, after a
635 style is allowed, implying an
637 match with submatch expansion; the use of
639 as a style modifier is considered more appropriate.
641 .B domain.subtree=example.com
642 will match www.example.com, but will not match www.anotherexample.com.
645 of the contacting host is determined by performing a DNS reverse lookup.
646 As this lookup can easily be spoofed, use of the
648 statement is strongly discouraged. By default, reverse lookups are disabled.
655 option; the only value currently supported is
657 which causes substring substitution of submatches to take place even if
662 much like the analogous usage in
671 .B dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
672 means that access checking is delegated to the admin-defined method
675 which can be registered at run-time by means of the
683 are optional, and are directly passed to the registered parsing routine.
684 Dynacl is experimental; it must be enabled at compile time.
687 .B dynacl/aci[=<attrname>]
688 means that the access control is determined by the values in the
693 indicates what attributeType holds the ACI information in the entry.
696 operational attribute is used.
697 ACIs are experimental; they must be enabled at compile time.
701 .BR transport_ssf=<n> ,
705 set the minimum required Security Strength Factor (ssf) needed
706 to grant access. The value should be positive integer.
707 .SH THE <ACCESS> FIELD
709 .B <access> ::= [[real]self]{<level>|<priv>}
710 determines the access level or the specific access privileges the
713 Its component are defined as
716 <level> ::= none|disclose|auth|compare|search|read|{write|add|delete}|manage
717 <priv> ::= {=|+|-}{0|d|x|c|s|r|{w|a|z}|m}+
722 allows special operations like having a certain access level or privilege
723 only in case the operation involves the name of the user that's requesting
725 It implies the user that requests access is authorized.
728 refers to the authenticated DN as opposed to the authorized DN of the
733 access to the member attribute of a group, which allows one to add/delete
734 its own DN from the member list of a group, while being not allowed
735 to affect other members.
739 access model relies on an incremental interpretation of the access
741 The possible levels are
751 Each access level implies all the preceding ones, thus
753 grants all access including administrative access.
756 access is actually the combination of
760 which respectively restrict the write privilege to add or delete
767 access level disallows all access including disclosure on error.
771 access level allows disclosure of information on error.
775 access level means that one is allowed access to an attribute to perform
776 authentication/authorization operations (e.g.
778 with no other access.
779 This is useful to grant unauthenticated clients the least possible
780 access level to critical resources, like passwords.
784 access model relies on the explicit setting of access privileges
788 sign resets previously defined accesses; as a consequence, the final
789 access privileges will be only those defined by the clause.
794 signs add/remove access privileges to the existing ones.
811 for authentication, and
814 More than one of the above privileges can be added in one statement.
816 indicates no privileges and is used only by itself (e.g., +0).
822 If no access is given, it defaults to
824 .SH THE <CONTROL> FIELD
827 controls the flow of access rule application.
828 It can have the forms
838 the default, means access checking stops in case of match.
839 The other two forms are used to keep on processing access clauses.
842 form allows for other
846 clause to be considered, so that they may result in incrementally altering
847 the privileges, while the
849 form allows for other
851 clauses that match the same target to be processed.
852 Consider the (silly) example
855 access to dn.subtree="dc=example,dc=com" attrs=cn
858 access to dn.subtree="ou=People,dc=example,dc=com"
862 which allows search and compare privileges to everybody under
863 the "dc=example,dc=com" tree, with the second rule allowing
864 also read in the "ou=People" subtree,
865 or the (even more silly) example
868 access to dn.subtree="dc=example,dc=com" attrs=cn
873 which grants everybody search and compare privileges, and adds read
874 privileges to authenticated clients.
876 One useful application is to easily grant write privileges to an
878 that is different from the
880 In this case, since the
882 needs write access to (almost) all data, one can use
886 by dn.exact="cn=The Update DN,dc=example,dc=com" write
890 as the first access rule.
891 As a consequence, unless the operation is performed with the
893 identity, control is passed straight to the subsequent rules.
895 .SH OPERATION REQUIREMENTS
896 Operations require different privileges on different portions of entries.
897 The following summary applies to primary database backends such as
898 the BDB and HDB backends. Requirements for other backends may
899 (and often do) differ.
906 privileges on the pseudo-attribute
908 of the entry being added, and
910 privileges on the pseudo-attribute
912 of the entry's parent.
913 When adding the suffix entry of a database,
917 of the empty DN ("") is required. Also if
918 Add content ACL checking has been configured on
919 the database (see the
925 will be required on all of the attributes being added.
930 operation, when credentials are stored in the directory, requires
932 privileges on the attribute the credentials are stored in (usually
940 privileges on the attribute that is being compared.
947 privileges on the pseudo-attribute
949 of the entry being deleted, and
953 pseudo-attribute of the entry's parent.
960 privileges on the attributes being modified.
963 is required to add new values,
965 is required to delete existing values,
972 are required to replace existing values.
979 privileges on the pseudo-attribute
981 of the entry whose relative DN is being modified,
983 privileges on the pseudo-attribute
985 of the old entry's parents,
987 privileges on the pseudo-attribute
989 of the new entry's parents, and
991 privileges on the attributes that are present in the new relative DN.
993 privileges are also required on the attributes that are present
994 in the old relative DN if
1005 pseudo-attribute of the searchBase
1006 (NOTE: this was introduced with OpenLDAP 2.4).
1007 Then, for each entry, it requires
1009 privileges on the attributes that are defined in the filter.
1010 The resulting entries are finally tested for
1012 privileges on the pseudo-attribute
1014 (for read access to the entry itself)
1017 access on each value of each attribute that is requested.
1020 object used in generating continuation references, the operation requires
1022 access on the pseudo-attribute
1024 (for read access to the referral object itself),
1027 access to the attribute holding the referral information
1033 Some internal operations and some
1035 require specific access privileges.
1042 privileges on all the attributes that are present in the search filter
1043 of the URI regexp maps (the right-hand side of the
1047 privileges are also required on the
1049 attribute of the authorizing identity and/or on the
1051 attribute of the authorized identity.
1052 In general, when an internal lookup is performed for authentication
1053 or authorization purposes, search-specific privileges (see the access
1054 requirements for the search operation illustrated above) are relaxed to
1058 Access control to search entries is checked by the frontend,
1059 so it is fully honored by all backends; for all other operations
1060 and for the discovery phase of the search operation,
1061 full ACL semantics is only supported by the primary backends, i.e.
1066 Some other backend, like
1068 may fully support them; others may only support a portion of the
1069 described semantics, or even differ in some aspects.
1070 The relevant details are described in the backend-specific man pages.
1073 It is strongly recommended to explicitly use the most appropriate
1079 clauses, to avoid possible incorrect specifications of the access rules
1080 as well as for performance (avoid unnecessary regex matching when an exact
1081 match suffices) reasons.
1083 An administrator might create a rule of the form:
1086 access to dn.regex="dc=example,dc=com"
1090 expecting it to match all entries in the subtree "dc=example,dc=com".
1091 However, this rule actually matches any DN which contains anywhere
1092 the substring "dc=example,dc=com". That is, the rule matches both
1093 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
1095 To match the desired subtree, the rule would be more precisely
1099 access to dn.regex="^(.+,)?dc=example,dc=com$"
1103 For performance reasons, it would be better to use the subtree style.
1106 access to dn.subtree="dc=example,dc=com"
1110 When writing submatch rules, it may be convenient to avoid unnecessary
1113 use; for instance, to allow access to the subtree of the user
1116 clause, one could use
1119 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1120 by dn.regex="^uid=$2,dc=example,dc=com$$" write
1124 However, since all that is required in the
1126 clause is substring expansion, a more efficient solution is
1129 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1130 by dn.exact,expand="uid=$2,dc=example,dc=com" write
1138 implies substring expansion,
1140 as well as all the other DN specific
1142 values, does not, so it must be explicitly requested.
1147 default slapd configuration file
1155 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
1156 .SH ACKNOWLEDGEMENTS