Files Used in the Auditing Service
The auditing service uses the following files:
The /etc/system file contains commands that the kernel reads during initialization to customize the system operations. The bsmconv and bsmunconv shell scripts, which are used to activate and deactivate auditing, modify the /etc/system file. The bsmconv shell script adds the following line to the /etc/system file:
The set c2audit:audit_load=1 entry causes the kernel module for auditing to be loaded when the system is booted. The bsmunconv shell script disables auditing when the system is rebooted. The command removes the c2audit line from the /etc/system file.
The /etc/syslog.conf file works with the audit_control file to store audit records in text format. The syslog.conf file can be configured to enable the syslog utility to store audit records. For an example, see How to Configure syslog Audit Logs.
The /etc/security/audit_class file defines the audit classes. Audit classes are groups of audit events. You use the class name in the audit_control file to preselect the classes whose events you want to audit. The classes accept prefixes to select only failed events or only successful events. For more information, see Audit Class Syntax.
The superuser, or an administrator in an equivalent role, can modify the definitions of audit classes. This administrator can define new audit classes, rename existing classes, or otherwise change existing classes by editing the audit_class file in a text editor. For more information, see the audit_class(4) man page.
The /etc/security/audit_control file on each system contains configuration information for the auditd daemon. The file enables every system to mount a remote audit file system to store their audit records.
You can specify five kinds of information in the audit_control file. Each line of information begins with a keyword.
For more information about the audit_control file, see the audit_control(4) man page.
Example 31-2 Sample audit_control File
The following is a sample audit_control file for the system noddy. noddy uses two audit file systems on the audit server blinken, and a third audit file system that is mounted from the second audit server winken. The third file system is used only when the audit file systems on blinken become full or unavailable. The minfree value of 20 percent specifies that the warning script is run when the file systems are 80 percent full. The settings specify that logins and administrative operations are to be audited. The operations are audited for success and for failure. Failures of all types, except failures to create a file system object, are to be audited. Nonattributable events are also audited. The syslog audit log records fewer audit events. This log contains text summaries of failed logins and failed administrative operations.
flags:lo,am,-all,^-fc naflags:lo,nt minfree:20 dir:/etc/security/audit/blinken/files dir:/etc/security/audit/blinken.1/files # # Audit filesystem used when blinken fills up # dir:/etc/security/audit/winken plugin:name=audit_syslog.so.1; p_flags=-lo,-am
The /etc/security/audit_event file contains the default audit event-class mappings. You can edit this file to change the class mappings. When you change class mappings, you must reboot the system or run the auditconfig -conf command to read the changed mappings into the kernel. For more information, see the audit_event(4) man page.
The /etc/security/audit_startup script automatically configures the auditing service when the system enters multiuser mode. The auditd daemon starts after the script performs the following tasks:
For more information, see the audit_startup(1M) man page.
The /etc/security/audit_user database modifies the system-wide preselected classes for an individual user. The classes that you add to a user's entry in the audit_user database modify the settings in the audit_control file in two ways:
Each user entry in the audit_user database contains three fields:
The audit fields are processed in sequence. The always-audit-classes field turns on the auditing of the classes in that field. The never-audit-classes field turns off the auditing of the classes in that field.
Note - Avoid the common mistake of placing the all audit class in the never-audit-classes field. This mistake causes all auditing to be turned off for that user, which overrides the settings in the always-audit-classes field. The setting also overrides system-wide audit class settings in the audit_control file.
The never-audit-classes settings for a user override the system defaults. You might not want to override system defaults. For example, suppose you want to audit everything for user tamiko, except for successful reads of file system objects. You also want to apply the system defaults to tamiko. Note the placement of the second colon (:) in the following audit_user entries:
tamiko:all,^+fr: correct entry
The correct entry means, “always audit everything, except for successful file-reads.”
tamiko:all:+fr incorrect entry
The incorrect entry means, “always audit everything, but never audit successful file-reads.” The never-audit-classes field, which follows the second colon, overrides the system defaults. In the correct entry, the always-audit-classes field includes the exception to the all audit class. Because no audit class is in the never-audit-classes field, the system defaults from the audit_control file are not overridden.
Note - Successful events and failed events are treated separately. A process could generate more audit records for failed events than for successful events.
The /etc/security/audit_warn script notifies an email alias when the auditd daemon encounters an unusual condition while writing audit records. You can customize this script for your site to warn of conditions that might require manual intervention. Or, you could specify how to handle those conditions automatically. For all error conditions, the audit_warn script writes a message to syslog with the severity of daemon.alert. You can use syslog.conf to configure console display of syslog messages. The audit_warn script also sends a message to the audit_warn email alias. You should set up this alias when you enable auditing.
For further information, see the audit_warn(1M) man page.
The /etc/security/bsmconv script enables the auditing service. The bsmunconv command disables the auditing service. After the bsmconv script is run, you configure the audit directories and audit configuration files. Upon reboot, auditing is enabled.
For further information, see the bsmconv(1M) man page.