1 .TH SLAPD.ACCESS 5 "2008/07/16" "OpenLDAP 2.4.11"
2 .\" Copyright 1998-2008 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP: pkg/ldap/doc/man/man5/slapd.access.5,v 1.70.2.10 2008/07/09 00:48:35 quanah Exp $
6 slapd.access \- access configuration for slapd, the stand-alone LDAP daemon
8 /etc/openldap/slapd.conf
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 directives of the first backend (and any global directives) are
63 Arguments that should be replaced by actual text are shown in
65 .SH THE ACCESS DIRECTIVE
66 The structure of the access control directives is
68 .B access to <what> "[ by <who> [ <access> ] [ <control> ] ]+"
69 Grant access (specified by
71 to a set of entries and/or attributes (specified by
73 by one or more requestors (specified by
77 Lists of access directives are evaluated in the order they appear
81 clause matches the datum whose access is being evaluated, its
83 clause list is checked.
86 clause matches the accessor's properties, its
90 clauses are evaluated.
91 Access control checking stops at the first match of the
95 clause, unless otherwise dictated by the
100 clause list is implicitly terminated by a
106 clause that results in stopping the access control with no access
110 clause list is implicitly terminated by a
117 clause that results in granting no access privileges to an otherwise
122 specifies the entity the access control directive applies to.
123 It can have the forms
126 dn[.<dnstyle>]=<dnpattern>
128 attrs=<attrlist>[ val[/matchingRule][.<attrstyle>]=<attrval>]
134 <dnstyle>={{exact|base(object)}|regex
135 |one(level)|sub(tree)|children}
136 <attrlist>={<attr>|[{!|@}]<objectClass>}[,<attrlist>]
137 <attrstyle>={{exact|base(object)}|regex
138 |one(level)|sub(tree)|children}
143 selects the entries based on their naming context.
146 is a string representation of the entry's DN.
149 stands for all the entries, and it is implied if no
155 is optional; however, it is recommended to specify it to avoid ambiguities.
164 indicates the entry whose DN is equal to the
169 indicates all the entries immediately below the
174 indicates all entries in the subtree at the
177 indicates all the entries below (subordinate to) the
186 is a POSIX (''extended'') regular expression pattern,
191 matching a normalized string representation of the entry's DN.
192 The regex form of the pattern does not (yet) support UTF\-8.
195 .B filter=<ldapfilter>
196 selects the entries based on a valid LDAP filter as described in RFC 4515.
205 selects the attributes the access control rule applies to.
206 It is a comma-separated list of attribute types, plus the special names
208 indicating access to the entry itself, and
210 indicating access to the entry's children. ObjectClass names may also
211 be specified in this list, which will affect all the attributes that
212 are required and/or allowed by that objectClass.
217 are directly treated as objectClass names. A name prefixed by
219 is also treated as an objectClass, but in this case the access rule
220 affects the attributes that are not required nor allowed
225 .B attrs=@extensibleObject
226 is implied, i.e. all attributes are addressed.
229 .B attrs=<attr> val[/matchingRule][.<attrstyle>]=<attrval>
230 specifies access to a particular value of a single attribute.
231 In this case, only a single attribute type may be given. The
234 (the default) uses the attribute's equality matching rule to compare the
235 value, unless a different (and compatible) matching rule is specified. If the
239 the provided value is used as a POSIX (''extended'') regular
240 expression pattern. If the attribute has DN syntax, the
248 resulting in base, onelevel, subtree or children match, respectively.
250 The dn, filter, and attrs statements are additive; they can be used in sequence
251 to select entities the access rule applies to based on naming context,
252 value and attribute type simultaneously.
256 indicates whom the access rules apply to.
259 statements can appear in an access control statement, indicating the
260 different access privileges to the same resource that apply to different
262 It can have the forms
270 dn[.<dnstyle>[,<modifier>]]=<DN>
275 realself[.<selfstyle>]
277 realdn[.<dnstyle>[,<modifier>]]=<DN>
278 realdnattr=<attrname>
280 group[/<objectclass>[/<attrname>]]
281 [.<groupstyle>]=<group>
282 peername[.<peernamestyle>]=<peername>
283 sockname[.<style>]=<sockname>
284 domain[.<domainstyle>[,<modifier>]]=<domain>
285 sockurl[.<style>]=<sockurl>
286 set[.<setstyle>]=<pattern>
293 dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
299 <style>={exact|regex|expand}
300 <selfstyle>={level{<n>}}
301 <dnstyle>={{exact|base(object)}|regex
302 |one(level)|sub(tree)|children|level{<n>}}
303 <groupstyle>={exact|expand}
304 <peernamestyle>={<style>|ip|ipv6|path}
305 <domainstyle>={exact|regex|sub(tree)}
306 <setstyle>={exact|regex}
308 <name>=aci <pattern>=<attrname>]
311 They may be specified in combination.
320 The keywords prefixed by
322 act as their counterparts without prefix; the checking respectively occurs
323 with the \fIauthentication\fP DN and the \fIauthorization\fP DN.
327 means access is granted to unauthenticated clients; it is mostly used
328 to limit access to authentication resources (e.g. the
330 attribute) to unauthenticated clients for authentication purposes.
334 means access is granted to authenticated clients.
338 means access to an entry is allowed to the entry itself (e.g. the entry
339 being accessed and the requesting entry must be the same).
342 style, where \fI<n>\fP indicates what ancestor of the DN
343 is to be used in matches.
344 A positive value indicates that the <n>-th ancestor of the user's DN
345 is to be considered; a negative value indicates that the <n>-th ancestor
346 of the target is to be considered.
347 For example, a "\fIby self.level{1} ...\fP" clause would match
348 when the object "\fIdc=example,dc=com\fP" is accessed
349 by "\fIcn=User,dc=example,dc=com\fP".
350 A "\fIby self.level{-1} ...\fP" clause would match when the same user
351 accesses the object "\fIou=Address Book,cn=User,dc=example,dc=com\fP".
355 means that access is granted to the matching DN.
356 The optional style qualifier
358 allows the same choices of the dn form of the
360 field. In addition, the
362 style can exploit substring substitution of submatches in the
364 dn.regex clause by using the form
368 ranging from 0 to 9 (where 0 matches the entire string),
371 for submatches higher than 9.
372 Since the dollar character is used to indicate a substring replacement,
373 the dollar character that is used to indicate match up to the end of
374 the string must be escaped by a second dollar character, e.g.
377 access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$"
378 by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write
384 At present, the only type allowed is
386 which causes substring substitution of submatches to take place
393 dnstyle in the above example may be of use only if the
395 clause needs to be a regex; otherwise, if the
396 value of the second (from the right)
398 portion of the DN in the above example were fixed, the form
401 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
402 by dn.exact,expand="uid=$2,dc=example,dc=com" write
405 could be used; if it had to match the value in the
410 access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$"
411 by dn.exact,expand="uid=$2,dc=$3,dc=com" write
418 clause other than regex may provide submatches as well.
429 as the match of the entire string.
438 as the match of the rightmost part of the DN as defined in the
441 This may be useful, for instance, to provide access to all the
442 ancestors of a user by defining
445 access to dn.subtree="dc=com"
446 by dn.subtree,expand="$1" read
449 which means that only access to entries that appear in the DN of the
455 form is an extension and a generalization of the
457 form, which matches all DNs whose <n>-th ancestor is the pattern.
458 So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP,
459 and \fIlevel{0}\fP is equivalent to \fIbase\fP.
461 It is perfectly useless to give any access privileges to a DN
462 that exactly matches the
464 of the database the ACLs apply to, because it implicitly
465 possesses write privileges for the entire tree of that database.
466 Actually, access control is bypassed for the
468 to solve the intrinsic chicken-and-egg problem.
472 means that access is granted to requests whose DN is listed in the
473 entry being accessed under the
479 means that access is granted to requests whose DN is listed
480 in the group entry whose DN is given by
482 The optional parameters
486 define the objectClass and the member attributeType of the group entry.
492 The optional style qualifier
498 will be expanded as a replacement string (but not as a regular expression)
505 which means that exact match will be used.
506 If the style of the DN portion of the
508 clause is regex, the submatches are made available according to
512 other styles provide limited submatches as discussed above about
517 For static groups, the specified attributeType must have
520 .B NameAndOptionalUID
521 syntax. For dynamic groups the attributeType must
524 attributeType. Only LDAP URIs of the form
525 .B ldap:///<base>??<scope>?<filter>
526 will be evaluated in a dynamic group, by searching the local server only.
529 .BR peername=<peername> ,
530 .BR sockname=<sockname> ,
531 .BR domain=<domain> ,
533 .BR sockurl=<sockurl>
534 mean that the contacting host IP (in the form
537 .BR "IP=[<ipv6>]:<port>"
539 or the contacting host named pipe file name (in the form
541 if connecting through a named pipe) for
543 the named pipe file name for
545 the contacting host name for
547 and the contacting URL for
554 rules for pattern match described for the
558 style, which implies submatch
560 and regex match of the corresponding connection parameters.
565 clause (the default) implies a case-exact match on the client's
569 prefix and the trailing
575 prefix if connecting through a named pipe.
578 style interprets the pattern as
579 .BR <peername>=<ip>[%<mask>][{<n>}] ,
584 are dotted digit representations of the IP and the mask, while
586 delimited by curly brackets, is an optional port.
587 The same applies to IPv6 addresses when the special
590 When checking access privileges, the IP portion of the
592 is extracted, eliminating the
596 part, and it is compared against the
598 portion of the pattern after masking with
600 \fI((peername & <mask>) == <ip>)\fP.
602 .B peername.ip=127.0.0.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.
617 when connecting through a named pipe, and performs an exact match
618 on the given pattern.
621 clause also allows the
623 style, which succeeds when a fully qualified name exactly matches the
625 pattern, or its trailing part, after a
632 style is allowed, implying an
634 match with submatch expansion; the use of
636 as a style modifier is considered more appropriate.
638 .B domain.subtree=example.com
639 will match www.example.com, but will not match www.anotherexample.com.
642 of the contacting host is determined by performing a DNS reverse lookup.
643 As this lookup can easily be spoofed, use of the
645 statement is strongly discouraged. By default, reverse lookups are disabled.
652 option; the only value currently supported is
654 which causes substring substitution of submatches to take place even if
659 much like the analogous usage in
668 .B dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
669 means that access checking is delegated to the admin-defined method
672 which can be registered at run-time by means of the
680 are optional, and are directly passed to the registered parsing routine.
681 Dynacl is experimental; it must be enabled at compile time.
684 .B dynacl/aci[=<attrname>]
685 means that the access control is determined by the values in the
690 indicates what attributeType holds the ACI information in the entry.
693 operational attribute is used.
694 ACIs are experimental; they must be enabled at compile time.
698 .BR transport_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
706 .B <access> ::= [[real]self]{<level>|<priv>}
707 determines the access level or the specific access privileges the
710 Its component are defined as
713 <level> ::= none|disclose|auth|compare|search|read|{write|add|delete}|manage
714 <priv> ::= {=|+|-}{0|d|x|c|s|r|{w|a|z}|m}+
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
722 It implies the user that requests access is authorized.
725 refers to the authenticated DN as opposed to the authorized DN of the
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.
735 access model relies on an incremental interpretation of the access
737 The possible levels are
747 Each access level implies all the preceding ones, thus
749 grants all access including administrative access.
752 access is actually the combination of
756 which respectively restrict the write privilege to add or delete
763 access level disallows all access including disclosure on error.
767 access level allows disclosure of information on error.
771 access level means that one is allowed access to an attribute to perform
772 authentication/authorization operations (e.g.
774 with no other access.
775 This is useful to grant unauthenticated clients the least possible
776 access level to critical resources, like passwords.
780 access model relies on the explicit setting of access privileges
784 sign resets previously defined accesses; as a consequence, the final
785 access privileges will be only those defined by the clause.
790 signs add/remove access privileges to the existing ones.
807 for authentication, and
810 More than one of the above privileges can be added in one statement.
812 indicates no privileges and is used only by itself (e.g., +0).
818 If no access is given, it defaults to
820 .SH THE <CONTROL> FIELD
823 controls the flow of access rule application.
824 It can have the forms
834 the default, means access checking stops in case of match.
835 The other two forms are used to keep on processing access clauses.
838 form allows for other
842 clause to be considered, so that they may result in incrementally altering
843 the privileges, while the
845 form allows for other
847 clauses that match the same target to be processed.
848 Consider the (silly) example
851 access to dn.subtree="dc=example,dc=com" attrs=cn
854 access to dn.subtree="ou=People,dc=example,dc=com"
858 which allows search and compare privileges to everybody under
859 the "dc=example,dc=com" tree, with the second rule allowing
860 also read in the "ou=People" subtree,
861 or the (even more silly) example
864 access to dn.subtree="dc=example,dc=com" attrs=cn
869 which grants everybody search and compare privileges, and adds read
870 privileges to authenticated clients.
872 One useful application is to easily grant write privileges to an
874 that is different from the
876 In this case, since the
878 needs write access to (almost) all data, one can use
882 by dn.exact="cn=The Update DN,dc=example,dc=com" write
886 as the first access rule.
887 As a consequence, unless the operation is performed with the
889 identity, control is passed straight to the subsequent rules.
891 .SH OPERATION REQUIREMENTS
892 Operations require different privileges on different portions of entries.
893 The following summary applies to primary database backends such as
894 the BDB and HDB backends. Requirements for other backends may
895 (and often do) differ.
902 privileges on the pseudo-attribute
904 of the entry being added, and
906 privileges on the pseudo-attribute
908 of the entry's parent.
909 When adding the suffix entry of a database,
913 of the empty DN ("") is required.
918 operation, when credentials are stored in the directory, requires
920 privileges on the attribute the credentials are stored in (usually
928 privileges on the attribute that is being compared.
935 privileges on the pseudo-attribute
937 of the entry being deleted, and
941 pseudo-attribute of the entry's parent.
948 privileges on the attributes being modified.
951 is required to add new values,
953 is required to delete existing values,
960 are required to replace existing values.
967 privileges on the pseudo-attribute
969 of the entry whose relative DN is being modified,
971 privileges on the pseudo-attribute
973 of the old entry's parents,
975 privileges on the pseudo-attribute
977 of the new entry's parents, and
979 privileges on the attributes that are present in the new relative DN.
981 privileges are also required on the attributes that are present
982 in the old relative DN if
993 pseudo-attribute of the searchBase
994 (NOTE: this was introduced with OpenLDAP 2.4).
995 Then, for each entry, it requires
997 privileges on the attributes that are defined in the filter.
998 The resulting entries are finally tested for
1000 privileges on the pseudo-attribute
1002 (for read access to the entry itself)
1005 access on each value of each attribute that is requested.
1008 object used in generating continuation references, the operation requires
1010 access on the pseudo-attribute
1012 (for read access to the referral object itself),
1015 access to the attribute holding the referral information
1021 Some internal operations and some
1023 require specific access privileges.
1030 privileges on all the attributes that are present in the search filter
1031 of the URI regexp maps (the right-hand side of the
1035 privileges are also required on the
1037 attribute of the authorizing identity and/or on the
1039 attribute of the authorized identity.
1040 In general, when an internal lookup is performed for authentication
1041 or authorization purposes, search-specific privileges (see the access
1042 requirements for the search operation illustrated above) are relaxed to
1046 Access control to search entries is checked by the frontend,
1047 so it is fully honored by all backends; for all other operations
1048 and for the discovery phase of the search operation,
1049 full ACL semantics is only supported by the primary backends, i.e.
1054 Some other backend, like
1056 may fully support them; others may only support a portion of the
1057 described semantics, or even differ in some aspects.
1058 The relevant details are described in the backend-specific man pages.
1061 It is strongly recommended to explicitly use the most appropriate
1067 clauses, to avoid possible incorrect specifications of the access rules
1068 as well as for performance (avoid unnecessary regex matching when an exact
1069 match suffices) reasons.
1071 An administrator might create a rule of the form:
1074 access to dn.regex="dc=example,dc=com"
1078 expecting it to match all entries in the subtree "dc=example,dc=com".
1079 However, this rule actually matches any DN which contains anywhere
1080 the substring "dc=example,dc=com". That is, the rule matches both
1081 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
1083 To match the desired subtree, the rule would be more precisely
1087 access to dn.regex="^(.+,)?dc=example,dc=com$"
1091 For performance reasons, it would be better to use the subtree style.
1094 access to dn.subtree="dc=example,dc=com"
1098 When writing submatch rules, it may be convenient to avoid unnecessary
1101 use; for instance, to allow access to the subtree of the user
1104 clause, one could use
1107 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1108 by dn.regex="^uid=$2,dc=example,dc=com$$" write
1112 However, since all that is required in the
1114 clause is substring expansion, a more efficient solution is
1117 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1118 by dn.exact,expand="uid=$2,dc=example,dc=com" write
1126 implies substring expansion,
1128 as well as all the other DN specific
1130 values, does not, so it must be explicitly requested.
1134 /etc/openldap/slapd.conf
1135 default slapd configuration file
1143 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
1144 .SH ACKNOWLEDGEMENTS
1145 .\" Shared Project Acknowledgement Text
1146 .B "OpenLDAP Software"
1147 is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>.
1148 .B "OpenLDAP Software"
1149 is derived from University of Michigan LDAP 3.3 Release.