Debian Codegraph @

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

raw
1 .TH AUDITD.CONF "5" "June 2025" "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. The default path is
21 .I /var/log/audit/audit.log
22 if not explicitly set.
23 .TP
24 .I write_logs
25 This yes/no keyword determines whether or not to write logs to the disk.
26 Normally you want this so the default is yes.
27 .TP
28 .I log_format
29 The log format describes how the information should be stored on disk. There are 2 options: raw and enriched. If set to
30 .IR RAW ,
31 the audit records will be stored in a format exactly as the kernel sends it. The
32 .IR ENRICHED
33 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.
34 The
35 .I NOLOG
36 option is now deprecated. If you were setting this format, now you should set
37 the write_logs option to no.
38 .TP
39 .I log_group
40 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.
41 .TP
42 .I priority_boost
43 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.
44 .TP
45 .I flush
46 Valid values are
47 .IR none ", " incremental ", " incremental_async ", " data ", and " sync ".
48 If set to
49 .IR none ,
50 no special effort is made to flush the audit records to disk. If set to
51 .IR incremental ,
52 Then the
53 .I freq
54 parameter is used to determine how often an explicit flush to disk is issued.
55 The
56 .IR incremental_async
57 parameter is very much like
58 .IR incremental
59 except the flushing is done asynchronously for higher performance. The
60 .I data
61 parameter tells the audit daemon to keep the data portion of the disk file
62 sync'd at all times. The
63 .I sync
64 option tells the audit daemon to keep both the data and meta-data fully
65 sync'd with every write to disk. The default value is incremental_async.
66 .TP
67 .I freq
68 This is a non-negative number that tells the audit daemon how many records to
69 write before issuing an explicit flush to disk command. This value is only
70 valid when the
71 .I flush
72 keyword is set to
73 .IR incremental
74 or incremental_async.
75 .TP
76 .I num_logs
77 This keyword specifies the number of log files to keep if rotate is given
78 as the
79 .I max_log_file_action.
80 If the number is < 2, logs are not rotated. This number must be 999 or less.
81 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.
82 .TP
83 .I name_format
84 This option controls how computer node names are inserted into the audit event stream. It has the following choices:
85 .IR none ", " hostname ", " fqd ", " numeric ", and " user ".
86 .IR None
87 means that no computer name is inserted into the audit event.
88 .IR hostname
89 is the name returned by the gethostname syscall. The
90 .IR fqd
91 means that it takes the hostname and resolves it with dns for a fully qualified
92 domain name of that machine.
93 .IR Numeric
94 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.
95 .IR User
96 is an admin defined string from the name option. The default value is
97 .IR none ".
98 .TP
99 .I name
100 This is the admin defined string that identifies the machine if
101 .IR user
102 is given as the
103 .IR name_format
104 option.
105 .TP
106 .I max_log_file
107 This keyword specifies the maximum file size in mebibytes (MiB). When this limit
108 is reached, it will trigger a configurable action. The value given must be numeric.
109 .TP
110 .I max_log_file_action
111 This parameter tells the system what action to take when the system has
112 detected that the max file size limit has been reached. Valid values are
113 .IR ignore ", " syslog ", " exec ", " suspend ", " rotate " and "keep_logs.
114 If set to
115 .IR ignore ,
116 the audit daemon does nothing.
117 .IR syslog
118 means that it will issue a warning to syslog.
119 .IR exec
120 /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
121 .I auditdctl --signal resume
122 to the script. Also note that logging is stpped which this script runs. Whatever it does needs to be real quick because events are backing up in the kernel. The script
123 .B MUST
124 delete or rename /var/log/audit/audit.log or when logging resumes, it will retrigger executing the script.
125 .IR suspend
126 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
127 .IR rotate
128 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
129 .IR keep_logs
130 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
131 .I space_left_action
132 if the volume fills up. This is best used in combination with an external script used to archive logs on a periodic basis.
133 .TP
134 .I verify_email
135 This option determines if the email address given in
136 .IR action_mail_acct
137 is checked to see if the domain name can be resolved. This option must be given before
138 .IR action_mail_acct
139 or the default value of yes will be used.
140 .TP
141 .I action_mail_acct
142 This option should contain a valid email address or alias. Addresses may use RFC
143 5233 style subaddressing with the '+' character. The allowed characters are
144 alphanumerics, '@', '.', '-', '_', and '+'. 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. This this option requires that /usr/lib/sendmail exists on the machine. Many clients provide it as a symlink.
145 .TP
146 .I space_left
147 If the free space in the filesystem containing
148 .IR log_file
149 drops below this value, the audit daemon takes the action specified by
150 .IR space_left_action .
151 If the value of
152 .IR space_left
153 is specified as a whole number, it is interpreted as an absolute size in mebibytes (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 mebibytes based on the size of the filesystem containing
154 .IR log_file .
155 (E.g., if the filesystem containing
156 .IR log_file
157 is 2 gigabytes in size, and
158 .IR space_left
159 is set to 25%, then the audit daemon sets
160 .IR space_left
161 to approximately 500 mebibytes. Note that this calculation is performed when the audit daemon starts, so if you resize the filesystem containing
162 .IR log_file
163 while the audit daemon is running, you should send the audit daemon SIGHUP to re-read the configuration file and recalculate the correct percentage.
164 .TP
165 .I space_left_action
166 This parameter tells the system what action to take when the system has
167 detected that it is starting to get low on disk space.
168 Valid values are
169 .IR ignore ", " syslog ", " rotate ", " email ", " exec ", " suspend ", and " single .
170 If set to
171 .IR ignore ,
172 the audit daemon does nothing.
173 .I syslog
174 means that it will issue a warning to syslog.
175 .I rotate
176 will rotate logs, losing the oldest to free up space.
177 .I Email
178 means that it will send a warning to the email account specified in
179 .I action_mail_acct
180 as well as sending the message to syslog.
181 .I exec
182 /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.
183 .I suspend
184 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
185 .I single
186 option will cause the audit daemon to put the computer system in single user mode. Except for rotate, it will perform this action just one time. The previously available
187 .I halt
188 option, which would cause the audit daemon to shut down the computer system, has been deprecated and should no longer be used. It was determined that halting the system at this stage could lead to unintended consequences and is considered a bad action if selected.
189
190 Disk space notifications follow a three-stage progression. The
191 .I space_left_action
192 is the low water mark and serves as the first warning that disk space is running low. Halting at this stage is not recommended, as it prevents administrators from taking corrective action. The next stage,
193 .I admin_space_left_action,
194 indicates an emergency level where immediate action is required to free up disk space. Administrators should configure critical responses for this level. Finally, the
195 .I disk_full_action
196 occurs when the disk is completely full. At this stage, the system may have already halted, and preemptive measures configured in earlier stages will determine the system’s behavior.
197
198
199
200 .TP
201 .I admin_space_left
202 This is a numeric value in mebibytes (MiB) that tells the audit daemon when
203 to perform a configurable action because the system
204 .B is running low
205 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.
206 .TP
207 .I admin_space_left_action
208 This parameter tells the system what action to take when the system has
209 detected that it
210 .B is low on disk space.
211 Valid values are
212 .IR ignore ", " syslog ", "rotate ", " email ", " exec ", " suspend ", " single ", and " halt .
213 If set to
214 .IR ignore ,
215 the audit daemon does nothing.
216 .I Syslog
217 means that it will issue a warning to syslog.
218 .I rotate
219 will rotate logs, losing the oldest to free up space.
220 .I Email
221 means that it will send a warning to the email account specified in
222 .I action_mail_acct
223 as well as sending the message to syslog.
224 .I exec
225 /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.
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. The
230 .I halt
231 option will cause the audit daemon to shutdown the computer system. Except for rotate, it will perform this action just one time.
232 .TP
233 .I disk_full_action
234 This parameter tells the system what action to take when the system has
235 detected that the partition to which log files are written has become full. Valid values are
236 .IR ignore ", " syslog ", " rotate ", " exec ", " suspend ", " single ", and " halt .
237 If set to
238 .IR ignore ,
239 the audit daemon will issue a syslog message but no other action is taken.
240 .I Syslog
241 means that it will issue a warning to syslog.
242 .I rotate
243 will rotate logs, losing the oldest to free up space.
244 .I exec
245 /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
246 g once its completed its action. This can be done by adding service auditd resume to the script.
247 .I Suspend
248 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
249 .I single
250 option will cause the audit daemon to put the computer system in single user mode.
251 .I halt
252 option will cause the audit daemon to shutdown the computer system.
253 .TP
254 .I disk_error_action
255 This parameter tells the system what action to take whenever there is an error
256 detected when writing audit events to disk or rotating logs. Valid values are
257 .IR ignore ", " syslog ", " exec ", " suspend ", " single ", and " halt .
258 If set to
259 .IR ignore ,
260 the audit daemon will not take any action.
261 .I Syslog
262 means that it will issue no more than 5 consecutive warnings to syslog.
263 .I exec
264 /path-to-script will execute the script. You cannot pass parameters to the script.
265 .I Suspend
266 will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The
267 .I single
268 option will cause the audit daemon to put the computer system in single user mode.
269 .I halt
270 option will cause the audit daemon to shutdown the computer system.
271 .TP
272 .I tcp_listen_port
273 This is a numeric value in the range 1..65535 which, if specified,
274 causes auditd to listen on the corresponding TCP port for audit
275 records from remote systems. The audit daemon may be linked with
276 tcp_wrappers. You may want to control access with an entry in the
277 hosts.allow and deny files. If this is deployed on a systemd based
278 OS, then you may need to adjust the 'After' directive. See the note in
279 the auditd.service file. Networking can be enabled by adding this
280 option and sending auditd a SIGHUP. Changing the port or disabling
281 networking requires restarting the daemon so that clients reconnect.
282 .TP
283 .I tcp_listen_queue
284 This is a numeric value which indicates how many pending (requested
285 but unaccepted) connections are allowed. The default is 5. Setting
286 this too small may cause connections to be rejected if too many hosts
287 start up at exactly the same time, such as after a power failure. This
288 setting is only used for aggregating servers. Clients logging to a remote
289 server should keep this commented out. Changing this value while the
290 daemon is running restarts the listener and drops any current
291 connections.
292 .TP
293 .I tcp_max_per_addr
294 This is a numeric value which indicates how many concurrent connections from
295 one IP address is allowed. The default is 1 and the maximum is 1024. Setting
296 this too large may allow for a Denial of Service attack on the logging
297 server. Also note that the kernel has an internal maximum that will eventually
298 prevent this even if auditd allows it by config. The default should be adequate
299 in most cases unless a custom written recovery script runs to forward unsent
300 events. In this case you would increase the number only large enough to let it
301 in too.
302 .TP
303 .I use_libwrap
304 This setting determines whether or not to use tcp_wrappers to discern connection attempts that are from allowed machines. Legal values are either
305 .IR yes ", or " no "
306 The default value is yes.
307 .TP
308 .I tcp_client_ports
309 This parameter may be a single numeric value or two values separated
310 by a dash (no spaces allowed). It indicates which client ports are
311 allowed for incoming connections. If not specified, any port is
312 allowed. Allowed values are 1..65535. For example, to require the
313 client use a privileged port, specify
314 .I 1\-1023
315 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.
316 .TP
317 .I tcp_client_max_idle
318 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.
319 .TP
320 .I transport
321 If set to
322 .IR TCP ",
323 only clear text tcp connections will be used. If set to
324 .IR KRB5 ",
325 then Kerberos 5 will be used for authentication and encryption. The
326 default value is TCP. Changes to this option take effect only after
327 restart so that clients can reconnect.
328 .TP
329 .I enable_krb5
330 This option is deprecated. Use the
331 .IR transport
332 option above instead. If set to "yes", Kerberos 5 will be used for
333 authentication and encryption. The default is "no". If this option is set
334 to "yes" and it follows the transport option, it will override the transport
335 setting. This would be the normal expected behavior for backwards compatibility.
336 .TP
337 .I krb5_principal
338 This is the principal for this server. The default is "auditd".
339 Given this default, the server will look for a key named like
340 .I auditd/[email protected]
341 stored in
342 .I /etc/audit/audit.key
343 to authenticate itself, where hostname is the canonical name for the
344 server's host, as returned by a DNS lookup of its IP address.
345 .TP
346 .I krb5_key_file
347 Location of the key for this client's principal.
348 Note that the key file must be owned by root and mode 0400.
349 The default is
350 .I /etc/audit/audit.key
351 .TP
352 .I distribute_network
353 If set to "yes", network originating events will be distributed to the audit
354 dispatcher for processing. The default is "no".
355 .TP
356 .I q_depth
357 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.
358 .TP
359 .I overflow_action
360 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:
361 .IR ignore ", " syslog ", " suspend ", " single ", and " halt ".
362 If set to
363 .IR ignore ,
364 the audit daemon does nothing.
365 .I syslog
366 means that it will issue a warning to syslog.
367 .I suspend
368 will cause the audit daemon to stop sending events to child processes. The daemon will still be alive. The
369 .I single
370 option will cause the audit daemon to put the computer system in single user mode.
371 .I halt
372 option will cause the audit daemon to shutdown the computer system.
373 .TP
374 .I max_restarts
375 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.
376 .TP
377 .I plugin_dir
378 This is the location that auditd will use to search for its plugin configuration files. The default directory is
379 .I /etc/audit/plugins.d
380 .
381 .TP
382 .I end_of_event_timeout
383 This is a non-negative number of seconds used by the userspace
384 .I auparse()
385 library routines and the
386 .I aureport(8)
387 ,
388 .I ausearch(8)
389 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
390 .I end_of_event_timeout
391 seconds old, compared to co-located events, then the event is considered complete. The default is 2 seconds. See the NOTES section for more detail.
392 .TP
393 .I report_interval
394 This option specifies the interval between automatic state reports. The
395 value is a time string composed of a number optionally followed by
396 .B m
397 for minutes,
398 .B h
399 for hours,
400 .B d
401 for days, or
402 .B M
403 for months.
404 The default is 0 which disables preriodic reporting. The largest value is 40 days. When set, auditd will periodically generate the state report written to
405 .I /run/audit/auditd.state.
406 .SH RELOADING
407 Most parameters can be changed while the daemon is running by sending
408 .B SIGHUP
409 to
410 .BR auditd .
411 This can also be done with
412 .BR auditctl\ \-\-signal\ reload .
413 Options that are only read at startup include
414 .I local_events
415 and
416 .I verify_email
417 .
418 .SH NOTES
419 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.
420 .PP
421 The flush parameter should be set to sync or data.
422 .PP
423 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.
424 .PP
425 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.
426 .PP
427 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.
428 .PP
429 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.
430 .PP
431 The disk_error_action should be set to syslog, single, or halt depending on your local policies regarding handling of hardware malfunctions.
432 .PP
433 Specifying a single allowed client port may make it difficult for the
434 client to restart their audit subsystem, as it will be unable to
435 recreate a connection with the same host addresses and ports until the
436 connection closure TIME_WAIT state times out.
437
438 .PP
439 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
440 .PP
441 .RS
442 .br
443 event0_record0
444 .br
445 event1_record0
446 .br
447 event2_record0
448 .br
449 event1_record3
450 .br
451 event2_record1
452 .br
453 event1_record4
454 .br
455 event3_record0
456 .br
457 .RE
458 .PP
459 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.
460
461 When processing an event stream we define the end of an event via
462 .P
463 .RS
464 record type = AUDIT_EOE (audit end of event type record), or
465 .br
466 record type = AUDIT_PROCTITLE (we note the AUDIT_PROCTITLE is always the last record), or
467 .br
468 record type = AUDIT_KERNEL (kernel events are one record events), or
469 .br
470 record type < AUDIT_FIRST_EVENT (only single record events appear before this type), or
471 .br
472 record type >= AUDIT_FIRST_ANOM_MSG (only single record events appear after this type), or
473 .br
474 record type >= AUDIT_MAC_UNLBL_ALLOW && record type <= AUDIT_MAC_CALIPSO_DEL (these are also one record events), or
475 .br
476 for the stream being processed, the time of the event is over end_of_event_timeout seconds old.
477 .RE
478
479 .SH LOG ROTATION POLICY
480
481 By default, auditd uses size-based log rotation. If you prefer time-based rotation (e.g., hourly, daily, weekly, or custom schedule), refer to auditd.cron(5) for configuration details.
482
483 .SH FILES
484 .TP
485 .I /etc/audit/auditd.conf
486 Audit daemon configuration file
487
488 .SH "SEE ALSO"
489 .BR auditd (8),
490 .BR audisp\-remote.conf (5),
491 .BR auditd\-plugins (5),
492 .BR auditd.cron (5).
493
494 .SH AUTHOR
495 Steve Grubb