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