]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapo-accesslog.5
Normalize NAME sections: 1 line, no formatting, mention LDAP/OpenLDAP/slapd
[openldap] / doc / man / man5 / slapo-accesslog.5
1 .TH SLAPO-ACCESSLOG 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 2005-2007 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapo-accesslog \- Access Logging overlay to slapd
7 .SH SYNOPSIS
8 ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The Access Logging overlay can be used to record all accesses to a given
11 backend database on another database. This allows all of the activity on
12 a given database to be reviewed using arbitrary LDAP queries, instead of
13 just logging to local flat text files. Configuration options are available
14 for selecting a subset of operation types to log, and to automatically
15 prune older log records from the logging database.  Log records are stored
16 with audit schema (see below) to assure their readability whether viewed
17 as LDIF or in raw form.
18 .SH CONFIGURATION
19 These
20 .B slapd.conf
21 options apply to the Access Logging overlay.
22 They should appear after the
23 .B overlay
24 directive.
25 .TP
26 .B logdb <suffix>
27 Specify the suffix of a database to be used for storing the log records.
28 The specified database must be defined elsewhere in the configuration.
29 The access controls
30 on the log database should prevent general access. The suffix entry
31 of the log database will be created automatically by this overlay. The log
32 entries will be generated as the immediate children of the suffix entry.
33 .TP
34 .B logops <operations>
35 Specify which types of operations to log. The valid operation types are
36 abandon, add, bind, compare, delete, extended, modify, modrdn, search,
37 and unbind. Aliases for common sets of operations are also available:
38 .RS
39 .TP
40 .B writes
41 add, delete, modify, modrdn
42 .TP
43 .B reads
44 compare, search
45 .TP
46 .B session
47 abandon, bind, unbind
48 .TP
49 .B all
50 all operations
51 .RE
52 .TP
53 .B logold <filter>
54 Specify a filter for matching against Deleted and Modified entries. If
55 the entry matches the filter, the old contents of the entry will be
56 logged along with the current request.
57 .TP
58 .B logoldattr <attr> ...
59 Specify a list of attributes whose old contents are always logged in
60 Modify and ModRDN requests. Usually only the contents of attributes that were
61 actually modified will be logged; by default no old attributes are logged
62 for ModRDN requests.
63 .TP
64 .B logpurge <age> <interval>
65 Specify the maximum age for log entries to be retained in the database,
66 and how often to scan the database for old entries. Both the
67 .B age
68 and
69 .B interval
70 are specified as a time span in days, hours, minutes, and seconds. The
71 time format is [ddd+]hh:mm[:ss] i.e., the days and seconds components are
72 optional but hours and minutes are required. Except for days, which can
73 be up to 5 digits, each numeric field must be exactly two digits. For example
74 .RS
75 .RS
76 .PD 0
77 .TP
78 logpurge 2+00:00 1+00:00
79 .RE
80 .PD
81 would specify that the log database should be scanned every day for old
82 entries, and entries older than two days should be deleted. When using a
83 log database that supports ordered indexing on generalizedTime attributes,
84 specifying an eq index on the
85 .B reqStart
86 attribute will greatly benefit the performance of the purge operation.
87 .RE
88 .TP
89 .B logsuccess TRUE | FALSE
90 If set to TRUE then log records will only be generated for successful
91 requests, i.e., requests that produce a result code of 0 (LDAP_SUCCESS).
92 If FALSE, log records are generated for all requests whether they
93 succeed or not. The default is FALSE.
94
95 .SH EXAMPLES
96 .LP
97 .nf
98         database bdb
99         suffix dc=example,dc=com
100         \...
101         overlay accesslog
102         logdb cn=log
103         logops writes reads
104         logold (objectclass=person)
105
106         database bdb
107         suffix cn=log
108         \...
109         index reqStart eq
110         access to *
111           by dn.base="cn=admin,dc=example,dc=com" read
112 .fi
113
114 .SH SCHEMA
115 The
116 .B accesslog
117 overlay utilizes the "audit" schema described herein.
118 This schema is specifically designed for
119 .B accesslog
120 auditing and is not intended to be used otherwise.  It is also
121 noted that the schema described here is
122 .I a work in
123 .IR progress ,
124 and hence subject to change without notice.
125 The schema is loaded automatically by the overlay.
126
127 The schema includes a number of object classes and associated
128 attribute types as described below.
129
130 There is
131 a basic
132 .B auditObject
133 class from which two additional classes,
134 .B auditReadObject
135 and
136 .B auditWriteObject
137 are derived. Object classes for each type of LDAP operation are further
138 derived from these classes. This object class hierarchy is designed to
139 allow flexible yet efficient searches of the log based on either a specific
140 operation type's class, or on more general classifications. The definition
141 of the
142 .B auditObject
143 class is as follows:
144 .LP
145 .RS 4
146 (  1.3.6.1.4.1.4203.666.11.5.2.1
147     NAME 'auditObject'
148     DESC 'OpenLDAP request auditing'
149     SUP top STRUCTURAL
150     MUST ( reqStart $ reqType $ reqSession )
151     MAY ( reqDN $ reqAuthzID $ reqControls $ reqRespControls $
152         reqEnd $ reqResult $ reqMessage $ reqReferral ) )
153 .RE
154 .P
155 Note that all of the OIDs used in the logging schema currently reside
156 under the OpenLDAP Experimental branch. It is anticipated that they
157 will migrate to a Standard branch in the future.
158
159 An overview of the attributes follows:
160 .B reqStart
161 and
162 .B reqEnd
163 provide the start and end time of the operation, respectively. They use
164 generalizedTime syntax. The
165 .B reqStart
166 attribute is also used as the RDN for each log entry.
167
168 The
169 .B reqType
170 attribute is a simple string containing the type of operation
171 being logged, e.g.
172 .BR add ,
173 .BR delete ,
174 .BR search ,
175 etc. For extended operations, the type also includes the OID of the
176 extended operation, e.g.
177 .B extended(1.1.1.1)
178
179 The
180 .B reqSession
181 attribute is an implementation-specific identifier that is common to
182 all the operations associated with the same LDAP session. Currently this
183 is slapd's internal connection ID, stored in decimal.
184
185 The
186 .B reqDN
187 attribute is the distinguishedName of the target of the operation. E.g., for
188 a Bind request, this is the Bind DN. For an Add request, this is the DN
189 of the entry being added. For a Search request, this is the base DN of
190 the search.
191
192 The
193 .B reqAuthzID
194 attribute is the distinguishedName of the user that performed the operation.
195 This will usually be the same name as was established at the start of a
196 session by a Bind request (if any) but may be altered in various
197 circumstances.
198
199 The
200 .B reqControls
201 and
202 .B reqRespControls
203 attributes carry any controls sent by the client on the request and returned
204 by the server in the response, respectively. The attribute values are just
205 uninterpreted octet strings.
206
207 The
208 .B reqResult
209 attribute is the numeric LDAP result code of the operation, indicating
210 either success or a particular LDAP error code. An error code may be
211 accompanied by a text error message which will be recorded in the
212 .B reqMessage
213 attribute.
214
215 The
216 .B reqReferral
217 attribute carries any referrals that were returned with the result of the
218 request.
219
220 Operation-specific classes are defined with additional attributes to carry
221 all of the relevant parameters associated with the operation:
222
223 .LP
224 .RS 4
225 (  1.3.6.1.4.1.4203.666.11.5.2.4
226     NAME 'auditAbandon'
227     DESC 'Abandon operation'
228     SUP auditObject STRUCTURAL
229     MUST reqId )
230 .RE
231 .P
232 For the
233 .B Abandon
234 operation the
235 .B reqId
236 attribute contains the message ID of the request that was abandoned.
237
238 .LP
239 .RS 4
240 (  1.3.6.1.4.1.4203.666.11.5.2.5
241     NAME 'auditAdd'
242     DESC 'Add operation'
243     SUP auditWriteObject STRUCTURAL
244     MUST reqMod )
245 .RE
246 .P
247 The
248 .B Add
249 class inherits from the
250 .B auditWriteObject
251 class. The Add and Modify classes are very similar. The
252 .B reqMod
253 attribute carries all of the attributes of the original entry being added.
254 (Or in the case of a Modify operation, all of the modifications being
255 performed.) The values are formatted as
256 .RS
257 .PD 0
258 .TP
259 attribute:<+|-|=|#> [ value]
260 .RE
261 .RE
262 .PD
263 Where '+' indicates an Add of a value, '-' for Delete, '=' for Replace,
264 and '#' for Increment. In an Add operation, all of the reqMod values will
265 have the '+' designator.
266 .P
267 .LP
268 .RS 4
269 (  1.3.6.1.4.1.4203.666.11.5.2.6
270     NAME 'auditBind'
271     DESC 'Bind operation'
272     SUP auditObject STRUCTURAL
273     MUST ( reqVersion $ reqMethod ) )
274 .RE
275 .P
276 The
277 .B Bind
278 class includes the
279 .B reqVersion
280 attribute which contains the LDAP protocol version specified in the Bind
281 as well as the
282 .B reqMethod
283 attribute which contains the Bind Method used in the Bind. This will be
284 the string
285 .B SIMPLE
286 for LDAP Simple Binds or
287 .B SASL(<mech>)
288 for SASL Binds.
289 Note that unless configured as a global overlay, only Simple Binds using
290 DNs that reside in the current database will be logged.
291
292 .LP
293 .RS 4
294 (  1.3.6.1.4.1.4203.666.11.5.2.7
295     NAME 'auditCompare'
296     DESC 'Compare operation'
297     SUP auditObject STRUCTURAL
298     MUST reqAssertion )
299 .RE
300 .P
301 For the
302 .B Compare
303 operation the
304 .B reqAssertion
305 attribute carries the Attribute Value Assertion used in the compare request.
306
307 .LP
308 .RS 4
309 (  1.3.6.1.4.1.4203.666.11.5.2.8
310     NAME 'auditDelete'
311     DESC 'Delete operation'
312     SUP auditWriteObject STRUCTURAL
313     MAY reqOld )
314 .RE
315 .P
316 The
317 .B Delete
318 operation needs no further parameters. However, the
319 .B reqOld
320 attribute may optionally be used to record the contents of the entry prior
321 to its deletion. The values are formatted as
322 .RS
323 .PD 0
324 .TP
325 attribute: value
326 .RE
327 .PD
328 The
329 .B reqOld
330 attribute is only populated if the entry being deleted matches the
331 configured
332 .B logold
333 filter.
334
335 .LP
336 .RS 4
337 (  1.3.6.1.4.1.4203.666.11.5.2.9
338     NAME 'auditModify'
339     DESC 'Modify operation'
340     SUP auditWriteObject STRUCTURAL
341     MAY reqOld MUST reqMod )
342 .RE
343 .P
344 The
345 .B Modify
346 operation contains a description of modifications in the
347 .B reqMod
348 attribute, which was already described above in the Add operation. It may
349 optionally contain the previous contents of any modified attributes in the
350 .B reqOld
351 attribute, using the same format as described above for the Delete operation.
352 The
353 .B reqOld
354 attribute is only populated if the entry being modified matches the
355 configured
356 .B logold
357 filter.
358
359 .LP
360 .RS 4
361 (  1.3.6.1.4.1.4203.666.11.5.2.10
362     NAME 'auditModRDN'
363     DESC 'ModRDN operation'
364     SUP auditWriteObject STRUCTURAL
365     MUST ( reqNewRDN $ reqDeleteOldRDN )
366     MAY ( reqNewSuperior $ reqOld ) )
367 .RE
368 .P
369 The
370 .B ModRDN
371 class uses the
372 .B reqNewRDN
373 attribute to carry the new RDN of the request.
374 The
375 .B reqDeleteOldRDN
376 attribute is a Boolean value showing
377 .B TRUE
378 if the old RDN was deleted from the entry, or
379 .B FALSE
380 if the old RDN was preserved.
381 The
382 .B reqNewSuperior
383 attribute carries the DN of the new parent entry if the request specified
384 the new parent.
385 The
386 .B reqOld
387 attribute is only populated if the entry being modified matches the
388 configured
389 .B logold
390 filter and contains attributes in the
391 .B logoldattr
392 list.
393
394 .LP
395 .RS 4
396 (  1.3.6.1.4.1.4203.666.11.5.2.11
397     NAME 'auditSearch'
398     DESC 'Search operation'
399     SUP auditReadObject STRUCTURAL
400     MUST ( reqScope $ reqDerefAliases $ reqAttrsOnly )
401     MAY ( reqFilter $ reqAttr $ reqEntries $ reqSizeLimit $
402           reqTimeLimit ) )
403 .RE
404 .P
405 For the
406 .B Search
407 class the
408 .B reqScope
409 attribute contains the scope of the original search request, using the
410 values specified for the LDAP URL format. I.e.
411 .BR base ,
412 .BR one ,
413 .BR sub ,
414 or
415 .BR subord .
416 The
417 .B reqDerefAliases
418 attribute is one of
419 .BR never ,
420 .BR finding ,
421 .BR searching ,
422 or
423 .BR always ,
424 denoting how aliases will be processed during the search.
425 The
426 .B reqAttrsOnly
427 attribute is a Boolean value showing
428 .B TRUE 
429 if only attribute names were requested, or
430 .B FALSE
431 if attributes and their values were requested.
432 The
433 .B reqFilter
434 attribute carries the filter used in the search request.
435 The
436 .B reqAttr
437 attribute lists the requested attributes if specific attributes were
438 requested.
439 The
440 .B reqEntries
441 attribute is the integer count of how many entries were returned by
442 this search request.
443 The
444 .B reqSizeLimit
445 and
446 .B reqTimeLimit
447 attributes indicate what limits were requested on the search operation.
448
449 .LP
450 .RS 4
451 (  1.3.6.1.4.1.4203.666.11.5.2.12
452     NAME 'auditExtended'
453     DESC 'Extended operation'
454     SUP auditObject STRUCTURAL
455     MAY reqData )
456 .RE
457 .P
458 The
459 .B Extended
460 class represents an LDAP Extended Operation. As noted above, the actual OID of
461 the operation is included in the
462 .B reqType
463 attribute of the parent class. If any optional data was provided with the
464 request, it will be contained in the
465 .B reqData
466 attribute as an uninterpreted octet string.
467
468 .SH NOTES
469 The Access Log implemented by this overlay may be used for a variety of
470 other tasks, e.g. as a ChangeLog for a replication mechanism, as well
471 as for security/audit logging purposes.
472
473 .SH FILES
474 .TP
475 ETCDIR/slapd.conf
476 default slapd configuration file
477 .SH SEE ALSO
478 .BR slapd.conf (5).
479
480 .SH ACKNOWLEDGEMENTS
481 .P
482 This module was written in 2005 by Howard Chu of Symas Corporation.