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