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