]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
ebf9264488736dd1bbeb26d0ba87bb415712ad14
[openldap] / doc / man / man5 / slapd.access.5
1 .TH SLAPD.ACCESS 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2003 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .SH NAME
5 slapd.access \- access configuration for slapd, the stand-alone LDAP daemon
6 .SH SYNOPSIS
7 ETCDIR/slapd.conf
8 .SH DESCRIPTION
9 The 
10 .BR slapd.conf (5)
11 file contains configuration information for the
12 .BR slapd (8)
13 daemon. This configuration file is also used by the
14 .BR slurpd (8)
15 replication daemon and by the SLAPD tools
16 .BR slapadd (8),
17 .BR slapcat (8),
18 and
19 .BR slapindex (8).
20 .LP
21 The
22 .B slapd.conf
23 file consists of a series of global configuration options that apply to
24 .B slapd
25 as a whole (including all backends), followed by zero or more database
26 backend definitions that contain information specific to a backend
27 instance.
28 .LP
29 The general format of
30 .B slapd.conf
31 is as follows:
32 .LP
33 .nf
34     # comment - these options apply to every database
35     <global configuration options>
36     # first database definition & configuration options
37     database    <backend 1 type>
38     <configuration options specific to backend 1>
39     # subsequent database definitions & configuration options
40     ...
41 .fi
42 .LP
43 Both the global configuration and each backend-specific section can
44 contain access information.  Backend-specific access control
45 directives are used for those entries that belong to the backend,
46 according to their naming context.  In case no access control
47 directives are defined for a backend or those which are defined are
48 not applicable, the directives from the global configuration section
49 are then used.
50 .LP
51 For entries not held in any backend (such as a root DSE), the
52 directives of the first backend (and any global directives) are
53 used.
54 .LP
55 Arguments that should be replaced by actual text are shown in
56 brackets <>.  The structure of the access control directives is
57 .TP
58 .B access to <what> "[ by <who> <access> [ <control> ] ]+"
59 Grant access (specified by 
60 .BR <access> ) 
61 to a set of entries and/or attributes (specified by 
62 .BR <what> ) 
63 by one or more requestors (specified by 
64 .BR <who> ).
65 .LP
66 The field
67 .BR <what>
68 specifies the entity the access control directive applies to.
69 It can have the forms
70 .LP
71 .nf
72         *
73         [dn[.<dnstyle>]=<DN>] 
74         [filter=<ldapfilter>]
75         [attrs=<attrlist>]
76 .fi
77 .LP
78 The wildcard
79 .B *
80 stands for all the entries.
81 .LP
82 The statement
83 .B dn=<DN>
84 selects the entries based on their naming context.
85 The pattern is a string representation of the entry's DN.
86 .BR base ,
87 the default,
88 or
89 .B exact 
90 (an alias of 
91 .BR base )
92 indicates the entry whose DN is equal to the pattern.
93 .B one
94 indicates all the entries immediately below the
95 .BR pattern ,
96 .B subtree
97 indicates all entries in the subtree at the pattern,
98 .B children
99 indicates all the entries below (subordinate to) the pattern.
100 .LP
101 If the
102 .B <dnstyle>
103 qualifier is
104 .BR regex ,
105 then the value is a regular expression pattern,
106 as detailed in
107 .BR regex (7),
108 matching a normalized string representation of the entry's DN.
109 The regex form of the pattern does not (yet) support UTF-8.
110 .LP
111 The statement
112 .B filter=<ldapfilter>
113 selects the entries based on a valid LDAP filter as described in RFC 2254.
114 .LP
115 The statement
116 .B attrs=<attrlist>
117 selects the attributes the access control rule applies to.
118 It is a comma-separated list of attribute types, plus the special names
119 .BR entry ,
120 indicating access to the entry itself, and
121 .BR children ,
122 indicating access to the entry's children. ObjectClass names may also
123 be specified in this list, which will affect all the attributes that
124 are required and/or allowed by that objectClass.
125 .LP
126 Using the form
127 .B attrs=<attr> val[.<style>]=<value>
128 specifies access to a particular value of a single attribute.
129 In this case, only a single attribute type may be given. A value
130 .B <style>
131 of
132 .B exact
133 (the default) uses the attribute's equality matching rule to compare the
134 value. If the
135 .B <style>
136 is
137 .BR regex ,
138 the provided value is used as a regular expression pattern.
139 .LP
140 The dn, filter, and attrs statements are additive; they can be used in sequence 
141 to select entities the access rule applies to based on naming context,
142 value and attribute type simultaneously.
143 .LP
144 The field
145 .B <who>
146 indicates whom the access rules apply to.
147 Multiple 
148 .B <who>
149 statements can appear in an access control statement, indicating the
150 different access privileges to the same resource that apply to different
151 accessee.
152 It can have the forms
153 .LP
154 .nf
155         *
156         anonymous
157         users
158         self
159
160         dn[.<dnstyle>[,<modifier>]]=<DN>
161         dnattr=<attrname>
162         group[/<objectclass>[/<attrname>]]
163                 [.<style>]=<group>
164         peername[.<style>]=<peername>
165         sockname[.<style>]=<sockname>
166         domain[.<domainstyle>[,<modifier>]]=<domain>
167         sockurl[.<style>]=<sockurl>
168         set[.<style>]=<pattern>
169
170         ssf=<n>
171         transport_ssf=<n>
172         tls_ssf=<n>
173         sasl_ssf=<n>
174
175         aci=<attrname>
176 .fi
177 .LP
178 They may be specified in combination.
179 .LP
180 .nf
181 .fi
182 .LP
183 The wildcard
184 .B *
185 refers to everybody.
186 .LP
187 The keyword
188 .B anonymous
189 means access is granted to unauthenticated clients; it is mostly used 
190 to limit access to authentication resources (e.g. the
191 .B userPassword
192 attribute) to unauthenticated clients for authentication purposes.
193 .LP
194 The keyword
195 .B users
196 means access is granted to authenticated clients.
197 .LP
198 The keyword
199 .B self
200 means access to an entry is allowed to the entry itself (e.g. the entry
201 being accessed and the requesting entry must be the same).
202 .LP
203 The statement
204 .B dn=<DN>
205 means that access is granted to the matching DN.
206 The optional style qualifier
207 .B dnstyle
208 allows the same choices of the dn form of the
209 .B <what>
210 field.  In addition, the
211 .B regex
212 style can exploit substring substitution of submatches in the
213 .B <what>
214 dn.regex clause by using the form
215 .BR $<digit> ,
216 with 
217 .B digit
218 ranging from 1 to 9.
219 .LP
220 The statement
221 .B dnattr=<attrname>
222 means that access is granted to requests whose DN is listed in the
223 entry being accessed under the 
224 .B <attrname>
225 attribute.
226 .LP
227 The statement
228 .B group=<group>
229 means that access is granted to requests whose DN is listed
230 in the group entry whose DN is given by
231 .BR <group> .
232 The optional parameters
233 .B <objectclass>
234 and
235 .B <attrname>
236 define the objectClass and the member attributeType of the group entry.
237 The optional style qualifier
238 .B <style>
239 can be
240 .BR regex ,
241 which means that
242 .B <group>
243 will be expanded according to regex (7), and
244 .B base
245 or
246 .B exact
247 (an alias of
248 .BR base ),
249 which means that exact match will be used.
250 .LP
251 For static groups, the specified attributeType must have
252 .B DistinguishedName
253 or
254 .B NameAndOptionalUID
255 syntax. For dynamic groups the attributeType must
256 be a subtype of the
257 .B labeledURI
258 attributeType. Only LDAP URIs of the form
259 .B ldap:///<base>??<scope>?<filter>
260 will be evaluated in a dynamic group.
261 .LP
262 The statements
263 .BR peername=<peername> ,
264 .BR sockname=<sockname> ,
265 .BR domain=<domain> ,
266 and
267 .BR sockurl=<sockurl>
268 mean that the contacting host IP for
269 .BR peername ,
270 the named pipe file name for
271 .BR sockname ,
272 the contacting host name for
273 .BR domain ,
274 and the contacting URL for
275 .BR sockurl
276 are compared against
277 .B pattern
278 to determine access.
279 The same
280 .B style
281 rules for pattern match described for the
282 .B group
283 case apply. 
284 The
285 .BR domain 
286 clause also allows the
287 .B subtree
288 style, which succeeds when a fully qualified name exactly matches the
289 .BR domain
290 pattern, or its trailing part, after a 
291 .BR dot ,
292 exactly matches the 
293 .BR domain
294 pattern.
295 The
296 .B domain
297 of the contacting host is determined by performing a DNS reverse lookup.
298 As this lookup can easily be spoofed, use of the
299 .B domain
300 statement is strongly discouraged.  By default, reverse lookups are disabled.
301 .LP
302 The statement
303 .B set=<pattern>
304 is undocumented yet.
305 .LP
306 The statement
307 .B aci=<attrname>
308 means that the access control is determined by the values in the
309 .B attrname
310 of the entry itself.
311 ACIs are experimental; they must be enabled at compile time.
312 .LP
313 The statements
314 .BR ssf=<n> ,
315 .BR transport_ssf=<n> ,
316 .BR tls_ssf=<n> ,
317 and
318 .BR sasl_ssf=<n>
319 set the required Security Strength Factor (ssf) required to grant access.
320 .LP
321 The field
322 .B <access> ::= [self]{<level>|<priv>}
323 determines the access level or the specific access privileges the
324 .B who 
325 field will have.
326 Its component are defined as
327 .LP
328 .nf
329         <level> ::= none|auth|compare|search|read|write
330         <priv> ::= {=|+|-}{w|r|s|c|x}+
331 .fi
332 .LP
333 The modifier
334 .B self
335 allows special operations like having a certain access level or privilege
336 only in case the operation involves the name of the user that's requesting
337 the access.
338 It implies the user that requests access is bound.
339 An example is the
340 .B selfwrite
341 access to the member attribute of a group, which allows one to add/delete
342 its own DN from the member list of a group, without affecting other members.
343 .LP
344 The 
345 .B level 
346 access model relies on an incremental interpretation of the access
347 privileges.
348 The possible levels are
349 .BR none ,
350 .BR auth ,
351 .BR compare ,
352 .BR search ,
353 .BR read ,
354 and
355 .BR write .
356 Each access level implies all the preceding ones, thus 
357 .B write
358 access will imply all accesses.
359 While
360 .B none
361 is trivial, 
362 .B auth
363 access means that one is allowed access to an attribute to perform
364 authentication/authorization operations (e.g.
365 .BR bind )
366 with no other access.
367 This is useful to grant unauthenticated clients the least possible 
368 access level to critical resources, like passwords.
369 .LP
370 The
371 .B priv
372 access model relies on the explicit setting of access privileges
373 for each clause.
374 The
375 .B =
376 sign resets previously defined accesses; as a consequence, the final 
377 access privileges will be only those defined by the clause.
378 The 
379 .B +
380 and
381 .B -
382 signs add/remove access privileges to the existing ones.
383 The privileges are
384 .B w
385 for write,
386 .B r
387 for read,
388 .B s 
389 for search,
390 .B c 
391 for compare, and
392 .B x
393 for authentication.
394 More than one privilege can be added in one statement.
395 .LP
396 The optional field
397 .B <control>
398 controls the flow of access rule application.
399 It can have the forms
400 .LP
401 .nf
402         stop
403         continue
404         break
405 .fi
406 .LP
407 where
408 .BR stop ,
409 the default, means access checking stops in case of match.
410 The other two forms are used to keep on processing access clauses.
411 In detail, the
412 .B continue
413 form allows for other 
414 .B <who>
415 clauses in the same 
416 .B <access>
417 clause to be considered, so that they may result in incrementally altering
418 the privileges, while the
419 .B break
420 form allows for other
421 .B <access>
422 clauses that match the same target to be processed.
423 Consider the (silly) example
424 .LP
425 .nf
426         access to dn.subtree="dc=example,dc=com" attrs=cn
427                 by * =cs break
428
429         access to dn.subtree="ou=People,dc=example,dc=com"
430                 by * +r
431 .fi
432 .LP
433 which allows search and compare privileges to everybody under
434 the "dc=example,dc=com" tree, with the second rule allowing
435 also read in the "ou=People" subtree,
436 or the (even more silly) example
437 .LP
438 .nf
439         access to dn.subtree="dc=example,dc=com" attrs=cn
440                 by * =cs continue
441                 by users +r
442 .fi
443 .LP
444 which grants everybody search and compare privileges, and adds read
445 privileges to authenticated clients.
446 .SH CAVEATS
447 It is strongly recommended to explicitly use the most appropriate
448 DN 
449 .BR style ,
450 to avoid possible incorrect specifications of the access rules as well
451 as for performance (avoid unrequired regex matching when an exact
452 match suffices) reasons.
453 .LP
454 An adminisistrator might create a rule of the form:
455 .LP
456 .nf
457         access to dn.regex="dc=example,dc=com"
458                 by ...
459 .fi
460 .LP
461 expecting it to match all entries in the subtree "dc=example,dc=com".
462 However, this rule actually matches any DN which contains anywhere
463 the substring "dc=example,dc=com".  That is, the rule matches both
464 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
465 .LP
466 To match the desired subtree, the rule would be more precisely
467 written:
468 .LP
469 .nf
470         access to dn.regex="^(.+,)?dc=example,dc=com$$"
471                 by ...
472 .fi
473 .LP
474 For performance reasons, it would be better to use the subtree style.
475 .LP
476 .nf
477         access to dn.subtree="dc=example,dc=com"
478                 by ...
479 .fi
480 .LP
481 .SH FILES
482 .TP
483 ETCDIR/slapd.conf
484 default slapd configuration file
485 .SH SEE ALSO
486 .BR slapd (8),
487 .LP
488 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
489 .SH ACKNOWLEDGEMENTS
490 .B OpenLDAP
491 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
492 .B OpenLDAP
493 is derived from University of Michigan LDAP 3.3 Release.