📄 slapd.access.5
字号:
.TH SLAPD.ACCESS 5 "RELEASEDATE" "OpenLDAP LDVERSION".\" Copyright 1998-2007 The OpenLDAP Foundation All Rights Reserved..\" Copying restrictions apply. See COPYRIGHT/LICENSE..\" $OpenLDAP: pkg/ldap/doc/man/man5/slapd.access.5,v 1.55.2.10 2007/01/02 21:43:45 kurt Exp $.SH NAMEslapd.access \- access configuration for slapd, the stand-alone LDAP daemon.SH SYNOPSISETCDIR/slapd.conf.SH DESCRIPTIONThe .BR slapd.conf (5)file contains configuration information for the.BR slapd (8)daemon. This configuration file is also used by the.BR slurpd (8)replication daemon and by the SLAPD tools.BR slapacl (8),.BR slapadd (8),.BR slapauth (8),.BR slapcat (8),.BR slapdn (8),.BR slapindex (8),and.BR slaptest (8)..LPThe.B slapd.conffile consists of a series of global configuration options that apply to.B slapdas a whole (including all backends), followed by zero or more databasebackend definitions that contain information specific to a backendinstance..LPThe general format of.B slapd.confis as follows:.LP.nf # comment - these options apply to every database <global configuration options> # first database definition & configuration options database <backend 1 type> <configuration options specific to backend 1> # subsequent database definitions & configuration options ....fi.LPBoth the global configuration and each backend-specific section cancontain access information. Backend-specific access controldirectives are used for those entries that belong to the backend,according to their naming context. In case no access controldirectives are defined for a backend or those which are defined arenot applicable, the directives from the global configuration sectionare then used..LPIf no access controls are present, the default policyallows anyone and everyone to read anything but restrictsupdates to rootdn. (e.g., "access to * by * read").The rootdn can always read and write EVERYTHING!.LPFor entries not held in any backend (such as a root DSE), thedirectives of the first backend (and any global directives) areused..LPArguments that should be replaced by actual text are shown inbrackets <>..SH THE ACCESS DIRECTIVEThe structure of the access control directives is.TP.B access to <what> "[ by <who> [ <access> ] [ <control> ] ]+"Grant access (specified by .BR <access> ) to a set of entries and/or attributes (specified by .BR <what> ) by one or more requestors (specified by .BR <who> )..SH THE <WHAT> FIELDThe field.BR <what>specifies the entity the access control directive applies to.It can have the forms.LP.nf dn[.<dnstyle>]=<dnpattern> filter=<ldapfilter> attrs=<attrlist>[ val[/matchingRule][.<attrstyle>]=<attrval>].fi.LPwith.LP.nf <dnstyle>={{exact|base(object)}|regex |one(level)|sub(tree)|children} <attrlist>={<attr>|[{!|@}]<objectClass>}[,<attrlist>] <attrstyle>={{exact|base(object)}|regex |one(level)|sub(tree)|children}.fi.LPThe statement.B dn=<dnpattern>selects the entries based on their naming context.The.B <dnpattern>is a string representation of the entry's DN.The wildcard.B *stands for all the entries, and it is implied if no.B dnform is given..LPThe .B <dnstyle> is optional; however, it is recommended to specify it to avoid ambiguities..B Base (synonym of.BR baseObject ),the default,or.B exact (an alias of .BR base )indicates the entry whose DN is equal to the.BR <dnpattern> ;.B one(synonym of.BR onelevel )indicates all the entries immediately below the.BR <dnpattern> ,.B sub(synonym of.BR subtree )indicates all entries in the subtree at the.BR <dnpattern> ,.B childrenindicates all the entries below (subordinate to) the .BR <dnpattern> ..LPIf the.B <dnstyle>qualifier is.BR regex ,then .B <dnpattern>is a POSIX (''extended'') regular expression pattern,as detailed in.BR regex (7)and/or.BR re_format (7),matching a normalized string representation of the entry's DN.The regex form of the pattern does not (yet) support UTF\-8..LPThe statement.B filter=<ldapfilter>selects the entries based on a valid LDAP filter as described in RFC 2254.A filter of.B (objectClass=*)is implied if no.B filterform is given..LPThe statement.B attrs=<attrlist>selects the attributes the access control rule applies to.It is a comma-separated list of attribute types, plus the special names.BR entry ,indicating access to the entry itself, and.BR children ,indicating access to the entry's children. ObjectClass names may alsobe specified in this list, which will affect all the attributes thatare required and/or allowed by that objectClass.Actually, names in .B <attrlist>that are prefixed by.B @are directly treated as objectClass names. A name prefixed by.B !is also treated as an objectClass, but in this case the access ruleaffects the attributes that are not required nor allowed by that objectClass.If no.B attrsform is given, .B attrs=@extensibleObjectis implied, i.e. all attributes are addressed..LPUsing the form.B attrs=<attr> val[/matchingRule][.<attrstyle>]=<attrval>specifies access to a particular value of a single attribute.In this case, only a single attribute type may be given. The.B <attrstyle>.B exact(the default) uses the attribute's equality matching rule to compare thevalue, unless a different (and compatible) matching rule is specified. If the.B <attrstyle>is.BR regex ,the provided value is used as a POSIX (''extended'') regularexpression pattern. If the attribute has DN syntax, the .B <attrstyle>can be any of.BR base ,.BR onelevel ,.B subtreeor.BR children ,resulting in base, onelevel, subtree or children match, respectively..LPThe dn, filter, and attrs statements are additive; they can be used in sequence to select entities the access rule applies to based on naming context,value and attribute type simultaneously..SH THE <WHO> FIELDThe field.B <who>indicates whom the access rules apply to.Multiple .B <who>statements can appear in an access control statement, indicating thedifferent access privileges to the same resource that apply to differentaccessee.It can have the forms.LP.nf * anonymous users self[.<selfstyle>] dn[.<dnstyle>[,<modifier>]]=<DN> dnattr=<attrname> realanonymous realusers realself[.<selfstyle>] realdn[.<dnstyle>[,<modifier>]]=<DN> realdnattr=<attrname> group[/<objectclass>[/<attrname>]] [.<groupstyle>]=<group> peername[.<peernamestyle>]=<peername> sockname[.<style>]=<sockname> domain[.<domainstyle>[,<modifier>]]=<domain> sockurl[.<style>]=<sockurl> set[.<setstyle>]=<pattern> ssf=<n> transport_ssf=<n> tls_ssf=<n> sasl_ssf=<n> aci[=<attrname>] dynacl/name[/<options>][.<dynstyle>][=<pattern>].fi.LPwith.LP.nf <style>={exact|regex|expand} <selfstyle>={level{<n>}} <dnstyle>={{exact|base(object)}|regex |one(level)|sub(tree)|children|level{<n>}} <groupstyle>={exact|expand} <peernamestyle>={<style>|ip|path} <domainstyle>={exact|regex|sub(tree)} <setstyle>={exact|regex} <modifier>={expand}.fi.LPThey may be specified in combination..LP.nf.fi.LPThe wildcard.B *refers to everybody..LPThe keywords prefixed by.B realact as their counterparts without prefix; the checking respectively occurswith the \fIauthentication\fP DN and the \fIauthorization\fP DN..LPThe keyword.B anonymousmeans access is granted to unauthenticated clients; it is mostly used to limit access to authentication resources (e.g. the.B userPasswordattribute) to unauthenticated clients for authentication purposes..LPThe keyword.B usersmeans access is granted to authenticated clients..LPThe keyword.B selfmeans access to an entry is allowed to the entry itself (e.g. the entrybeing accessed and the requesting entry must be the same).It allows the .B level{<n>}style, where \fI<n>\fP indicates what ancestor of the DN is to be used in matches.A positive value indicates that the <n>-th ancestor of the user's DNis to be considered; a negative value indicates that the <n>-th ancestorof the target is to be considered.For example, a "\fIby self.level{1} ...\fP" clause would matchwhen the object "\fIdc=example,dc=com\fP" is accessedby "\fIcn=User,dc=example,dc=com\fP".A "\fIby self.level{-1} ...\fP" clause would match when the same useraccesses the object "\fIou=Address Book,cn=User,dc=example,dc=com\fP"..LPThe statement.B dn=<DN>means that access is granted to the matching DN.The optional style qualifier.B dnstyleallows the same choices of the dn form of the.B <what>field. In addition, the.B regexstyle can exploit substring substitution of submatches in the.B <what>dn.regex clause by using the form.BR $<digit> ,with .B digitranging from 0 to 9 (where 0 matches the entire string),or the form.BR ${<digit>+} ,for submatches higher than 9.Since the dollar character is used to indicate a substring replacement,the dollar character that is used to indicate match up to the end ofthe string must be escaped by a second dollar character, e.g..LP.nf access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$" by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write.fi.LPThe style qualifierallows an optional.BR modifier .At present, the only type allowed is .BR expand ,which causes substring substitution of submatches to take placeeven if .B dnstyleis not .BR regex .Note that the .B regex dnstyle in the above example may be of use only if the .B <by>clause needs to be a regex; otherwise, if thevalue of the second (from the right).B dc=portion of the DN in the above example were fixed, the form.LP.nf access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$" by dn.exact,expand="uid=$2,dc=example,dc=com" write.fi.LPcould be used; if it had to match the value in the .B <what>clause, the form.LP.nf access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$" by dn.exact,expand="uid=$2,dc=$3,dc=com" write.fi.LPcould be used..LPForms of the .B <what>clause other than regex may provide submatches as well.The .BR base(object) ,the.BR sub(tree) ,the.BR one(level) ,and the.BR childrenforms provide.B $0as the match of the entire string.The .BR sub(tree) ,the.BR one(level) ,and the.BR childrenforms also provide.B $1as the match of the rightmost part of the DN as defined in the.B <what>clause.This may be useful, for instance, to provide access to all the ancestors of a user by defining.LP.nf access to dn.subtree="dc=com" by dn.subtree,expand="$1" read.fi.LPwhich means that only access to entries that appear in the DN of the.B <by>clause is allowed..LPThe .BR level{<n>}form is an extension and a generalization of the.BR onelevelform, which matches all DNs whose <n>-th ancestor is the pattern.So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP, and \fIlevel{0}\fP is equivalent to \fIbase\fP..LPIt is perfectly useless to give any access privileges to a DN that exactly matches the.B rootdnof the database the ACLs apply to, because it implicitlypossesses write privileges for the entire tree of that database.Actually, access control is bypassed for the.BR rootdn ,to solve the intrinsic chicken-and-egg problem..LPThe statement.B dnattr=<attrname>means that access is granted to requests whose DN is listed in theentry being accessed under the .B <attrname>attribute..LPThe statement.B group=<group>means that access is granted to requests whose DN is listedin the group entry whose DN is given by.BR <group> .The optional parameters.B <objectclass>and.B <attrname>define the objectClass and the member attributeType of the group entry.The defaults are.B groupOfNamesand.BR member ,respectively.The optional style qualifier.B <style>can be.BR expand ,which means that.B <group>will be expanded as a replacement string (but not as a regular expression)according to.BR regex (7)and/or.BR re_format (7),and.BR exact ,which means that exact match will be used.If the style of the DN portion of the.B <what>clause is regex, the submatches are made available according to.BR regex (7)and/or.BR re_format (7);other styles provide limited submatches as discussed above about the DN form of the .B <by>clause..LPFor static groups, the specified attributeType must have.B DistinguishedNameor.B NameAndOptionalUIDsyntax. For dynamic groups the attributeType mustbe a subtype of the.B labeledURIattributeType. Only LDAP URIs of the form.B ldap:///<base>??<scope>?<filter>will be evaluated in a dynamic group, by searching the local server only..LPThe statements.BR peername=<peername> ,.BR sockname=<sockname> ,.BR domain=<domain> ,and.BR sockurl=<sockurl>mean that the contacting host IP (in the form .BR "IP=<ip>:<port>" )or the contacting host named pipe file name (in the form.B "PATH=<path>"if connecting through a named pipe) for.BR peername ,the named pipe file name for.BR sockname ,the contacting host name for.BR domain ,and the contacting URL for.BR sockurlare compared against.B patternto determine access.The same.B stylerules for pattern match described for the.B groupcase apply, plus the.B regexstyle, which implies submatch.B expandand regex match of the corresponding connection parameters.The.B exactstyle of the.BR <peername>clause (the default) implies a case-exact match on the client's.BR IP , including the.B "IP="prefix and the trailing.BR ":<port>" , or the client's .BR path ,including the.B "PATH="prefix if connecting through a named pipe.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -