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