]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
219a5addaaddd991b90e55db3305f80e7e149a09
[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 <>.
57 .SH THE ACCESS DIRECTIVE
58 The structure of the access control directives is
59 .TP
60 .B access to <what> "[ by <who> <access> [ <control> ] ]+"
61 Grant access (specified by 
62 .BR <access> ) 
63 to a set of entries and/or attributes (specified by 
64 .BR <what> ) 
65 by one or more requestors (specified by 
66 .BR <who> ).
67 .SH THE <WHAT> FIELD
68 The field
69 .BR <what>
70 specifies the entity the access control directive applies to.
71 It can have the forms
72 .LP
73 .nf
74         *
75         [dn[.<dnstyle>]=<DN>] 
76         [filter=<ldapfilter>]
77         [attrs=<attrlist>]
78 .fi
79 .LP
80 The wildcard
81 .B *
82 stands for all the entries.
83 .LP
84 The statement
85 .B dn=<DN>
86 selects the entries based on their naming context.
87 The pattern is a string representation of the entry's DN.
88 .BR base ,
89 the default,
90 or
91 .B exact 
92 (an alias of 
93 .BR base )
94 indicates the entry whose DN is equal to the pattern.
95 .B one
96 indicates all the entries immediately below the
97 .BR pattern ,
98 .B subtree
99 indicates all entries in the subtree at the pattern,
100 .B children
101 indicates all the entries below (subordinate to) the pattern.
102 .LP
103 If the
104 .B <dnstyle>
105 qualifier is
106 .BR regex ,
107 then the value is a regular expression pattern,
108 as detailed in
109 .BR regex (7),
110 matching a normalized string representation of the entry's DN.
111 The regex form of the pattern does not (yet) support UTF-8.
112 .LP
113 The statement
114 .B filter=<ldapfilter>
115 selects the entries based on a valid LDAP filter as described in RFC 2254.
116 .LP
117 The statement
118 .B attrs=<attrlist>
119 selects the attributes the access control rule applies to.
120 It is a comma-separated list of attribute types, plus the special names
121 .BR entry ,
122 indicating access to the entry itself, and
123 .BR children ,
124 indicating access to the entry's children. ObjectClass names may also
125 be specified in this list, which will affect all the attributes that
126 are required and/or allowed by that objectClass.
127 .LP
128 Using the form
129 .B attrs=<attr> val[.<style>]=<value>
130 specifies access to a particular value of a single attribute.
131 In this case, only a single attribute type may be given. A value
132 .B <style>
133 of
134 .B exact
135 (the default) uses the attribute's equality matching rule to compare the
136 value. If the
137 .B <style>
138 is
139 .BR regex ,
140 the provided value is used as a regular expression pattern.
141 .LP
142 The dn, filter, and attrs statements are additive; they can be used in sequence 
143 to select entities the access rule applies to based on naming context,
144 value and attribute type simultaneously.
145 .SH THE <WHO> FIELD
146 The field
147 .B <who>
148 indicates whom the access rules apply to.
149 Multiple 
150 .B <who>
151 statements can appear in an access control statement, indicating the
152 different access privileges to the same resource that apply to different
153 accessee.
154 It can have the forms
155 .LP
156 .nf
157         *
158         anonymous
159         users
160         self
161
162         dn[.<dnstyle>[,<modifier>]]=<DN>
163         dnattr=<attrname>
164         group[/<objectclass>[/<attrname>]]
165                 [.<style>]=<group>
166         peername[.<style>]=<peername>
167         sockname[.<style>]=<sockname>
168         domain[.<domainstyle>[,<modifier>]]=<domain>
169         sockurl[.<style>]=<sockurl>
170         set[.<style>]=<pattern>
171
172         ssf=<n>
173         transport_ssf=<n>
174         tls_ssf=<n>
175         sasl_ssf=<n>
176
177         aci=<attrname>
178 .fi
179 .LP
180 They may be specified in combination.
181 .LP
182 .nf
183 .fi
184 .LP
185 The wildcard
186 .B *
187 refers to everybody.
188 .LP
189 The keyword
190 .B anonymous
191 means access is granted to unauthenticated clients; it is mostly used 
192 to limit access to authentication resources (e.g. the
193 .B userPassword
194 attribute) to unauthenticated clients for authentication purposes.
195 .LP
196 The keyword
197 .B users
198 means access is granted to authenticated clients.
199 .LP
200 The keyword
201 .B self
202 means access to an entry is allowed to the entry itself (e.g. the entry
203 being accessed and the requesting entry must be the same).
204 .LP
205 The statement
206 .B dn=<DN>
207 means that access is granted to the matching DN.
208 The optional style qualifier
209 .B dnstyle
210 allows the same choices of the dn form of the
211 .B <what>
212 field.  In addition, the
213 .B regex
214 style can exploit substring substitution of submatches in the
215 .B <what>
216 dn.regex clause by using the form
217 .BR $<digit> ,
218 with 
219 .B digit
220 ranging from 1 to 9.
221 The style qualifier
222 allows an optional
223 .BR modifier .
224 At present, the only type allowed is 
225 .BR expand ,
226 which causes substring substitution of submatches to take place
227 even if 
228 .B dnstyle
229 is not 
230 .BR regex .
231 .LP
232 The statement
233 .B dnattr=<attrname>
234 means that access is granted to requests whose DN is listed in the
235 entry being accessed under the 
236 .B <attrname>
237 attribute.
238 .LP
239 The statement
240 .B group=<group>
241 means that access is granted to requests whose DN is listed
242 in the group entry whose DN is given by
243 .BR <group> .
244 The optional parameters
245 .B <objectclass>
246 and
247 .B <attrname>
248 define the objectClass and the member attributeType of the group entry.
249 The optional style qualifier
250 .B <style>
251 can be
252 .BR regex ,
253 which means that
254 .B <group>
255 will be expanded as a replacement string (but not as a regular expression)
256 according to regex (7), and
257 .B base
258 or
259 .B exact
260 (an alias of
261 .BR base ),
262 which means that exact match will be used.
263 .LP
264 For static groups, the specified attributeType must have
265 .B DistinguishedName
266 or
267 .B NameAndOptionalUID
268 syntax. For dynamic groups the attributeType must
269 be a subtype of the
270 .B labeledURI
271 attributeType. Only LDAP URIs of the form
272 .B ldap:///<base>??<scope>?<filter>
273 will be evaluated in a dynamic group.
274 .LP
275 The statements
276 .BR peername=<peername> ,
277 .BR sockname=<sockname> ,
278 .BR domain=<domain> ,
279 and
280 .BR sockurl=<sockurl>
281 mean that the contacting host IP for
282 .BR peername ,
283 the named pipe file name for
284 .BR sockname ,
285 the contacting host name for
286 .BR domain ,
287 and the contacting URL for
288 .BR sockurl
289 are compared against
290 .B pattern
291 to determine access.
292 The same
293 .B style
294 rules for pattern match described for the
295 .B group
296 case apply. 
297 The
298 .BR domain 
299 clause also allows the
300 .B subtree
301 style, which succeeds when a fully qualified name exactly matches the
302 .BR domain
303 pattern, or its trailing part, after a 
304 .BR dot ,
305 exactly matches the 
306 .BR domain
307 pattern.
308 The
309 .B domain
310 of the contacting host is determined by performing a DNS reverse lookup.
311 As this lookup can easily be spoofed, use of the
312 .B domain
313 statement is strongly discouraged.  By default, reverse lookups are disabled.
314 The optional
315 .B domainstyle
316 qualifier of the
317 .B domain
318 clause allows a
319 .B modifier
320 option; the only value currently supported is
321 .BR expand ,
322 which causes substring substitution of submatches to take place even if
323 the 
324 .B domainstyle
325 is not 
326 .BR regex ,
327 much like the analogous usage in 
328 .B dn
329 clause.
330 .LP
331 The statement
332 .B set=<pattern>
333 is undocumented yet.
334 .LP
335 The statement
336 .B aci=<attrname>
337 means that the access control is determined by the values in the
338 .B attrname
339 of the entry itself.
340 ACIs are experimental; they must be enabled at compile time.
341 .LP
342 The statements
343 .BR ssf=<n> ,
344 .BR transport_ssf=<n> ,
345 .BR tls_ssf=<n> ,
346 and
347 .BR sasl_ssf=<n>
348 set the required Security Strength Factor (ssf) required to grant access.
349 .SH THE <ACCESS> FIELD
350 The field
351 .B <access> ::= [self]{<level>|<priv>}
352 determines the access level or the specific access privileges the
353 .B who 
354 field will have.
355 Its component are defined as
356 .LP
357 .nf
358         <level> ::= none|auth|compare|search|read|write
359         <priv> ::= {=|+|-}{w|r|s|c|x}+
360 .fi
361 .LP
362 The modifier
363 .B self
364 allows special operations like having a certain access level or privilege
365 only in case the operation involves the name of the user that's requesting
366 the access.
367 It implies the user that requests access is bound.
368 An example is the
369 .B selfwrite
370 access to the member attribute of a group, which allows one to add/delete
371 its own DN from the member list of a group, without affecting other members.
372 .LP
373 The 
374 .B level 
375 access model relies on an incremental interpretation of the access
376 privileges.
377 The possible levels are
378 .BR none ,
379 .BR auth ,
380 .BR compare ,
381 .BR search ,
382 .BR read ,
383 and
384 .BR write .
385 Each access level implies all the preceding ones, thus 
386 .B write
387 access will imply all accesses.
388 While
389 .B none
390 is trivial, 
391 .B auth
392 access means that one is allowed access to an attribute to perform
393 authentication/authorization operations (e.g.
394 .BR bind )
395 with no other access.
396 This is useful to grant unauthenticated clients the least possible 
397 access level to critical resources, like passwords.
398 .LP
399 The
400 .B priv
401 access model relies on the explicit setting of access privileges
402 for each clause.
403 The
404 .B =
405 sign resets previously defined accesses; as a consequence, the final 
406 access privileges will be only those defined by the clause.
407 The 
408 .B +
409 and
410 .B -
411 signs add/remove access privileges to the existing ones.
412 The privileges are
413 .B w
414 for write,
415 .B r
416 for read,
417 .B s 
418 for search,
419 .B c 
420 for compare, and
421 .B x
422 for authentication.
423 More than one privilege can be added in one statement.
424 .LP
425 The optional field
426 .B <control>
427 controls the flow of access rule application.
428 It can have the forms
429 .LP
430 .nf
431         stop
432         continue
433         break
434 .fi
435 .LP
436 where
437 .BR stop ,
438 the default, means access checking stops in case of match.
439 The other two forms are used to keep on processing access clauses.
440 In detail, the
441 .B continue
442 form allows for other 
443 .B <who>
444 clauses in the same 
445 .B <access>
446 clause to be considered, so that they may result in incrementally altering
447 the privileges, while the
448 .B break
449 form allows for other
450 .B <access>
451 clauses that match the same target to be processed.
452 Consider the (silly) example
453 .LP
454 .nf
455         access to dn.subtree="dc=example,dc=com" attrs=cn
456                 by * =cs break
457
458         access to dn.subtree="ou=People,dc=example,dc=com"
459                 by * +r
460 .fi
461 .LP
462 which allows search and compare privileges to everybody under
463 the "dc=example,dc=com" tree, with the second rule allowing
464 also read in the "ou=People" subtree,
465 or the (even more silly) example
466 .LP
467 .nf
468         access to dn.subtree="dc=example,dc=com" attrs=cn
469                 by * =cs continue
470                 by users +r
471 .fi
472 .LP
473 which grants everybody search and compare privileges, and adds read
474 privileges to authenticated clients.
475 .SH OPERATION REQUIREMENTS
476 Operations require different privileges on different portions of entries.
477 The following summary applies to primary database backends such as
478 the LDBM, BDB, and HDB backends.   Requirements for other backends may
479 (and often do) differ.
480 .LP
481 The
482 .B add
483 operation requires
484 .B write (=w)
485 privileges on the pseudo-attribute 
486 .B entry
487 of the entry being added, and 
488 .B write (=w)
489 privileges on the pseudo-attribute
490 .B children
491 of the entry's parent.
492 .LP
493 The 
494 .B bind
495 operation, when credentials are stored in the directory, requires 
496 .B auth (=x)
497 privileges on the attribute the credentials are stored in (usually
498 .BR userPassword ).
499 .LP
500 The
501 .B compare
502 operation requires 
503 .B compare (=c)
504 privileges on the attribute that is being compared.
505 .LP
506 The
507 .B delete
508 operation requires
509 .B write (=w)
510 privileges on the pseudo-attribute
511 .B entry 
512 of the entry being deleted, and
513 .B write (=w)
514 privileges on the
515 .B children
516 pseudo-attribute of the entry's parent.
517 .LP
518 The
519 .B modify
520 operation requires 
521 .B write (=w)
522 privileges on the attibutes being modified.
523 .LP
524 The
525 .B modrdn
526 operation requires
527 .B write (=w)
528 privileges on the pseudo-attribute
529 .B entry
530 of the entry whose relative DN is being modified,
531 .B write (=w)
532 privileges on the pseudo-attribute
533 .B children
534 of the old and new entry's parents, and
535 .B write (=w)
536 privileges on the attributes that are present in the new relative DN.
537 .B Write (=w)
538 privileges are also required on the attributes that are present 
539 in the old relative DN if 
540 .B deleteoldrdn
541 is set to 1.
542 .LP
543 The
544 .B search
545 operation, for each entry, requires
546 .B search (=s)
547 privileges on the attributes that are defined in the filter.
548 Then, the resulting entries are tested for 
549 .B read (=r)
550 privileges on the pseudo-attribute
551 .B entry
552 (for read access to the entry itself)
553 and for
554 .B read (=r)
555 access on each value of each attribute that is requested.
556 Also, for each
557 .B referral
558 object used in generating continuation references, the operation requires
559 .B read (=r)
560 access on the pseudo-attribute
561 .B entry
562 (for read access to the referral object itself),
563 as well as
564 .B read (=r)
565 access to the attribute holding the referral information
566 (generally the
567 .B ref
568 attribute).
569 .SH CAVEATS
570 It is strongly recommended to explicitly use the most appropriate
571 DN 
572 .BR style ,
573 to avoid possible incorrect specifications of the access rules as well
574 as for performance (avoid unrequired regex matching when an exact
575 match suffices) reasons.
576 .LP
577 An adminisistrator might create a rule of the form:
578 .LP
579 .nf
580         access to dn.regex="dc=example,dc=com"
581                 by ...
582 .fi
583 .LP
584 expecting it to match all entries in the subtree "dc=example,dc=com".
585 However, this rule actually matches any DN which contains anywhere
586 the substring "dc=example,dc=com".  That is, the rule matches both
587 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
588 .LP
589 To match the desired subtree, the rule would be more precisely
590 written:
591 .LP
592 .nf
593         access to dn.regex="^(.+,)?dc=example,dc=com$$"
594                 by ...
595 .fi
596 .LP
597 For performance reasons, it would be better to use the subtree style.
598 .LP
599 .nf
600         access to dn.subtree="dc=example,dc=com"
601                 by ...
602 .fi
603 .LP
604 .SH FILES
605 .TP
606 ETCDIR/slapd.conf
607 default slapd configuration file
608 .SH SEE ALSO
609 .BR slapd (8),
610 .LP
611 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
612 .SH ACKNOWLEDGEMENTS
613 .B OpenLDAP
614 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
615 .B OpenLDAP
616 is derived from University of Michigan LDAP 3.3 Release.