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 Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
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_fileparameter 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_fileis reached, should be set tokeep_logsto 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_actionparameter is triggered. Must be set to a number that gives the administrator enough time to respond and free up disk space. Thespace_leftvalue depends on the rate at which the Audit log files are generated.If the value ofspace_leftis 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_actionparameter toemailorexecwith 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_actionparameter 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
singleto 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
haltorsingle. 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 thefreqparameter, which determines how many records can be sent to the disk before forcing a hard synchronization with the hard drive. Thefreqparameter 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.