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