Debian Codegraph @

upstream/debian-trixie/man5/auditd.conf.5

raw
1 .TH AUDITD.CONF "5" "August 2018" "Red Hat" "System Administration Utilities"
2 .SH NAME
3 auditd.conf \- audit daemon configuration file
4 .SH DESCRIPTION
5 The file
6 .I /etc/audit/auditd.conf
7 contains configuration information specific to the audit daemon. Each line should contain one configuration keyword, an equal sign, and then followed by appropriate configuration information. All option names and values are case insensitive. The keywords recognized are listed and described below. Each line should be limited to 160 characters or the line will be skipped. You may add comments to the file by starting the line with a '#' character.
8
9 .TP
10 .I local_events
11 This yes/no keyword specifies whether or not to include local events. Normally
12 you want local events so the default value is yes. Cases where you would set
13 this to no is when you want to aggregate events only from the network. At the
14 moment, this is useful if the audit daemon is running in a container. This
15 option can only be set once at daemon start up. Reloading the config file
16 has no effect.
17 .TP
18 .I log_file
19 This keyword specifies the full path name to the log file where audit records
20 will be stored. It must be a regular file.
21 .TP
22 .I write_logs
23 This yes/no keyword determines whether or not to write logs to the disk.
24 Normally you want this so the default is yes.
25 .TP
26 .I log_format
27 The log format describes how the information should be stored on disk. There are 2 options: raw and enriched. If set to
28 .IR RAW ,
29 the audit records will be stored in a format exactly as the kernel sends it. The
30 .IR ENRICHED
31 option will resolve all uid, gid, syscall, architecture, and socket address information before writing the event to disk. This aids in making sense of events created on one system but reported/analyzed on another system.
32 The
33 .I NOLOG
34 option is now deprecated. If you were setting this format, now you should set
35 the write_logs option to no.
36 .TP
37 .I log_group
38 This keyword specifies the group that is applied to the log file's permissions. The default is root. The group name can be either numeric or spelled out.
39 .TP
40 .I priority_boost
41 This is a non-negative number that tells the audit daemon how much of a priority boost it should take. The default is 4. No change is 0.
42 .TP
43 .I flush
44 Valid values are
45 .IR none ", " incremental ", " incremental_async ", " data ", and " sync ".
46 If set to
47 .IR none ,
48 no special effort is made to flush the audit records to disk. If set to
49 .IR incremental ,
50 Then the
51 .I freq
52 parameter is used to determine how often an explicit flush to disk is issued.
53 The
54 .IR incremental_async
55 parameter is very much like
56 .IR incremental
57 except the flushing is done asynchronously for higher performance. The
58 .I data
59 parameter tells the audit daemon to keep the data portion of the disk file
60 sync'd at all times. The
61 .I sync
62 option tells the audit daemon to keep both the data and meta-data fully
63 sync'd with every write to disk. The default value is incremental_async.
64 .TP
65 .I freq
66 This is a non-negative number that tells the audit daemon how many records to
67 write before issuing an explicit flush to disk command. This value is only
68 valid when the
69 .I flush
70 keyword is set to
71 .IR incremental
72 or incremental_async.
73 .TP
74 .I num_logs
75 This keyword specifies the number of log files to keep if rotate is given
76 as the
77 .I max_log_file_action.
78 If the number is < 2, logs are not rotated. This number must be 999 or less.
79 The default is 0 - which means no rotation. As you increase the number of log files being rotated, you may need to adjust the kernel backlog setting upwards since it takes more time to rotate the files. This is typically done in /etc/audit/audit.rules. If log rotation is configured to occur, the daemon will check for excess logs and remove them in effort to keep disk space available. The excess log check is only done on startup and when a reconfigure results in a space check.
80 .TP
81 .I name_format
82 This option controls how computer node names are inserted into the audit event stream. It has the following choices:
83 .IR none ", " hostname ", " fqd ", " numeric ", and " user ".
84 .IR None
85 means that no computer name is inserted into the audit event.
86 .IR hostname
87 is the name returned by the gethostname syscall. The
88 .IR fqd
89 means that it takes the hostname and resolves it with dns for a fully qualified
90 domain name of that machine.
91 .IR Numeric
92 is similar to fqd except it resolves the IP address of the machine. In order to use this option, you might want to test that 'hostname \-i' or 'domainname \-i' returns a numeric address. Also, this option is not recommended if dhcp is used because you could have different addresses over time for the same machine.
93 .IR User
94 is an admin defined string from the name option. The default value is
95 .IR none ".
96 .TP
97 .I name
98 This is the admin defined string that identifies the machine if
99 .IR user
100 is given as the
101 .IR name_format
102 option.
103 .TP
104 .I max_log_file
105 This keyword specifies the maximum file size in megabytes. When this limit
106 is reached, it will trigger a configurable action. The value given must be numeric.
107 .TP
108 .I max_log_file_action
109 This parameter tells the system what action to take when the system has
110 detected that the max file size limit has been reached. Valid values are
111 .IR ignore ", " syslog ", " suspend ", " rotate " and "keep_logs.
112 If set to
113 .IR ignore ,
114 the audit daemon does nothing.
115 .IR syslog
116 means that it will issue a warning to syslog.
117 .IR suspend
118 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
119 .IR rotate
120 option will cause the audit daemon to rotate the logs. It should be noted that logs with higher numbers are older than logs with lower numbers. This is the same convention used by the logrotate utility. The
121 .IR keep_logs
122 option is similar to rotate except it does not use the num_logs setting. This prevents audit logs from being overwritten. The effect is that logs accumulate and are not deleted \- which will trigger the
123 .I space_left_action
124 if the volume fills up. This is best used in combination with an external script used to archive logs on a periodic basis.
125 .TP
126 .I verify_email
127 This option determines if the email address given in
128 .IR action_mail_acct
129 is checked to see if the domain name can be resolved. This option must be given before
130 .IR action_mail_acct
131 or the default value of yes will be used.
132 .TP
133 .I action_mail_acct
134 This option should contain a valid email address or alias. The default address is root. If the email address is not local to the machine, you must make sure you have email properly configured on your machine and network. Also, this option requires that /usr/lib/sendmail exists on the machine.
135 .TP
136 .I space_left
137 If the free space in the filesystem containing
138 .IR log_file
139 drops below this value, the audit daemon takes the action specified by
140 .IR space_left_action .
141 If the value of
142 .IR space_left
143 is specified as a whole number, it is interpreted as an absolute size in megabytes (MiB). If the value is specified as a number between 1 and 99 followed by a percentage sign (e.g., 5%), the audit daemon calculates the absolute size in megabytes based on the size of the filesystem containing
144 .IR log_file .
145 (E.g., if the filesystem containing
146 .IR log_file
147 is 2 gigabytes in size, and
148 .IR space_left
149 is set to 25%, then the audit daemon sets
150 .IR space_left
151 to approximately 500 megabytes. Note that this calculation is performed when the audit daemon starts, so if you resize the filesystem containing
152 .IR log_file
153 while the audit daemon is running, you should send the audit daemon SIGHUP to re-read the configuration file and recalculate the correct percentage.
154 .TP
155 .I space_left_action
156 This parameter tells the system what action to take when the system has
157 detected that it is starting to get low on disk space.
158 Valid values are
159 .IR ignore ", " syslog ", " rotate ", " email ", " exec ", " suspend ", " single ", and " halt .
160 If set to
161 .IR ignore ,
162 the audit daemon does nothing.
163 .I syslog
164 means that it will issue a warning to syslog.
165 .I rotate
166 will rotate logs, losing the oldest to free up space.
167 .I Email
168 means that it will send a warning to the email account specified in
169 .I action_mail_acct
170 as well as sending the message to syslog.
171 .I exec
172 /path-to-script will execute the script. You cannot pass parameters to the script. The script is also responsible for telling the auditd daemon to resume logging once its completed its action. This can be done by adding service auditd resume to the script.
173 .I suspend
174 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
175 .I single
176 option will cause the audit daemon to put the computer system in single user mode. The
177 .I halt
178 option will cause the audit daemon to shutdown the computer system. Except for rotate, it will perform this action just one time.
179 .TP
180 .I admin_space_left
181 This is a numeric value in megabytes that tells the audit daemon when
182 to perform a configurable action because the system
183 .B is running low
184 on disk space. This should be considered the last chance to do something before running out of disk space. The numeric value for this parameter should be lower than the number for space_left. You may also append a percent sign (e.g. 1%) to the number to have the audit daemon calculate the number based on the disk partition size.
185 .TP
186 .I admin_space_left_action
187 This parameter tells the system what action to take when the system has
188 detected that it
189 .B is low on disk space.
190 Valid values are
191 .IR ignore ", " syslog ", "rotate ", " email ", " exec ", " suspend ", " single ", and " halt .
192 If set to
193 .IR ignore ,
194 the audit daemon does nothing.
195 .I Syslog
196 means that it will issue a warning to syslog.
197 .I rotate
198 will rotate logs, losing the oldest to free up space.
199 .I Email
200 means that it will send a warning to the email account specified in
201 .I action_mail_acct
202 as well as sending the message to syslog.
203 .I exec
204 /path-to-script will execute the script. You cannot pass parameters to the script. The script is also responsible for telling the auditd daemon to resume logging once its completed its action. This can be done by adding service auditd resume to the script.
205 .I Suspend
206 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
207 .I single
208 option will cause the audit daemon to put the computer system in single user mode. The
209 .I halt
210 option will cause the audit daemon to shutdown the computer system. Except for rotate, it will perform this action just one time.
211 .TP
212 .I disk_full_action
213 This parameter tells the system what action to take when the system has
214 detected that the partition to which log files are written has become full. Valid values are
215 .IR ignore ", " syslog ", " rotate ", " exec ", " suspend ", " single ", and " halt .
216 If set to
217 .IR ignore ,
218 the audit daemon will issue a syslog message but no other action is taken.
219 .I Syslog
220 means that it will issue a warning to syslog.
221 .I rotate
222 will rotate logs, losing the oldest to free up space.
223 .I exec
224 /path-to-script will execute the script. You cannot pass parameters to the script. The script is also responsible for telling the auditd daemon to resume logging
225 g once its completed its action. This can be done by adding service auditd resume to the script.
226 .I Suspend
227 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
228 .I single
229 option will cause the audit daemon to put the computer system in single user mode.
230 .I halt
231 option will cause the audit daemon to shutdown the computer system.
232 .TP
233 .I disk_error_action
234 This parameter tells the system what action to take whenever there is an error
235 detected when writing audit events to disk or rotating logs. Valid values are
236 .IR ignore ", " syslog ", " exec ", " suspend ", " single ", and " halt .
237 If set to
238 .IR ignore ,
239 the audit daemon will not take any action.
240 .I Syslog
241 means that it will issue no more than 5 consecutive warnings to syslog.
242 .I exec
243 /path-to-script will execute the script. You cannot pass parameters to the script.
244 .I Suspend
245 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
246 .I single
247 option will cause the audit daemon to put the computer system in single user mode.
248 .I halt
249 option will cause the audit daemon to shutdown the computer system.
250 .TP
251 .I tcp_listen_port
252 This is a numeric value in the range 1..65535 which, if specified,
253 causes auditd to listen on the corresponding TCP port for audit
254 records from remote systems. The audit daemon may be linked with
255 tcp_wrappers. You may want to control access with an entry in the
256 hosts.allow and deny files. If this is deployed on a systemd based
257 OS, then you may need to adjust the 'After' directive. See the note in
258 the auditd.service file.
259 .TP
260 .I tcp_listen_queue
261 This is a numeric value which indicates how many pending (requested
262 but unaccepted) connections are allowed. The default is 5. Setting
263 this too small may cause connections to be rejected if too many hosts
264 start up at exactly the same time, such as after a power failure. This
265 setting is only used for aggregating servers. Clients logging to a remote
266 server should keep this commented out.
267 .TP
268 .I tcp_max_per_addr
269 This is a numeric value which indicates how many concurrent connections from
270 one IP address is allowed. The default is 1 and the maximum is 1024. Setting
271 this too large may allow for a Denial of Service attack on the logging
272 server. Also note that the kernel has an internal maximum that will eventually
273 prevent this even if auditd allows it by config. The default should be adequate
274 in most cases unless a custom written recovery script runs to forward unsent
275 events. In this case you would increase the number only large enough to let it
276 in too.
277 .TP
278 .I use_libwrap
279 This setting determines whether or not to use tcp_wrappers to discern connection attempts that are from allowed machines. Legal values are either
280 .IR yes ", or " no "
281 The default value is yes.
282 .TP
283 .I tcp_client_ports
284 This parameter may be a single numeric value or two values separated
285 by a dash (no spaces allowed). It indicates which client ports are
286 allowed for incoming connections. If not specified, any port is
287 allowed. Allowed values are 1..65535. For example, to require the
288 client use a privileged port, specify
289 .I 1\-1023
290 for this parameter. You will also need to set the local_port option in the audisp-remote.conf file. Making sure that clients send from a privileged port is a security feature to prevent log injection attacks by untrusted users.
291 .TP
292 .I tcp_client_max_idle
293 This parameter indicates the number of seconds that a client may be idle (i.e. no data from them at all) before auditd complains. This is used to close inactive connections if the client machine has a problem where it cannot shutdown the connection cleanly. Note that this is a global setting, and must be higher than any individual client heartbeat_timeout setting, preferably by a factor of two. The default is zero, which disables this check.
294 .TP
295 .I transport
296 If set to
297 .IR TCP ",
298 only clear text tcp connections will be used. If set to
299 .IR KRB5 ",
300 then Kerberos 5 will be used for authentication and encryption. The default value is TCP.
301 .TP
302 .I enable_krb5
303 This option is deprecated. Use the
304 .IR transport
305 option above instead. If set to "yes", Kerberos 5 will be used for
306 authentication and encryption. The default is "no". If this option is set
307 to "yes" and it follows the transport option, it will override the transport
308 setting. This would be the normal expected behavior for backwards compatibility.
309 .TP
310 .I krb5_principal
311 This is the principal for this server. The default is "auditd".
312 Given this default, the server will look for a key named like
313 .I auditd/[email protected]
314 stored in
315 .I /etc/audit/audit.key
316 to authenticate itself, where hostname is the canonical name for the
317 server's host, as returned by a DNS lookup of its IP address.
318 .TP
319 .I krb5_key_file
320 Location of the key for this client's principal.
321 Note that the key file must be owned by root and mode 0400.
322 The default is
323 .I /etc/audit/audit.key
324 .TP
325 .I distribute_network
326 If set to "yes", network originating events will be distributed to the audit
327 dispatcher for processing. The default is "no".
328 .TP
329 .I q_depth
330 This is a numeric value that tells how big to make the internal queue of the audit event dispatcher. A bigger queue lets it handle a flood of events better, but could hold events that are not processed when the daemon is terminated. If you get messages in syslog about events getting dropped, increase this value. The default value is 2000.
331 .TP
332 .I overflow_action
333 This option determines how the daemon should react to overflowing its internal queue. When this happens, it means that more events are being received than it can pass along to child processes. This error means that it is going to lose the current event that it's trying to dispatch. This option has the following choices:
334 .IR ignore ", " syslog ", " suspend ", " single ", and " halt ".
335 If set to
336 .IR ignore ,
337 the audit daemon does nothing.
338 .I syslog
339 means that it will issue a warning to syslog.
340 .I suspend
341 will cause the audit daemon to stop sending events to child processes. The daemon will still be alive. The
342 .I single
343 option will cause the audit daemon to put the computer system in single user mode.
344 .I halt
345 option will cause the audit daemon to shutdown the computer system.
346 .TP
347 .I max_restarts
348 This is a non-negative number that tells the audit event dispatcher how many times it can try to restart a crashed plugin. The default is 10.
349 .TP
350 .I plugin_dir
351 This is the location that auditd will use to search for its plugin configuration files.
352 .TP
353 .I end_of_event_timeout
354 This is a non-negative number of seconds used by the userspace
355 .I auparse()
356 library routines and the
357 .I aureport(8)
358 ,
359 .I ausearch(8)
360 utilities to consider an event is complete when parsing an event log stream. For an event stream being processed, if the time of the current event is over
361 .I end_of_event_timeout
362 seconds old, compared to co-located events, then the event is considered complete. See the NOTES section for more detail.
363 .SH NOTES
364 In a CAPP environment, the audit trail is considered so important that access to system resources must be denied if an audit trail cannot be created. In this environment, it would be suggested that /var/log/audit be on its own partition. This is to ensure that space detection is accurate and that no other process comes along and consumes part of it.
365 .PP
366 The flush parameter should be set to sync or data.
367 .PP
368 Max_log_file and num_logs need to be adjusted so that you get complete use of your partition. It should be noted that the more files that have to be rotated, the longer it takes to get back to receiving audit events. Max_log_file_action should be set to keep_logs.
369 .PP
370 Space_left should be set to a number that gives the admin enough time to react to any alert message and perform some maintenance to free up disk space. This would typically involve running the \fBaureport \-t\fP report and moving the oldest logs to an archive area. The value of space_left is site dependent since the rate at which events are generated varies with each deployment. The space_left_action is recommended to be set to email. If you need something like an snmp trap, you can use the exec option to send one.
371 .PP
372 Admin_space_left should be set to the amount of disk space on the audit partition needed for admin actions to be recorded. Admin_space_left_action would be set to single so that use of the machine is restricted to just the console.
373 .PP
374 The disk_full_action is triggered when no more room exists on the partition. All access should be terminated since no more audit capability exists. This can be set to either single or halt.
375 .PP
376 The disk_error_action should be set to syslog, single, or halt depending on your local policies regarding handling of hardware malfunctions.
377 .PP
378 Specifying a single allowed client port may make it difficult for the
379 client to restart their audit subsystem, as it will be unable to
380 recreate a connection with the same host addresses and ports until the
381 connection closure TIME_WAIT state times out.
382
383 .PP
384 Auditd events are made up of one or more records. The auditd system cannot guarantee that the set of records that make up an event will occur atomically, that is the stream will have interleaved records of different events, IE
385 .PP
386 .RS
387 .br
388 event0_record0
389 .br
390 event1_record0
391 .br
392 event2_record0
393 .br
394 event1_record3
395 .br
396 event2_record1
397 .br
398 event1_record4
399 .br
400 event3_record0
401 .br
402 .RE
403 .PP
404 The auditd system does not guarantee that the records that make up an event will appear in order. Thus, when processing event streams, we need to maintain a list of events with their own list of records hence List of List (LOL) event processing.
405
406 When processing an event stream we define the end of an event via
407 .P
408 .RS
409 record type = AUDIT_EOE (audit end of event type record), or
410 .br
411 record type = AUDIT_PROCTITLE (we note the AUDIT_PROCTITLE is always the last record), or
412 .br
413 record type = AUDIT_KERNEL (kernel events are one record events), or
414 .br
415 record type < AUDIT_FIRST_EVENT (only single record events appear before this type), or
416 .br
417 record type >= AUDIT_FIRST_ANOM_MSG (only single record events appear after this type), or
418 .br
419 record type >= AUDIT_MAC_UNLBL_ALLOW && record type <= AUDIT_MAC_CALIPSO_DEL (these are also one record events), or
420 .br
421 for the stream being processed, the time of the event is over end_of_event_timeout seconds old.
422 .RE
423
424 .SH FILES
425 .TP
426 .I /etc/audit/auditd.conf
427 Audit daemon configuration file
428
429 .SH "SEE ALSO"
430 .BR auditd (8),
431 .BR audisp\-remote.conf (5),
432 .BR auditd\-plugins (5).
433
434 .SH AUTHOR
435 Steve Grubb