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