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