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