]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
215357e9aa11f943be71b74d5974c5d3843cca16
[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>]=<pattern>] 
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=<pattern>
84 selects the entries based on their naming context.
85 The optional style qualifier
86 .B <dnstyle>
87 can be 
88 .B regex
89 (the default) implies that
90 .B pattern
91 is a regular expression, as detailed in
92 .BR regex (7),
93 matching a normalized string representation of the entry's DN.
94 The regex form of the pattern does not support UTF-8 yet.
95 .LP
96 For all other qualifiers, the pattern is a string representation of
97 the entry's DN.
98 .B base
99 or
100 .B exact 
101 (an alias of 
102 .BR base )
103 indicates the entry whose DN is equal to the pattern.
104 .B one
105 indicates all the entries immediately below the
106 .BR pattern ,
107 .B subtree
108 indicates all entries in the subtree at the pattern,
109 .B children
110 indicates all the entries below (subordinate to) the pattern.
111 Note that 
112 .B dn=".*"
113 is equivalent to
114 .BR * .
115 .LP
116 The statement
117 .B filter=<ldapfilter>
118 selects the entries based on a valid LDAP filter as described in RFC 2254.
119 .LP
120 The statement
121 .B attrs=<attrlist>
122 selects the attributes the access control rule applies to.
123 It is a comma-separated list of attribute types, plus the special names
124 .BR entry ,
125 indicating access to the entry itself, and
126 .BR children ,
127 indicating access to the entry's children. ObjectClass names may also
128 be specified in this list, which will affect all the attributes that
129 are required and/or allowed by that objectClass.
130 .LP
131 The last three statements are additive; they can be used in sequence 
132 to select entities the access rule applies to based on naming context,
133 value and attribute type simultaneously.
134 .LP
135 The field
136 .B <who>
137 indicates whom the access rules apply to.
138 Multiple 
139 .B <who>
140 statements can appear in an access control statement, indicating the
141 different access privileges to the same resource that apply to different
142 accessee.
143 It can have the forms
144 .LP
145 .nf
146         *
147         anonymous
148         users
149         self
150
151         dn[.<dnstyle>[,<modifier>]]=<pattern>
152         dnattr=<attrname>
153         group[/<objectclass>[/<attrname>]]
154                 [.<style>]=<pattern>
155         peername[.<style>]=<pattern>
156         sockname[.<style>]=<pattern>
157         domain[.<domainstyle>[,<modifier>]]=<pattern>
158         sockurl[.<style>]=<pattern>
159         set[.<style>]=<pattern>
160
161         ssf=<n>
162         transport_ssf=<n>
163         tls_ssf=<n>
164         sasl_ssf=<n>
165
166         aci=<attrname>
167 .fi
168 .LP
169 They may be specified in combination.
170 .LP
171 .nf
172 .fi
173 .LP
174 The wildcard
175 .B *
176 refers to everybody.
177 .LP
178 The keyword
179 .B anonymous
180 means access is granted to unauthenticated clients; it is mostly used 
181 to limit access to authentication resources (e.g. the
182 .B userPassword
183 attribute) to unauthenticated clients for authentication purposes.
184 .LP
185 The keyword
186 .B users
187 means access is granted to authenticated clients.
188 .LP
189 The keyword
190 .B self
191 means access to an entry is allowed to the entry itself (e.g. the entry
192 being accessed and the requesting entry must be the same).
193 .LP
194 The statement
195 .B dn=<pattern>
196 means that access is granted to the matching DN.
197 The optional style qualifier
198 .B dnstyle
199 allows the same choices of the dn form of the
200 .B <what>
201 field.  In addition, the
202 .B regex
203 form of
204 .B pattern
205 can exploit substring substitution of submatches in the
206 .B <what>
207 dn.regex clause by using the form
208 .BR $<digit> ,
209 with 
210 .B digit
211 ranging from 1 to 9.
212 .LP
213 The statement
214 .B dnattr=<attrname>
215 means that access is granted to requests whose DN is listed in the
216 entry being accessed under the 
217 .B attrname
218 attribute.
219 .LP
220 The statement
221 .B group=<pattern>
222 means that access is granted to requests whose DN is listed
223 in the group entry whose DN is given by
224 .BR pattern .
225 The optional parameters
226 .B objectclass
227 and
228 .B attrname
229 define the objectClass and the member attributeType of the group entry.
230 The optional style qualifier
231 .B style
232 can be
233 .BR regex ,
234 which means that
235 .B pattern
236 will be expanded accorging to regex (7), and
237 .B base
238 or
239 .B exact
240 (an alias of
241 .BR base ),
242 which means that exact match will be used.
243 .LP
244 The statements
245 .BR peername=<pattern> ,
246 .BR sockname=<pattern> ,
247 .BR domain=<pattern> ,
248 and
249 .BR sockurl=<pattern>
250 mean that the contacting host IP for
251 .BR peername ,
252 the named pipe file name for
253 .BR sockname ,
254 the contacting host name for
255 .BR domain ,
256 and the contacting URL for
257 .BR sockurl
258 are compared against
259 .B pattern
260 to determine access.
261 The same
262 .B style
263 rules for pattern match described for the
264 .B group
265 case apply. 
266 The
267 .BR domain 
268 clause also allows the
269 .B subtree
270 style, which succeeds when a fully qualified name exactly matches the
271 .BR domain
272 pattern, or its trailing part, after a 
273 .BR dot ,
274 exactly matches the 
275 .BR domain
276 pattern.
277 The
278 .B domain
279 of the contacting host is determined by performing a DNS reverse lookup.
280 As this lookup can easily be spoofed, use of the
281 .B domain
282 statement is strongly discouraged.  By default, reverse lookups are disabled.
283 .LP
284 The statement
285 .B set=<pattern>
286 is undocumented yet.
287 .LP
288 The statement
289 .B aci=<attrname>
290 means that the access control is determined by the values in the
291 .B attrname
292 of the entry itself.
293 ACIs are experimental; they must be enabled at compile time.
294 .LP
295 The statements
296 .BR ssf=<n> ,
297 .BR transport_ssf=<n> ,
298 .BR tls_ssf=<n> ,
299 and
300 .BR sasl_ssf=<n>
301 set the required Security Strength Factor (ssf) required to grant access.
302 .LP
303 The field
304 .B <access> ::= [self]{<level>|<priv>}
305 determines the access level or the specific access privileges the
306 .B who 
307 field will have.
308 Its component are defined as
309 .LP
310 .nf
311         <level> ::= none|auth|compare|search|read|write
312         <priv> ::= {=|+|-}{w|r|s|c|x}+
313 .fi
314 .LP
315 The modifier
316 .B self
317 allows special operations like having a certain access level or privilege
318 only in case the operation involves the name of the user that's requesting
319 the access.
320 It implies the user that requests access is bound.
321 An example is the
322 .B selfwrite
323 access to the member attribute of a group, which allows one to add/delete
324 its own DN from the member list of a group, without affecting other members.
325 .LP
326 The 
327 .B level 
328 access model relies on an incremental interpretation of the access
329 privileges.
330 The possible levels are
331 .BR none ,
332 .BR auth ,
333 .BR compare ,
334 .BR search ,
335 .BR read ,
336 and
337 .BR write .
338 Each access level implies all the preceding ones, thus 
339 .B write
340 access will imply all accesses.
341 While
342 .B none
343 is trivial, 
344 .B auth
345 access means that one is allowed access to an attribute to perform
346 authentication/authorization operations (e.g.
347 .BR bind )
348 with no other access.
349 This is useful to grant unauthenticated clients the least possible 
350 access level to critical resources, like passwords.
351 .LP
352 The
353 .B priv
354 access model relies on the explicit setting of access privileges
355 for each clause.
356 The
357 .B =
358 sign resets previously defined accesses; as a consequence, the final 
359 access privileges will be only those defined by the clause.
360 The 
361 .B +
362 and
363 .B -
364 signs add/remove access privileges to the existing ones.
365 The privileges are
366 .B w
367 for write,
368 .B r
369 for read,
370 .B s 
371 for search,
372 .B c 
373 for compare, and
374 .B x
375 for authentication.
376 More than one privilege can be added in one statement.
377 .LP
378 The optional field
379 .B <control>
380 controls the flow of access rule application.
381 It can have the forms
382 .LP
383 .nf
384         stop
385         continue
386         break
387 .fi
388 .LP
389 where
390 .BR stop ,
391 the default, means access checking stops in case of match.
392 The other two forms are used to keep on processing access clauses.
393 In detail, the
394 .B continue
395 form allows for other 
396 .B <who>
397 clauses in the same 
398 .B <access>
399 clause to be considered, so that they may result in incrementally altering
400 the privileges, while the
401 .B break
402 form allows for other
403 .B <access>
404 clauses that match the same target to be processed.
405 Consider the (silly) example
406 .LP
407 .nf
408         access to dn.subtree="dc=example,dc=com" attrs=cn
409                 by * =cs break
410
411         access to dn.subtree="ou=People,dc=example,dc=com"
412                 by * +r
413 .fi
414 .LP
415 which allows search and compare privileges to everybody under
416 the "dc=example,dc=com" tree, with the second rule allowing
417 also read in the "ou=People" subtree,
418 or the (even more silly) example
419 .LP
420 .nf
421         access to dn.subtree="dc=example,dc=com" attrs=cn
422                 by * =cs continue
423                 by users +r
424 .fi
425 .LP
426 which grants everybody search and compare privileges, and adds read
427 privileges to authenticated clients.
428 .SH CAVEATS
429 It is strongly recommended to explicitly use the most appropriate
430 DN 
431 .BR style ,
432 to avoid possible 
433 incorrect specifications of the access rules as well
434 as for performance (avoid unrequired regex matching when
435 an exact match suffices) reasons.
436 .LP
437 An adminisistrator might create a rule of the form:
438 .LP
439 .nf
440         access to dn="dc=example,dc=com"
441                 by ...
442 .fi
443 .LP
444 expecting it to match all entries in the subtree "dc=example,dc=com".
445 However, this rule actually matches any DN which contains anywhere
446 the substring "dc=example,dc=com".  That is, the rule matches both
447 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
448 .LP
449 To match the desired subtree, the rule would be more precisely
450 written:
451 .LP
452 .nf
453         access to dn.regex="^(.+,)?dc=example,dc=com$$"
454                 by ...
455 .fi
456 .LP
457 For performance reasons, it would be better to use the subtree style.
458 .LP
459 .nf
460 access to dn.subtree="dc=example,dc=com"
461         by ...
462 .fi
463 .LP
464 .SH FILES
465 .TP
466 ETCDIR/slapd.conf
467 default slapd configuration file
468 .SH SEE ALSO
469 .BR slapd (8),
470 .LP
471 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
472 .SH ACKNOWLEDGEMENTS
473 .B OpenLDAP
474 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
475 .B OpenLDAP
476 is derived from University of Michigan LDAP 3.3 Release.