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