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