7.3. Configuring the audit Service
The Audit daemon can be configured in the
/etc/audit/auditd.conf
file. This file consists of configuration parameters that modify the behavior of the Audit daemon. Empty lines and text following a hash sign (#
) are ignored. For further details, see the auditd.conf(5) man page.
7.3.1. Configuring auditd
for a Secure Environment
The default
auditd
configuration should be suitable for most environments. However, if your environment must meet strict security policies, the following settings are suggested for the Audit daemon configuration in the /etc/audit/auditd.conf
file:
- log_file
- The directory that holds the Audit log files (usually
/var/log/audit/
) should reside on a separate mount point. This prevents other processes from consuming space in this directory and provides accurate detection of the remaining space for the Audit daemon. - max_log_file
- Specifies the maximum size of a single Audit log file, which must be set to make full use of the available space on the partition that holds the Audit log files.The
max_log_file
parameter specifies the maximum file size in megabytes. The value given must be numeric. - max_log_file_action
- Decides what action is taken once the limit set in
max_log_file
is reached, should be set tokeep_logs
to prevent Audit log files from being overwritten. - space_left
- Specifies the amount of free space left on the disk for which an action that is set in the
space_left_action
parameter is triggered. Must be set to a number that gives the administrator enough time to respond and free up disk space. Thespace_left
value depends on the rate at which the Audit log files are generated.If the value ofspace_left
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 (for example, 5%), the audit daemon calculates the absolute size in megabytes based on the size of the file system containinglog_file
. - space_left_action
- It is recommended to set the
space_left_action
parameter toemail
orexec
with an appropriate notification method. - admin_space_left
- Specifies the absolute minimum amount of free space for which an action that is set in the
admin_space_left_action
parameter is triggered, which must be set to a value that leaves enough space to log actions performed by the administrator.The numeric value for this parameter should be lower than the number forspace_left
. You can also append a percent sign (for example, 1%) to the number to have the audit daemon calculate the number based on the disk partition size. - admin_space_left_action
- Should be set to
single
to put the system into single-user mode and allow the administrator to free up some disk space. - disk_full_action
- Specifies an action that is triggered when no free space is available on the partition that holds the Audit log files, must be set to
halt
orsingle
. This ensures that the system is either shut down or operating in single-user mode when Audit can no longer log events. - disk_error_action
- Specifies an action that is triggered in case an error is detected on the partition that holds the Audit log files, must be set to
syslog
,single
, orhalt
, depending on your local security policies regarding the handling of hardware malfunctions. - flush
- Should be set to
incremental_async
. It works in combination with thefreq
parameter, which determines how many records can be sent to the disk before forcing a hard synchronization with the hard drive. Thefreq
parameter should be set to100
. These parameters assure that Audit event data is synchronized with the log files on the disk while keeping good performance for bursts of activity.
The remaining configuration options should be set according to your local security policy.