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