]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
77c52ca7efd4d5e776e8a325286fb4bcb097fae8
[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 The style qualifier
220 allows an optional
221 .BR modifier .
222 At present, the only type allowed is 
223 .BR expand ,
224 which causes substring substitution of submatches to take place
225 even if 
226 .B dnstyle
227 is not 
228 .BR regex .
229 .LP
230 The statement
231 .B dnattr=<attrname>
232 means that access is granted to requests whose DN is listed in the
233 entry being accessed under the 
234 .B <attrname>
235 attribute.
236 .LP
237 The statement
238 .B group=<group>
239 means that access is granted to requests whose DN is listed
240 in the group entry whose DN is given by
241 .BR <group> .
242 The optional parameters
243 .B <objectclass>
244 and
245 .B <attrname>
246 define the objectClass and the member attributeType of the group entry.
247 The optional style qualifier
248 .B <style>
249 can be
250 .BR regex ,
251 which means that
252 .B <group>
253 will be expanded as a replacement string (but not as a regular expression)
254 according to regex (7), and
255 .B base
256 or
257 .B exact
258 (an alias of
259 .BR base ),
260 which means that exact match will be used.
261 .LP
262 For static groups, the specified attributeType must have
263 .B DistinguishedName
264 or
265 .B NameAndOptionalUID
266 syntax. For dynamic groups the attributeType must
267 be a subtype of the
268 .B labeledURI
269 attributeType. Only LDAP URIs of the form
270 .B ldap:///<base>??<scope>?<filter>
271 will be evaluated in a dynamic group.
272 .LP
273 The statements
274 .BR peername=<peername> ,
275 .BR sockname=<sockname> ,
276 .BR domain=<domain> ,
277 and
278 .BR sockurl=<sockurl>
279 mean that the contacting host IP for
280 .BR peername ,
281 the named pipe file name for
282 .BR sockname ,
283 the contacting host name for
284 .BR domain ,
285 and the contacting URL for
286 .BR sockurl
287 are compared against
288 .B pattern
289 to determine access.
290 The same
291 .B style
292 rules for pattern match described for the
293 .B group
294 case apply. 
295 The
296 .BR domain 
297 clause also allows the
298 .B subtree
299 style, which succeeds when a fully qualified name exactly matches the
300 .BR domain
301 pattern, or its trailing part, after a 
302 .BR dot ,
303 exactly matches the 
304 .BR domain
305 pattern.
306 The
307 .B domain
308 of the contacting host is determined by performing a DNS reverse lookup.
309 As this lookup can easily be spoofed, use of the
310 .B domain
311 statement is strongly discouraged.  By default, reverse lookups are disabled.
312 The optional
313 .B domainstyle
314 qualifier of the
315 .B domain
316 clause allows a
317 .B modifier
318 option; the only value currently supported is
319 .BR expand ,
320 which causes substring substitution of submatches to take place even if
321 the 
322 .B domainstyle
323 is not 
324 .BR regex ,
325 much like the analogous usage in 
326 .B dn
327 clause.
328 .LP
329 The statement
330 .B set=<pattern>
331 is undocumented yet.
332 .LP
333 The statement
334 .B aci=<attrname>
335 means that the access control is determined by the values in the
336 .B attrname
337 of the entry itself.
338 ACIs are experimental; they must be enabled at compile time.
339 .LP
340 The statements
341 .BR ssf=<n> ,
342 .BR transport_ssf=<n> ,
343 .BR tls_ssf=<n> ,
344 and
345 .BR sasl_ssf=<n>
346 set the required Security Strength Factor (ssf) required to grant access.
347 .LP
348 The field
349 .B <access> ::= [self]{<level>|<priv>}
350 determines the access level or the specific access privileges the
351 .B who 
352 field will have.
353 Its component are defined as
354 .LP
355 .nf
356         <level> ::= none|auth|compare|search|read|write
357         <priv> ::= {=|+|-}{w|r|s|c|x}+
358 .fi
359 .LP
360 The modifier
361 .B self
362 allows special operations like having a certain access level or privilege
363 only in case the operation involves the name of the user that's requesting
364 the access.
365 It implies the user that requests access is bound.
366 An example is the
367 .B selfwrite
368 access to the member attribute of a group, which allows one to add/delete
369 its own DN from the member list of a group, without affecting other members.
370 .LP
371 The 
372 .B level 
373 access model relies on an incremental interpretation of the access
374 privileges.
375 The possible levels are
376 .BR none ,
377 .BR auth ,
378 .BR compare ,
379 .BR search ,
380 .BR read ,
381 and
382 .BR write .
383 Each access level implies all the preceding ones, thus 
384 .B write
385 access will imply all accesses.
386 While
387 .B none
388 is trivial, 
389 .B auth
390 access means that one is allowed access to an attribute to perform
391 authentication/authorization operations (e.g.
392 .BR bind )
393 with no other access.
394 This is useful to grant unauthenticated clients the least possible 
395 access level to critical resources, like passwords.
396 .LP
397 The
398 .B priv
399 access model relies on the explicit setting of access privileges
400 for each clause.
401 The
402 .B =
403 sign resets previously defined accesses; as a consequence, the final 
404 access privileges will be only those defined by the clause.
405 The 
406 .B +
407 and
408 .B -
409 signs add/remove access privileges to the existing ones.
410 The privileges are
411 .B w
412 for write,
413 .B r
414 for read,
415 .B s 
416 for search,
417 .B c 
418 for compare, and
419 .B x
420 for authentication.
421 More than one privilege can be added in one statement.
422 .LP
423 The optional field
424 .B <control>
425 controls the flow of access rule application.
426 It can have the forms
427 .LP
428 .nf
429         stop
430         continue
431         break
432 .fi
433 .LP
434 where
435 .BR stop ,
436 the default, means access checking stops in case of match.
437 The other two forms are used to keep on processing access clauses.
438 In detail, the
439 .B continue
440 form allows for other 
441 .B <who>
442 clauses in the same 
443 .B <access>
444 clause to be considered, so that they may result in incrementally altering
445 the privileges, while the
446 .B break
447 form allows for other
448 .B <access>
449 clauses that match the same target to be processed.
450 Consider the (silly) example
451 .LP
452 .nf
453         access to dn.subtree="dc=example,dc=com" attrs=cn
454                 by * =cs break
455
456         access to dn.subtree="ou=People,dc=example,dc=com"
457                 by * +r
458 .fi
459 .LP
460 which allows search and compare privileges to everybody under
461 the "dc=example,dc=com" tree, with the second rule allowing
462 also read in the "ou=People" subtree,
463 or the (even more silly) example
464 .LP
465 .nf
466         access to dn.subtree="dc=example,dc=com" attrs=cn
467                 by * =cs continue
468                 by users +r
469 .fi
470 .LP
471 which grants everybody search and compare privileges, and adds read
472 privileges to authenticated clients.
473 .SH CAVEATS
474 It is strongly recommended to explicitly use the most appropriate
475 DN 
476 .BR style ,
477 to avoid possible incorrect specifications of the access rules as well
478 as for performance (avoid unrequired regex matching when an exact
479 match suffices) reasons.
480 .LP
481 An adminisistrator might create a rule of the form:
482 .LP
483 .nf
484         access to dn.regex="dc=example,dc=com"
485                 by ...
486 .fi
487 .LP
488 expecting it to match all entries in the subtree "dc=example,dc=com".
489 However, this rule actually matches any DN which contains anywhere
490 the substring "dc=example,dc=com".  That is, the rule matches both
491 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
492 .LP
493 To match the desired subtree, the rule would be more precisely
494 written:
495 .LP
496 .nf
497         access to dn.regex="^(.+,)?dc=example,dc=com$$"
498                 by ...
499 .fi
500 .LP
501 For performance reasons, it would be better to use the subtree style.
502 .LP
503 .nf
504         access to dn.subtree="dc=example,dc=com"
505                 by ...
506 .fi
507 .LP
508 .SH FILES
509 .TP
510 ETCDIR/slapd.conf
511 default slapd configuration file
512 .SH SEE ALSO
513 .BR slapd (8),
514 .LP
515 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
516 .SH ACKNOWLEDGEMENTS
517 .B OpenLDAP
518 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
519 .B OpenLDAP
520 is derived from University of Michigan LDAP 3.3 Release.