1 .TH SLAPD.ACCESS 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2013 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").
58 When dealing with an access list, because the global access list is
59 effectively appended to each per-database list, if the resulting
60 list is non-empty then the access list will end with an implicit
61 .B access to * by * none
62 directive. If there are no access directives applicable to a backend,
63 then a default read is used.
65 .B Be warned: the rootdn can always read and write EVERYTHING!
67 For entries not held in any backend (such as a root DSE), the
68 global directives are used.
70 Arguments that should be replaced by actual text are shown in
72 .SH THE ACCESS DIRECTIVE
73 The structure of the access control directives is
75 .B access to <what> "[ by <who> [ <access> ] [ <control> ] ]+"
76 Grant access (specified by
78 to a set of entries and/or attributes (specified by
80 by one or more requestors (specified by
84 Lists of access directives are evaluated in the order they appear
88 clause matches the datum whose access is being evaluated, its
90 clause list is checked.
93 clause matches the accessor's properties, its
97 clauses are evaluated.
98 Access control checking stops at the first match of the
102 clause, unless otherwise dictated by the
107 clause list is implicitly terminated by a
113 clause that results in stopping the access control with no access
117 clause list is implicitly terminated by a
124 clause that results in granting no access privileges to an otherwise
129 specifies the entity the access control directive applies to.
130 It can have the forms
133 dn[.<dnstyle>]=<dnpattern>
135 attrs=<attrlist>[ val[/matchingRule][.<attrstyle>]=<attrval>]
141 <dnstyle>={{exact|base(object)}|regex
142 |one(level)|sub(tree)|children}
143 <attrlist>={<attr>|[{!|@}]<objectClass>}[,<attrlist>]
144 <attrstyle>={{exact|base(object)}|regex
145 |one(level)|sub(tree)|children}
150 selects the entries based on their naming context.
153 is a string representation of the entry's DN.
156 stands for all the entries, and it is implied if no
162 is optional; however, it is recommended to specify it to avoid ambiguities.
171 indicates the entry whose DN is equal to the
176 indicates all the entries immediately below the
181 indicates all entries in the subtree at the
184 indicates all the entries below (subordinate to) the
193 is a POSIX (''extended'') regular expression pattern,
198 matching a normalized string representation of the entry's DN.
199 The regex form of the pattern does not (yet) support UTF-8.
202 .B filter=<ldapfilter>
203 selects the entries based on a valid LDAP filter as described in RFC 4515.
212 selects the attributes the access control rule applies to.
213 It is a comma-separated list of attribute types, plus the special names
215 indicating access to the entry itself, and
217 indicating access to the entry's children. ObjectClass names may also
218 be specified in this list, which will affect all the attributes that
219 are required and/or allowed by that objectClass.
224 are directly treated as objectClass names. A name prefixed by
226 is also treated as an objectClass, but in this case the access rule
227 affects the attributes that are not required nor allowed
232 .B attrs=@extensibleObject
233 is implied, i.e. all attributes are addressed.
236 .B attrs=<attr> val[/matchingRule][.<attrstyle>]=<attrval>
237 specifies access to a particular value of a single attribute.
238 In this case, only a single attribute type may be given. The
241 (the default) uses the attribute's equality matching rule to compare the
242 value, unless a different (and compatible) matching rule is specified. If the
246 the provided value is used as a POSIX (''extended'') regular
247 expression pattern. If the attribute has DN syntax, the
255 resulting in base, onelevel, subtree or children match, respectively.
257 The dn, filter, and attrs statements are additive; they can be used in sequence
258 to select entities the access rule applies to based on naming context,
259 value and attribute type simultaneously.
260 Submatches resulting from
262 matching can be dereferenced in the
264 field using the syntax
268 is the submatch number.
271 is actually an alias for
273 that corresponds to dereferencing submatches from the
281 indicates whom the access rules apply to.
284 statements can appear in an access control statement, indicating the
285 different access privileges to the same resource that apply to different
287 It can have the forms
295 dn[.<dnstyle>[,<modifier>]]=<DN>
300 realself[.<selfstyle>]
302 realdn[.<dnstyle>[,<modifier>]]=<DN>
303 realdnattr=<attrname>
305 group[/<objectclass>[/<attrname>]]
306 [.<groupstyle>]=<group>
307 peername[.<peernamestyle>]=<peername>
308 sockname[.<style>]=<sockname>
309 domain[.<domainstyle>[,<modifier>]]=<domain>
310 sockurl[.<style>]=<sockurl>
311 set[.<setstyle>]=<pattern>
318 dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
324 <style>={exact|regex|expand}
325 <selfstyle>={level{<n>}}
326 <dnstyle>={{exact|base(object)}|regex
327 |one(level)|sub(tree)|children|level{<n>}}
328 <groupstyle>={exact|expand}
329 <peernamestyle>={<style>|ip|ipv6|path}
330 <domainstyle>={exact|regex|sub(tree)}
331 <setstyle>={exact|expand}
333 <name>=aci <pattern>=<attrname>]
336 They may be specified in combination.
345 The keywords prefixed by
347 act as their counterparts without prefix; the checking respectively occurs
348 with the \fIauthentication\fP DN and the \fIauthorization\fP DN.
352 means access is granted to unauthenticated clients; it is mostly used
353 to limit access to authentication resources (e.g. the
355 attribute) to unauthenticated clients for authentication purposes.
359 means access is granted to authenticated clients.
363 means access to an entry is allowed to the entry itself (e.g. the entry
364 being accessed and the requesting entry must be the same).
367 style, where \fI<n>\fP indicates what ancestor of the DN
368 is to be used in matches.
369 A positive value indicates that the <n>-th ancestor of the user's DN
370 is to be considered; a negative value indicates that the <n>-th ancestor
371 of the target is to be considered.
372 For example, a "\fIby self.level{1} ...\fP" clause would match
373 when the object "\fIdc=example,dc=com\fP" is accessed
374 by "\fIcn=User,dc=example,dc=com\fP".
375 A "\fIby self.level{-1} ...\fP" clause would match when the same user
376 accesses the object "\fIou=Address Book,cn=User,dc=example,dc=com\fP".
380 means that access is granted to the matching DN.
381 The optional style qualifier
383 allows the same choices of the dn form of the
385 field. In addition, the
387 style can exploit substring substitution of submatches in the
389 dn.regex clause by using the form
393 ranging from 0 to 9 (where 0 matches the entire string),
396 for submatches higher than 9.
397 Substring substitution from attribute value can
401 Since the dollar character is used to indicate a substring replacement,
402 the dollar character that is used to indicate match up to the end of
403 the string must be escaped by a second dollar character, e.g.
406 access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$"
407 by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write
413 At present, the only type allowed is
415 which causes substring substitution of submatches to take place
422 dnstyle in the above example may be of use only if the
424 clause needs to be a regex; otherwise, if the
425 value of the second (from the right)
427 portion of the DN in the above example were fixed, the form
430 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
431 by dn.exact,expand="uid=$2,dc=example,dc=com" write
434 could be used; if it had to match the value in the
439 access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$"
440 by dn.exact,expand="uid=$2,dc=$3,dc=com" write
447 clause other than regex may provide submatches as well.
458 as the match of the entire string.
467 as the match of the rightmost part of the DN as defined in the
470 This may be useful, for instance, to provide access to all the
471 ancestors of a user by defining
474 access to dn.subtree="dc=com"
475 by dn.subtree,expand="$1" read
478 which means that only access to entries that appear in the DN of the
484 form is an extension and a generalization of the
486 form, which matches all DNs whose <n>-th ancestor is the pattern.
487 So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP,
488 and \fIlevel{0}\fP is equivalent to \fIbase\fP.
490 It is perfectly useless to give any access privileges to a DN
491 that exactly matches the
493 of the database the ACLs apply to, because it implicitly
494 possesses write privileges for the entire tree of that database.
495 Actually, access control is bypassed for the
497 to solve the intrinsic chicken-and-egg problem.
501 means that access is granted to requests whose DN is listed in the
502 entry being accessed under the
508 means that access is granted to requests whose DN is listed
509 in the group entry whose DN is given by
511 The optional parameters
515 define the objectClass and the member attributeType of the group entry.
521 The optional style qualifier
527 will be expanded as a replacement string (but not as a regular expression)
534 which means that exact match will be used.
535 If the style of the DN portion of the
537 clause is regex, the submatches are made available according to
541 other styles provide limited submatches as discussed above about
546 For static groups, the specified attributeType must have
549 .B NameAndOptionalUID
550 syntax. For dynamic groups the attributeType must
553 attributeType. Only LDAP URIs of the form
554 .B ldap:///<base>??<scope>?<filter>
555 will be evaluated in a dynamic group, by searching the local server only.
558 .BR peername=<peername> ,
559 .BR sockname=<sockname> ,
560 .BR domain=<domain> ,
562 .BR sockurl=<sockurl>
563 mean that the contacting host IP (in the form
566 .BR "IP=[<ipv6>]:<port>"
568 or the contacting host named pipe file name (in the form
570 if connecting through a named pipe) for
572 the named pipe file name for
574 the contacting host name for
576 and the contacting URL for
583 rules for pattern match described for the
587 style, which implies submatch
589 and regex match of the corresponding connection parameters.
594 clause (the default) implies a case-exact match on the client's
598 prefix and the trailing
604 prefix if connecting through a named pipe.
607 style interprets the pattern as
608 .BR <peername>=<ip>[%<mask>][{<n>}] ,
613 are dotted digit representations of the IP and the mask, while
615 delimited by curly brackets, is an optional port.
616 The same applies to IPv6 addresses when the special
619 When checking access privileges, the IP portion of the
621 is extracted, eliminating the
625 part, and it is compared against the
627 portion of the pattern after masking with
629 \fI((peername & <mask>) == <ip>)\fP.
631 .B peername.ip=127.0.0.1
634 allow connections only from localhost,
635 .B peername.ip=192.168.1.0%255.255.255.0
636 allows connections from any IP in the 192.168.1 class C domain, and
637 .B peername.ip=192.168.1.16%255.255.255.240{9009}
638 allows connections from any IP in the 192.168.1.[16-31] range
639 of the same domain, only if port 9009 is used.
646 when connecting through a named pipe, and performs an exact match
647 on the given pattern.
650 clause also allows the
652 style, which succeeds when a fully qualified name exactly matches the
654 pattern, or its trailing part, after a
661 style is allowed, implying an
663 match with submatch expansion; the use of
665 as a style modifier is considered more appropriate.
667 .B domain.subtree=example.com
668 will match www.example.com, but will not match www.anotherexample.com.
671 of the contacting host is determined by performing a DNS reverse lookup.
672 As this lookup can easily be spoofed, use of the
674 statement is strongly discouraged. By default, reverse lookups are disabled.
681 option; the only value currently supported is
683 which causes substring substitution of submatches to take place even if
688 much like the analogous usage in
697 .B dynacl/<name>[/<options>][.<dynstyle>][=<pattern>]
698 means that access checking is delegated to the admin-defined method
701 which can be registered at run-time by means of the
709 are optional, and are directly passed to the registered parsing routine.
710 Dynacl is experimental; it must be enabled at compile time.
713 .B dynacl/aci[=<attrname>]
714 means that the access control is determined by the values in the
719 indicates what attributeType holds the ACI information in the entry.
722 operational attribute is used.
723 ACIs are experimental; they must be enabled at compile time.
727 .BR transport_ssf=<n> ,
731 set the minimum required Security Strength Factor (ssf) needed
732 to grant access. The value should be positive integer.
733 .SH THE <ACCESS> FIELD
735 .B <access> ::= [[real]self]{<level>|<priv>}
736 determines the access level or the specific access privileges the
739 Its component are defined as
742 <level> ::= none|disclose|auth|compare|search|read|{write|add|delete}|manage
743 <priv> ::= {=|+|\-}{0|d|x|c|s|r|{w|a|z}|m}+
748 allows special operations like having a certain access level or privilege
749 only in case the operation involves the name of the user that's requesting
751 It implies the user that requests access is authorized.
754 refers to the authenticated DN as opposed to the authorized DN of the
759 access to the member attribute of a group, which allows one to add/delete
760 its own DN from the member list of a group, while being not allowed
761 to affect other members.
765 access model relies on an incremental interpretation of the access
767 The possible levels are
777 Each access level implies all the preceding ones, thus
779 grants all access including administrative access.
782 access is actually the combination of
786 which respectively restrict the write privilege to add or delete
793 access level disallows all access including disclosure on error.
797 access level allows disclosure of information on error.
801 access level means that one is allowed access to an attribute to perform
802 authentication/authorization operations (e.g.
804 with no other access.
805 This is useful to grant unauthenticated clients the least possible
806 access level to critical resources, like passwords.
810 access model relies on the explicit setting of access privileges
814 sign resets previously defined accesses; as a consequence, the final
815 access privileges will be only those defined by the clause.
820 signs add/remove access privileges to the existing ones.
837 for authentication, and
840 More than one of the above privileges can be added in one statement.
842 indicates no privileges and is used only by itself (e.g., +0).
848 If no access is given, it defaults to
850 .SH THE <CONTROL> FIELD
853 controls the flow of access rule application.
854 It can have the forms
864 the default, means access checking stops in case of match.
865 The other two forms are used to keep on processing access clauses.
868 form allows for other
872 clause to be considered, so that they may result in incrementally altering
873 the privileges, while the
875 form allows for other
877 clauses that match the same target to be processed.
878 Consider the (silly) example
881 access to dn.subtree="dc=example,dc=com" attrs=cn
884 access to dn.subtree="ou=People,dc=example,dc=com"
888 which allows search and compare privileges to everybody under
889 the "dc=example,dc=com" tree, with the second rule allowing
890 also read in the "ou=People" subtree,
891 or the (even more silly) example
894 access to dn.subtree="dc=example,dc=com" attrs=cn
899 which grants everybody search and compare privileges, and adds read
900 privileges to authenticated clients.
902 One useful application is to easily grant write privileges to an
904 that is different from the
906 In this case, since the
908 needs write access to (almost) all data, one can use
912 by dn.exact="cn=The Update DN,dc=example,dc=com" write
916 as the first access rule.
917 As a consequence, unless the operation is performed with the
919 identity, control is passed straight to the subsequent rules.
921 .SH OPERATION REQUIREMENTS
922 Operations require different privileges on different portions of entries.
923 The following summary applies to primary database backends such as
924 the BDB and HDB backends. Requirements for other backends may
925 (and often do) differ.
932 privileges on the pseudo-attribute
934 of the entry being added, and
936 privileges on the pseudo-attribute
938 of the entry's parent.
939 When adding the suffix entry of a database,
943 of the empty DN ("") is required. Also if
944 Add content ACL checking has been configured on
945 the database (see the
948 .BR slapd\-config (5)
951 will be required on all of the attributes being added.
956 operation, when credentials are stored in the directory, requires
958 privileges on the attribute the credentials are stored in (usually
966 privileges on the attribute that is being compared.
973 privileges on the pseudo-attribute
975 of the entry being deleted, and
979 pseudo-attribute of the entry's parent.
986 privileges on the attributes being modified.
989 is required to add new values,
991 is required to delete existing values,
998 are required to replace existing values.
1005 privileges on the pseudo-attribute
1007 of the entry whose relative DN is being modified,
1009 privileges on the pseudo-attribute
1011 of the old entry's parents,
1013 privileges on the pseudo-attribute
1015 of the new entry's parents, and
1017 privileges on the attributes that are present in the new relative DN.
1019 privileges are also required on the attributes that are present
1020 in the old relative DN if
1031 pseudo-attribute of the searchBase
1032 (NOTE: this was introduced with OpenLDAP 2.4).
1033 Then, for each entry, it requires
1035 privileges on the attributes that are defined in the filter.
1036 The resulting entries are finally tested for
1038 privileges on the pseudo-attribute
1040 (for read access to the entry itself)
1043 access on each value of each attribute that is requested.
1046 object used in generating continuation references, the operation requires
1048 access on the pseudo-attribute
1050 (for read access to the referral object itself),
1053 access to the attribute holding the referral information
1059 Some internal operations and some
1061 require specific access privileges.
1068 privileges on all the attributes that are present in the search filter
1069 of the URI regexp maps (the right-hand side of the
1073 privileges are also required on the
1075 attribute of the authorizing identity and/or on the
1077 attribute of the authorized identity.
1078 In general, when an internal lookup is performed for authentication
1079 or authorization purposes, search-specific privileges (see the access
1080 requirements for the search operation illustrated above) are relaxed to
1084 Access control to search entries is checked by the frontend,
1085 so it is fully honored by all backends; for all other operations
1086 and for the discovery phase of the search operation,
1087 full ACL semantics is only supported by the primary backends, i.e.
1092 Some other backend, like
1094 may fully support them; others may only support a portion of the
1095 described semantics, or even differ in some aspects.
1096 The relevant details are described in the backend-specific man pages.
1099 It is strongly recommended to explicitly use the most appropriate
1105 clauses, to avoid possible incorrect specifications of the access rules
1106 as well as for performance (avoid unnecessary regex matching when an exact
1107 match suffices) reasons.
1109 An administrator might create a rule of the form:
1112 access to dn.regex="dc=example,dc=com"
1116 expecting it to match all entries in the subtree "dc=example,dc=com".
1117 However, this rule actually matches any DN which contains anywhere
1118 the substring "dc=example,dc=com". That is, the rule matches both
1119 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
1121 To match the desired subtree, the rule would be more precisely
1125 access to dn.regex="^(.+,)?dc=example,dc=com$"
1129 For performance reasons, it would be better to use the subtree style.
1132 access to dn.subtree="dc=example,dc=com"
1136 When writing submatch rules, it may be convenient to avoid unnecessary
1139 use; for instance, to allow access to the subtree of the user
1142 clause, one could use
1145 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1146 by dn.regex="^uid=$2,dc=example,dc=com$$" write
1150 However, since all that is required in the
1152 clause is substring expansion, a more efficient solution is
1155 access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
1156 by dn.exact,expand="uid=$2,dc=example,dc=com" write
1164 implies substring expansion,
1166 as well as all the other DN specific
1168 values, does not, so it must be explicitly requested.
1173 default slapd configuration file
1181 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
1182 .SH ACKNOWLEDGEMENTS