{"id":431,"date":"2012-03-05T22:25:14","date_gmt":"2012-03-05T14:25:14","guid":{"rendered":"http:\/\/cowman-chiang.no-ip.org\/wordpress\/?p=431"},"modified":"2023-10-31T15:52:05","modified_gmt":"2023-10-31T07:52:05","slug":"man-slapd-access","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=431","title":{"rendered":"man slapd.access"},"content":{"rendered":"<p>SLAPD.ACCESS(5) SLAPD.ACCESS(5)<!--more--><\/p>\n<p>NAME<br \/>\nslapd.access &#8211; access configuration for slapd, the stand-alone LDAP daemon<\/p>\n<p>SYNOPSIS<br \/>\n\/etc\/openldap\/slapd.conf<\/p>\n<p>DESCRIPTION<br \/>\nThe slapd.conf(5) file contains configuration information for the slapd(8) daemon. This configuration file is<br \/>\nalso used by the SLAPD tools slapacl(8), slapadd(8), slapauth(8), slapcat(8), slapdn(8), slapindex(8), and<br \/>\nslaptest(8).<\/p>\n<p>The slapd.conf file consists of a series of global configuration options that apply to slapd as a whole<br \/>\n(including all backends), followed by zero or more database backend definitions that contain information spe-<br \/>\ncific to a backend instance.<\/p>\n<p>The general format of slapd.conf is as follows:<\/p>\n<h1>comment &#8211; these options apply to every database<\/h1>\n<p>&lt;global configuration options&gt;<\/p>\n<h1>first database definition &amp; configuration options<\/h1>\n<p>database &lt;backend 1 type&gt;<br \/>\n&lt;configuration options specific to backend 1&gt;<\/p>\n<h1>subsequent database definitions &amp; configuration options<\/h1>\n<p>&#8230;<\/p>\n<p>Both the global configuration and each backend-specific section can contain access information. Backend-spe-<br \/>\ncific access control directives are used for those entries that belong to the backend, according to their nam-<br \/>\ning context. In case no access control directives are defined for a backend or those which are defined are not<br \/>\napplicable, the directives from the global configuration section are then used.<\/p>\n<p>If no access controls are present, the default policy allows anyone and everyone to read anything but restricts<br \/>\nupdates to rootdn. (e.g., &#8220;access to * by * read&#8221;).<\/p>\n<p>When dealing with an access list, because the global access list is effectively appended to each per-database<br \/>\nlist, if the resulting list is non-empty then the access list will end with an implicit access to * by * none<br \/>\ndirective. If there are no access directives applicable to a backend, then a default read is used.<\/p>\n<p>Be warned: the rootdn can always read and write EVERYTHING!<\/p>\n<p>For entries not held in any backend (such as a root DSE), the global directives are used.<\/p>\n<p>Arguments that should be replaced by actual text are shown in brackets &lt;&gt;.<\/p>\n<p>THE ACCESS DIRECTIVE<br \/>\nThe structure of the access control directives is<\/p>\n<p>access to &lt;what&gt; [ by &lt;who&gt; [ &lt;access&gt; ] [ &lt;control&gt; ] ]+<br \/>\nGrant access (specified by &lt;access&gt;) to a set of entries and\/or attributes (specified by &lt;what&gt;) by one<br \/>\nor more requestors (specified by &lt;who&gt;).<\/p>\n<p>Lists of access directives are evaluated in the order they appear in slapd.conf. When a &lt;what&gt; clause matches<br \/>\nthe datum whose access is being evaluated, its &lt;who&gt; clause list is checked. When a &lt;who&gt; clause matches the<br \/>\naccessor\u2019s properties, its &lt;access&gt; and &lt;control&gt; clauses are evaluated. Access control checking stops at the<br \/>\nfirst match of the &lt;what&gt; and &lt;who&gt; clause, unless otherwise dictated by the &lt;control&gt; clause. Each &lt;who&gt;<br \/>\nclause list is implicitly terminated by a<\/p>\n<p>by * none stop<\/p>\n<p>clause that results in stopping the access control with no access privileges granted. Each &lt;what&gt; clause list<br \/>\nis implicitly terminated by a<\/p>\n<p>access to *<br \/>\nby * none<\/p>\n<p>clause that results in granting no access privileges to an otherwise unspecified datum.<\/p>\n<p>THE &lt;WHAT&gt; FIELD<br \/>\nThe field &lt;what&gt; specifies the entity the access control directive applies to. It can have the forms<\/p>\n<p>dn[.&lt;dnstyle&gt;]=&lt;dnpattern&gt;<br \/>\nfilter=&lt;ldapfilter&gt;<br \/>\nattrs=&lt;attrlist&gt;[ val[\/matchingRule][.&lt;attrstyle&gt;]=&lt;attrval&gt;]<\/p>\n<p>with<\/p>\n<p>&lt;dnstyle&gt;={{exact|base(object)}|regex<br \/>\n|one(level)|sub(tree)|children}<br \/>\n&lt;attrlist&gt;={&lt;attr&gt;|[{!|@}]&lt;objectClass&gt;}[,&lt;attrlist&gt;]<br \/>\n&lt;attrstyle&gt;={{exact|base(object)}|regex<br \/>\n|one(level)|sub(tree)|children}<\/p>\n<p>The statement dn=&lt;dnpattern&gt; selects the entries based on their naming context. The &lt;dnpattern&gt; is a string<br \/>\nrepresentation of the entry\u2019s DN. The wildcard * stands for all the entries, and it is implied if no dn form<br \/>\nis given.<\/p>\n<p>The &lt;dnstyle&gt; is optional; however, it is recommended to specify it to avoid ambiguities. Base (synonym of<br \/>\nbaseObject), the default, or exact (an alias of base) indicates the entry whose DN is equal to the &lt;dnpattern&gt;;<br \/>\none (synonym of onelevel) indicates all the entries immediately below the &lt;dnpattern&gt;, sub (synonym of subtree)<br \/>\nindicates all entries in the subtree at the &lt;dnpattern&gt;, children indicates all the entries below (subordinate<br \/>\nto) the &lt;dnpattern&gt;.<\/p>\n<p>If the &lt;dnstyle&gt; qualifier is regex, then &lt;dnpattern&gt; is a POSIX (\u2019\u2019extended\u2019\u2019) regular expression pattern, as<br \/>\ndetailed in regex(7) and\/or re_format(7), matching a normalized string representation of the entry\u2019s DN. The<br \/>\nregex form of the pattern does not (yet) support UTF-8.<\/p>\n<p>The statement filter=&lt;ldapfilter&gt; selects the entries based on a valid LDAP filter as described in RFC 4515. A<br \/>\nfilter of (objectClass=*) is implied if no filter form is given.<\/p>\n<p>The statement attrs=&lt;attrlist&gt; selects the attributes the access control rule applies to. It is a comma-sepa-<br \/>\nrated list of attribute types, plus the special names entry, indicating access to the entry itself, and chil-<br \/>\ndren, indicating access to the entry\u2019s children. ObjectClass names may also be specified in this list, which<br \/>\nwill affect all the attributes that are required and\/or allowed by that objectClass. Actually, names in<br \/>\n&lt;attrlist&gt; that are prefixed by @ are directly treated as objectClass names. A name prefixed by ! is also<br \/>\ntreated as an objectClass, but in this case the access rule affects the attributes that are not required nor<br \/>\nallowed by that objectClass. If no attrs form is given, attrs=@extensibleObject is implied, i.e. all<br \/>\nattributes are addressed.<\/p>\n<p>Using the form attrs=&lt;attr&gt; val[\/matchingRule][.&lt;attrstyle&gt;]=&lt;attrval&gt; specifies access to a particular value<br \/>\nof a single attribute. In this case, only a single attribute type may be given. The &lt;attrstyle&gt; exact (the<br \/>\ndefault) uses the attribute\u2019s equality matching rule to compare the value, unless a different (and compatible)<br \/>\nmatching rule is specified. If the &lt;attrstyle&gt; is regex, the provided value is used as a POSIX (\u2019\u2019extended\u2019\u2019)<br \/>\nregular expression pattern. If the attribute has DN syntax, the &lt;attrstyle&gt; can be any of base, onelevel, sub-<br \/>\ntree or children, resulting in base, onelevel, subtree or children match, respectively.<\/p>\n<p>The dn, filter, and attrs statements are additive; they can be used in sequence to select entities the access<br \/>\nrule applies to based on naming context, value and attribute type simultaneously. Submatches resulting from<br \/>\nregex matching can be dereferenced in the &lt;who&gt; field using the syntax ${v&lt;n&gt;}, where &lt;n&gt; is the submatch num-<br \/>\nber. The default syntax, $&lt;n&gt;, is actually an alias for ${d&lt;n&gt;}, that corresponds to dereferencing submatches<br \/>\nfrom the dnpattern portion of the &lt;what&gt; field.<\/p>\n<p>THE &lt;WHO&gt; FIELD<br \/>\nThe field &lt;who&gt; indicates whom the access rules apply to. Multiple &lt;who&gt; statements can appear in an access<br \/>\ncontrol statement, indicating the different access privileges to the same resource that apply to different<br \/>\naccessee. It can have the forms<\/p>\n<p>*<br \/>\nanonymous<br \/>\nusers<br \/>\nself[.&lt;selfstyle&gt;]<\/p>\n<p>dn[.&lt;dnstyle&gt;[,&lt;modifier&gt;]]=&lt;DN&gt;<br \/>\ndnattr=&lt;attrname&gt;<\/p>\n<p>realanonymous<br \/>\nrealusers<br \/>\nrealself[.&lt;selfstyle&gt;]<\/p>\n<p>realdn[.&lt;dnstyle&gt;[,&lt;modifier&gt;]]=&lt;DN&gt;<br \/>\nrealdnattr=&lt;attrname&gt;<\/p>\n<p>group[\/&lt;objectclass&gt;[\/&lt;attrname&gt;]]<br \/>\n[.&lt;groupstyle&gt;]=&lt;group&gt;<br \/>\npeername[.&lt;peernamestyle&gt;]=&lt;peername&gt;<br \/>\nsockname[.&lt;style&gt;]=&lt;sockname&gt;<br \/>\ndomain[.&lt;domainstyle&gt;[,&lt;modifier&gt;]]=&lt;domain&gt;<br \/>\nsockurl[.&lt;style&gt;]=&lt;sockurl&gt;<br \/>\nset[.&lt;setstyle&gt;]=&lt;pattern&gt;<\/p>\n<p>ssf=&lt;n&gt;<br \/>\ntransport_ssf=&lt;n&gt;<br \/>\ntls_ssf=&lt;n&gt;<br \/>\nsasl_ssf=&lt;n&gt;<\/p>\n<p>dynacl\/&lt;name&gt;[\/&lt;options&gt;][.&lt;dynstyle&gt;][=&lt;pattern&gt;]<\/p>\n<p>with<\/p>\n<p>&lt;style&gt;={exact|regex|expand}<br \/>\n&lt;selfstyle&gt;={level{&lt;n&gt;}}<br \/>\n&lt;dnstyle&gt;={{exact|base(object)}|regex<br \/>\n|one(level)|sub(tree)|children|level{&lt;n&gt;}}<br \/>\n&lt;groupstyle&gt;={exact|expand}<br \/>\n&lt;peernamestyle&gt;={&lt;style&gt;|ip|ipv6|path}<br \/>\n&lt;domainstyle&gt;={exact|regex|sub(tree)}<br \/>\n&lt;setstyle&gt;={exact|expand}<br \/>\n&lt;modifier&gt;={expand}<br \/>\n&lt;name&gt;=aci &lt;pattern&gt;=&lt;attrname&gt;]<\/p>\n<p>They may be specified in combination.<\/p>\n<p>The wildcard * refers to everybody.<\/p>\n<p>The keywords prefixed by real act as their counterparts without prefix; the checking respectively occurs with<br \/>\nthe authentication DN and the authorization DN.<\/p>\n<p>The keyword anonymous means access is granted to unauthenticated clients; it is mostly used to limit access to<br \/>\nauthentication resources (e.g. the userPassword attribute) to unauthenticated clients for authentication pur-<br \/>\nposes.<\/p>\n<p>The keyword users means access is granted to authenticated clients.<\/p>\n<p>The keyword self means access to an entry is allowed to the entry itself (e.g. the entry being accessed and the<br \/>\nrequesting entry must be the same). It allows the level{&lt;n&gt;} style, where &lt;n&gt; indicates what ancestor of the<br \/>\nDN is to be used in matches. A positive value indicates that the &lt;n&gt;-th ancestor of the user\u2019s DN is to be<br \/>\nconsidered; a negative value indicates that the &lt;n&gt;-th ancestor of the target is to be considered. For exam-<br \/>\nple, a &#8220;by self.level{1} &#8230;&#8221; clause would match when the object &#8220;dc=example,dc=com&#8221; is accessed by<br \/>\n&#8220;cn=User,dc=example,dc=com&#8221;. A &#8220;by self.level{-1} &#8230;&#8221; clause would match when the same user accesses the<br \/>\nobject &#8220;ou=Address Book,cn=User,dc=example,dc=com&#8221;.<\/p>\n<p>The statement dn=&lt;DN&gt; means that access is granted to the matching DN. The optional style qualifier dnstyle<br \/>\nallows the same choices of the dn form of the &lt;what&gt; field. In addition, the regex style can exploit substring<br \/>\nsubstitution of submatches in the &lt;what&gt; dn.regex clause by using the form $&lt;digit&gt;, with digit ranging from 0<br \/>\nto 9 (where 0 matches the entire string), or the form ${&lt;digit&gt;+}, for submatches higher than 9. Substring<br \/>\nsubstitution from attribute value can be done in using the form ${v&lt;digit&gt;+}. Since the dollar character is<br \/>\nused to indicate a substring replacement, the dollar character that is used to indicate match up to the end of<br \/>\nthe string must be escaped by a second dollar character, e.g.<\/p>\n<p>access to dn.regex=&#8221;^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$&#8221;<br \/>\nby dn.regex=&#8221;^uid=$2,dc=[^,]+,dc=com$$&#8221; write<\/p>\n<p>The style qualifier allows an optional modifier. At present, the only type allowed is expand, which causes<br \/>\nsubstring substitution of submatches to take place even if dnstyle is not regex. Note that the regex dnstyle<br \/>\nin the above example may be of use only if the &lt;by&gt; clause needs to be a regex; otherwise, if the value of the<br \/>\nsecond (from the right) dc= portion of the DN in the above example were fixed, the form<\/p>\n<p>access to dn.regex=&#8221;^(.+,)?uid=([^,]+),dc=example,dc=com$&#8221;<br \/>\nby dn.exact,expand=&#8221;uid=$2,dc=example,dc=com&#8221; write<\/p>\n<p>could be used; if it had to match the value in the &lt;what&gt; clause, the form<\/p>\n<p>access to dn.regex=&#8221;^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$&#8221;<br \/>\nby dn.exact,expand=&#8221;uid=$2,dc=$3,dc=com&#8221; write<\/p>\n<p>could be used.<\/p>\n<p>Forms of the &lt;what&gt; clause other than regex may provide submatches as well. The base(object), the sub(tree),<br \/>\nthe one(level), and the children forms provide $0 as the match of the entire string. The sub(tree), the<br \/>\none(level), and the children forms also provide $1 as the match of the rightmost part of the DN as defined in<br \/>\nthe &lt;what&gt; clause. This may be useful, for instance, to provide access to all the ancestors of a user by<br \/>\ndefining<\/p>\n<p>access to dn.subtree=&#8221;dc=com&#8221;<br \/>\nby dn.subtree,expand=&#8221;$1&#8243; read<\/p>\n<p>which means that only access to entries that appear in the DN of the &lt;by&gt; clause is allowed.<\/p>\n<p>The level{&lt;n&gt;} form is an extension and a generalization of the onelevel form, which matches all DNs whose<br \/>\n&lt;n&gt;-th ancestor is the pattern. So, level{1} is equivalent to onelevel, and level{0} is equivalent to base.<\/p>\n<p>It is perfectly useless to give any access privileges to a DN that exactly matches the rootdn of the database<br \/>\nthe ACLs apply to, because it implicitly possesses write privileges for the entire tree of that database.<br \/>\nActually, access control is bypassed for the rootdn, to solve the intrinsic chicken-and-egg problem.<\/p>\n<p>The statement dnattr=&lt;attrname&gt; means that access is granted to requests whose DN is listed in the entry being<br \/>\naccessed under the &lt;attrname&gt; attribute.<\/p>\n<p>The statement group=&lt;group&gt; means that access is granted to requests whose DN is listed in the group entry<br \/>\nwhose DN is given by &lt;group&gt;. The optional parameters &lt;objectclass&gt; and &lt;attrname&gt; define the objectClass and<br \/>\nthe member attributeType of the group entry. The defaults are groupOfNames and member, respectively. The<br \/>\noptional style qualifier &lt;style&gt; can be expand, which means that &lt;group&gt; will be expanded as a replacement<br \/>\nstring (but not as a regular expression) according to regex(7) and\/or re_format(7), and exact, which means that<br \/>\nexact match will be used. If the style of the DN portion of the &lt;what&gt; clause is regex, the submatches are<br \/>\nmade available according to regex(7) and\/or re_format(7); other styles provide limited submatches as discussed<br \/>\nabove about the DN form of the &lt;by&gt; clause.<\/p>\n<p>For static groups, the specified attributeType must have DistinguishedName or NameAndOptionalUID syntax. For<br \/>\ndynamic groups the attributeType must be a subtype of the labeledURI attributeType. Only LDAP URIs of the form<br \/>\nldap:\/\/\/&lt;base&gt;??&lt;scope&gt;?&lt;filter&gt; will be evaluated in a dynamic group, by searching the local server only.<\/p>\n<p>The statements peername=&lt;peername&gt;, sockname=&lt;sockname&gt;, domain=&lt;domain&gt;, and sockurl=&lt;sockurl&gt; mean that the<br \/>\ncontacting host IP (in the form IP=&lt;ip&gt;:&lt;port&gt; for IPv4, or IP=[&lt;ipv6&gt;]:&lt;port&gt; for IPv6) or the contacting host<br \/>\nnamed pipe file name (in the form PATH=&lt;path&gt; if connecting through a named pipe) for peername, the named pipe<br \/>\nfile name for sockname, the contacting host name for domain, and the contacting URL for sockurl are compared<br \/>\nagainst pattern to determine access. The same style rules for pattern match described for the group case<br \/>\napply, plus the regex style, which implies submatch expand and regex match of the corresponding connection<br \/>\nparameters. The exact style of the &lt;peername&gt; clause (the default) implies a case-exact match on the client\u2019s<br \/>\nIP, including the IP= prefix and the trailing :&lt;port&gt;, or the client\u2019s path, including the PATH= prefix if con-<br \/>\nnecting through a named pipe. The special ip style interprets the pattern as &lt;peername&gt;=&lt;ip&gt;[%&lt;mask&gt;][{&lt;n&gt;}],<br \/>\nwhere &lt;ip&gt; and &lt;mask&gt; are dotted digit representations of the IP and the mask, while &lt;n&gt;, delimited by curly<br \/>\nbrackets, is an optional port. The same applies to IPv6 addresses when the special ipv6 style is used. When<br \/>\nchecking access privileges, the IP portion of the peername is extracted, eliminating the IP= prefix and the<br \/>\n:&lt;port&gt; part, and it is compared against the &lt;ip&gt; portion of the pattern after masking with &lt;mask&gt;: ((peername<br \/>\n&amp; &lt;mask&gt;) == &lt;ip&gt;). As an example, peername.ip=127.0.0.1 and peername.ipv6=::1 allow connections only from<br \/>\nlocalhost, peername.ip=192.168.1.0%255.255.255.0 allows connections from any IP in the 192.168.1 class C<br \/>\ndomain, and peername.ip=192.168.1.16%255.255.255.240{9009} allows connections from any IP in the<br \/>\n192.168.1.[16-31] range of the same domain, only if port 9009 is used. The special path style eliminates the<br \/>\nPATH= prefix from the peername when connecting through a named pipe, and performs an exact match on the given<br \/>\npattern. The &lt;domain&gt; clause also allows the subtree style, which succeeds when a fully qualified name exactly<br \/>\nmatches the domain pattern, or its trailing part, after a dot, exactly matches the domain pattern. The expand<br \/>\nstyle is allowed, implying an exact match with submatch expansion; the use of expand as a style modifier is<br \/>\nconsidered more appropriate. As an example, domain.subtree=example.com will match www.example.com, but will<br \/>\nnot match www.anotherexample.com. The domain of the contacting host is determined by performing a DNS reverse<br \/>\nlookup. As this lookup can easily be spoofed, use of the domain statement is strongly discouraged. By<br \/>\ndefault, reverse lookups are disabled. The optional domainstyle qualifier of the &lt;domain&gt; clause allows a mod-<br \/>\nifier option; the only value currently supported is expand, which causes substring substitution of submatches<br \/>\nto take place even if the domainstyle is not regex, much like the analogous usage in &lt;dn&gt; clause.<\/p>\n<p>The statement set=&lt;pattern&gt; is undocumented yet.<\/p>\n<p>The statement dynacl\/&lt;name&gt;[\/&lt;options&gt;][.&lt;dynstyle&gt;][=&lt;pattern&gt;] means that access checking is delegated to the<br \/>\nadmin-defined method indicated by &lt;name&gt;, which can be registered at run-time by means of the moduleload state-<br \/>\nment. The fields &lt;options&gt;, &lt;dynstyle&gt; and &lt;pattern&gt; are optional, and are directly passed to the registered<br \/>\nparsing routine. Dynacl is experimental; it must be enabled at compile time.<\/p>\n<p>The statement dynacl\/aci[=&lt;attrname&gt;] means that the access control is determined by the values in the attrname<br \/>\nof the entry itself. The optional &lt;attrname&gt; indicates what attributeType holds the ACI information in the<br \/>\nentry. By default, the OpenLDAPaci operational attribute is used. ACIs are experimental; they must be enabled<br \/>\nat compile time.<\/p>\n<p>The statements ssf=&lt;n&gt;, transport_ssf=&lt;n&gt;, tls_ssf=&lt;n&gt;, and sasl_ssf=&lt;n&gt; set the minimum required Security<br \/>\nStrength Factor (ssf) needed to grant access. The value should be positive integer.<\/p>\n<p>THE &lt;ACCESS&gt; FIELD<br \/>\nThe optional field &lt;access&gt; ::= [[real]self]{&lt;level&gt;|&lt;priv&gt;} determines the access level or the specific access<br \/>\nprivileges the who field will have. Its component are defined as<\/p>\n<p>&lt;level&gt; ::= none|disclose|auth|compare|search|read|{write|add|delete}|manage<br \/>\n&lt;priv&gt; ::= {=|+|-}{0|d|x|c|s|r|{w|a|z}|m}+<\/p>\n<p>The modifier self allows special operations like having a certain access level or privilege only in case the<br \/>\noperation involves the name of the user that\u2019s requesting the access. It implies the user that requests access<br \/>\nis authorized. The modifier realself refers to the authenticated DN as opposed to the authorized DN of the<br \/>\nself modifier. An example is the selfwrite access to the member attribute of a group, which allows one to<br \/>\nadd\/delete its own DN from the member list of a group, while being not allowed to affect other members.<\/p>\n<p>The level access model relies on an incremental interpretation of the access privileges. The possible levels<br \/>\nare none, disclose, auth, compare, search, read, write, and manage. Each access level implies all the preced-<br \/>\ning ones, thus manage grants all access including administrative access. The write access is actually the com-<br \/>\nbination of add and delete, which respectively restrict the write privilege to add or delete the specified<br \/>\n&lt;what&gt;.<\/p>\n<p>The none access level disallows all access including disclosure on error.<\/p>\n<p>The disclose access level allows disclosure of information on error.<\/p>\n<p>The auth access level means that one is allowed access to an attribute to perform authentication\/authorization<br \/>\noperations (e.g. bind) with no other access. This is useful to grant unauthenticated clients the least possi-<br \/>\nble access level to critical resources, like passwords.<\/p>\n<p>The priv access model relies on the explicit setting of access privileges for each clause. The = sign resets<br \/>\npreviously defined accesses; as a consequence, the final access privileges will be only those defined by the<br \/>\nclause. The + and &#8211; signs add\/remove access privileges to the existing ones. The privileges are m for manage,<br \/>\nw for write, a for add, z for delete, r for read, s for search, c for compare, x for authentication, and d for<br \/>\ndisclose. More than one of the above privileges can be added in one statement. 0 indicates no privileges and<br \/>\nis used only by itself (e.g., +0). Note that +az is equivalent to +w.<\/p>\n<p>If no access is given, it defaults to +0.<\/p>\n<p>THE &lt;CONTROL&gt; FIELD<br \/>\nThe optional field &lt;control&gt; controls the flow of access rule application. It can have the forms<\/p>\n<p>stop<br \/>\ncontinue<br \/>\nbreak<\/p>\n<p>where stop, the default, means access checking stops in case of match. The other two forms are used to keep on<br \/>\nprocessing access clauses. In detail, the continue form allows for other &lt;who&gt; clauses in the same &lt;access&gt;<br \/>\nclause to be considered, so that they may result in incrementally altering the privileges, while the break form<br \/>\nallows for other &lt;access&gt; clauses that match the same target to be processed. Consider the (silly) example<\/p>\n<p>access to dn.subtree=&#8221;dc=example,dc=com&#8221; attrs=cn<br \/>\nby * =cs break<\/p>\n<p>access to dn.subtree=&#8221;ou=People,dc=example,dc=com&#8221;<br \/>\nby * +r<\/p>\n<p>which allows search and compare privileges to everybody under the &#8220;dc=example,dc=com&#8221; tree, with the second<br \/>\nrule allowing also read in the &#8220;ou=People&#8221; subtree, or the (even more silly) example<\/p>\n<p>access to dn.subtree=&#8221;dc=example,dc=com&#8221; attrs=cn<br \/>\nby * =cs continue<br \/>\nby users +r<\/p>\n<p>which grants everybody search and compare privileges, and adds read privileges to authenticated clients.<\/p>\n<p>One useful application is to easily grant write privileges to an updatedn that is different from the rootdn.<br \/>\nIn this case, since the updatedn needs write access to (almost) all data, one can use<\/p>\n<p>access to *<br \/>\nby dn.exact=&#8221;cn=The Update DN,dc=example,dc=com&#8221; write<br \/>\nby * break<\/p>\n<p>as the first access rule. As a consequence, unless the operation is performed with the updatedn identity, con-<br \/>\ntrol is passed straight to the subsequent rules.<\/p>\n<p>OPERATION REQUIREMENTS<br \/>\nOperations require different privileges on different portions of entries. The following summary applies to<br \/>\nprimary database backends such as the BDB and HDB backends. Requirements for other backends may (and often<br \/>\ndo) differ.<\/p>\n<p>The add operation requires add (=a) privileges on the pseudo-attribute entry of the entry being added, and add<br \/>\n(=a) privileges on the pseudo-attribute children of the entry\u2019s parent. When adding the suffix entry of a<br \/>\ndatabase, add access to children of the empty DN (&#8220;&#8221;) is required. Also if Add content ACL checking has been<br \/>\nconfigured on the database (see the slapd.conf(5) or slapd-config(5) manual page), add (=a) will be required on<br \/>\nall of the attributes being added.<\/p>\n<p>The bind operation, when credentials are stored in the directory, requires auth (=x) privileges on the<br \/>\nattribute the credentials are stored in (usually userPassword).<\/p>\n<p>The compare operation requires compare (=c) privileges on the attribute that is being compared.<\/p>\n<p>The delete operation requires delete (=z) privileges on the pseudo-attribute entry of the entry being deleted,<br \/>\nand delete (=d) privileges on the children pseudo-attribute of the entry\u2019s parent.<\/p>\n<p>The modify operation requires write (=w) privileges on the attributes being modified. In detail, add (=a) is<br \/>\nrequired to add new values, delete (=z) is required to delete existing values, and both delete and add (=az),<br \/>\nor write (=w), are required to replace existing values.<\/p>\n<p>The modrdn operation requires write (=w) privileges on the pseudo-attribute entry of the entry whose relative<br \/>\nDN is being modified, delete (=z) privileges on the pseudo-attribute children of the old entry\u2019s parents, add<br \/>\n(=a) privileges on the pseudo-attribute children of the new entry\u2019s parents, and add (=a) privileges on the<br \/>\nattributes that are present in the new relative DN. Delete (=z) privileges are also required on the attributes<br \/>\nthat are present in the old relative DN if deleteoldrdn is set to 1.<\/p>\n<p>The search operation, requires search (=s) privileges on the entry pseudo-attribute of the searchBase (NOTE:<br \/>\nthis was introduced with OpenLDAP 2.4). Then, for each entry, it requires search (=s) privileges on the<br \/>\nattributes that are defined in the filter. The resulting entries are finally tested for read (=r) privileges<br \/>\non the pseudo-attribute entry (for read access to the entry itself) and for read (=r) access on each value of<br \/>\neach attribute that is requested. Also, for each referral object used in generating continuation references,<br \/>\nthe operation requires read (=r) access on the pseudo-attribute entry (for read access to the referral object<br \/>\nitself), as well as read (=r) access to the attribute holding the referral information (generally the ref<br \/>\nattribute).<\/p>\n<p>Some internal operations and some controls require specific access privileges. The authzID mapping and the<br \/>\nproxyAuthz control require auth (=x) privileges on all the attributes that are present in the search filter of<br \/>\nthe URI regexp maps (the right-hand side of the authz-regexp directives). Auth (=x) privileges are also<br \/>\nrequired on the authzTo attribute of the authorizing identity and\/or on the authzFrom attribute of the autho-<br \/>\nrized identity. In general, when an internal lookup is performed for authentication or authorization purposes,<br \/>\nsearch-specific privileges (see the access requirements for the search operation illustrated above) are relaxed<br \/>\nto auth.<\/p>\n<p>Access control to search entries is checked by the frontend, so it is fully honored by all backends; for all<br \/>\nother operations and for the discovery phase of the search operation, full ACL semantics is only supported by<br \/>\nthe primary backends, i.e. back-bdb(5), and back-hdb(5).<\/p>\n<p>Some other backend, like back-sql(5), may fully support them; others may only support a portion of the<br \/>\ndescribed semantics, or even differ in some aspects. The relevant details are described in the backend-spe-<br \/>\ncific man pages.<\/p>\n<p>CAVEATS<br \/>\nIt is strongly recommended to explicitly use the most appropriate &lt;dnstyle&gt; in &lt;what&gt; and &lt;who&gt; clauses, to<br \/>\navoid possible incorrect specifications of the access rules as well as for performance (avoid unnecessary regex<br \/>\nmatching when an exact match suffices) reasons.<\/p>\n<p>An administrator might create a rule of the form:<\/p>\n<p>access to dn.regex=&#8221;dc=example,dc=com&#8221;<br \/>\nby &#8230;<\/p>\n<p>expecting it to match all entries in the subtree &#8220;dc=example,dc=com&#8221;. However, this rule actually matches any<br \/>\nDN which contains anywhere the substring &#8220;dc=example,dc=com&#8221;. That is, the rule matches both &#8220;uid=joe,dc=exam-<br \/>\nple,dc=com&#8221; and &#8220;dc=example,dc=com,uid=joe&#8221;.<\/p>\n<p>To match the desired subtree, the rule would be more precisely written:<\/p>\n<p>access to dn.regex=&#8221;^(.+,)?dc=example,dc=com$&#8221;<br \/>\nby &#8230;<\/p>\n<p>For performance reasons, it would be better to use the subtree style.<\/p>\n<p>access to dn.subtree=&#8221;dc=example,dc=com&#8221;<br \/>\nby &#8230;<\/p>\n<p>When writing submatch rules, it may be convenient to avoid unnecessary regex &lt;dnstyle&gt; use; for instance, to<br \/>\nallow access to the subtree of the user that matches the &lt;what&gt; clause, one could use<\/p>\n<p>access to dn.regex=&#8221;^(.+,)?uid=([^,]+),dc=example,dc=com$&#8221;<br \/>\nby dn.regex=&#8221;^uid=$2,dc=example,dc=com$$&#8221; write<br \/>\nby &#8230;<\/p>\n<p>However, since all that is required in the &lt;by&gt; clause is substring expansion, a more efficient solution is<\/p>\n<p>access to dn.regex=&#8221;^(.+,)?uid=([^,]+),dc=example,dc=com$&#8221;<br \/>\nby dn.exact,expand=&#8221;uid=$2,dc=example,dc=com&#8221; write<br \/>\nby &#8230;<\/p>\n<p>In fact, while a &lt;dnstyle&gt; of regex implies substring expansion, exact, as well as all the other DN specific<br \/>\n&lt;dnstyle&gt; values, does not, so it must be explicitly requested.<\/p>\n<p>FILES<br \/>\n\/etc\/openldap\/slapd.conf<br \/>\ndefault slapd configuration file<\/p>\n<p>SEE ALSO<br \/>\nslapd(8), slapd-*(5), slapacl(8), regex(7), re_format(7)<\/p>\n<p>&#8220;OpenLDAP Administrator\u2019s Guide&#8221; (http:\/\/www.OpenLDAP.org\/doc\/admin\/)<\/p>\n<p>ACKNOWLEDGEMENTS<br \/>\nOpenLDAP Software is developed and maintained by The OpenLDAP Project &lt;http:\/\/www.openldap.org\/&gt;. OpenLDAP<br \/>\nSoftware is derived from University of Michigan LDAP 3.3 Release.<\/p>\n<p>OpenLDAP 2.4.23 2010\/06\/30 SLAPD.ACCESS(5)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SLAPD.ACCESS(5) SLAPD.ACCESS(5)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-431","post","type-post","status-publish","format-standard","hentry","category-openldap"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=431"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/431\/revisions"}],"predecessor-version":[{"id":2145,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/431\/revisions\/2145"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}