AUDIT_CONTROL(5)
โจ AUDIT_CONTROL(5) โ the audit system parameters file, bestie โจ
okay so this is the audit_control page from the File Formats Manual, and honestly? it's giving "the config file that runs your whole audit vibe" ๐
let's get into it.
๐ NAME
audit_control โ audit system parameters ๐
๐ธ DESCRIPTION
The audit_control</p> file is where you keep a bunch of audit system parameters. Every single line in this file is formatted like this, no cap:
parameter:value
Here's the whole squad of parameters:
dirโ the directory where your audit log files live. You can have more than one of these entries, slay. โ ๏ธ but heads up: changes to this entry only get enacted when you restart the audit system. Seeaudit(8)for how to actually restart the audit system (iykyk).flagsโ tells the system which audit event classes get audited for all users.audit_user(5)is the one that explains how to audit events for individual users. The format of the audit flags is down below in its own section ๐ฆhostโ specify the hostname or IP address to use when you're setting the local system's audit host information. This hostname gets converted into an IP or IPv6 address and then gets included in the header of every audit record. ๐ real talk: because of possible transient errors plus the security issues baked into the DNS protocol itself, you should avoid DNS. Instead it is strongly recommended that you put the hostname in the/etc/hostsfile. More info inhosts(5).naflagsโ holds the audit flags that define what classes of events get audited when an action can't be attributed to a specific user. main character events only โจminfreeโ the minimum free space required on the file system where audit logs are being written. When free space drops below this limit, a warning gets issued. If you don't set a value for the minimum free space, the kernel applies a default of 20 percent.policyโ a list of global audit policy flags that specify various behaviors โ things like fail stop, auditing of paths and arguments, etc. (full list below, bestie ๐ซถ)fileszโ maximum trail size in bytes. If you set it to a non-0 value, the audit daemon will rotate the audit trail file at around this size. Sizes less than the minimum trail size (default of 512K) get rejected as invalid. If it's0, trail files will not be automatically rotated based on file size. For convenience you can express the trail size with suffix letters:B(Bytes),K(Kilobytes),M(Megabytes), orG(Gigabytes). For example,2Mis the same as2097152. math queen ๐งฎexpire-afterโ specifies when audit log files expire and get removed. This can be after a time period has passed since the file was last written to, OR when the aggregate of all the trail files has reached a specified size, OR a combination of both. If you don't give anexpire-afterparameter then audit log files will not expire and will not be removed by the audit control system. The format of the expiration spec is below โฌ๏ธ
๐ฅ AUDIT FLAGS
Audit flags are a comma-delimited list of audit classes as defined in the audit_class(5) file. Event classes can be preceded by a prefix that changes their interpretation. These are the prefixes you can use for each class:
- (none) โ record both successful and failed events.
+โ record successful events.-โ record failed events.^โ record neither successful nor failed events.^+โ do not record successful events.^-โ do not record failed events.
periodt ๐
๐ AUDIT POLICY FLAGS
The policy flags field is a comma-delimited list of policy flags from this list:
cntโ allow processes to continue running even though events aren't being audited. If it's not set, processes get suspended when the audit store space is exhausted. โ ๏ธ Currently this is not a recoverable state.ahltโ fail stop the system if it's unable to audit an event. This consists of first draining pending records to disk, and then halting the operating system. ๐ญ dramatic but necessary.argvโ audit command line arguments toexecve(2).argeโ audit environmental variable arguments toexecve(2).seqโ include a unique audit sequence number token in generated audit records (not implemented on FreeBSD or Darwin).groupโ include supplementary groups list in generated audit records (not implemented on FreeBSD or Darwin; supplementary groups are never included in records on these systems).trailโ append a trailer token to each audit record (not implemented on FreeBSD or Darwin; trailers are always included in records on these systems).pathโ include secondary file paths in audit records (not implemented on FreeBSD or Darwin; secondary paths are never included in records on these systems).zonenameโ include a zone ID token with each audit record (not implemented on FreeBSD or Darwin; FreeBSD audit records do not currently include the jail ID or name).perzoneโ enable auditing for each local zone (not implemented on FreeBSD or Darwin; on FreeBSD, audit records are collected from all jails and placed in a single global trail, and only limited audit controls are permitted within a jail).
๐ก It is recommended that installations set thecntflag but not theahltflag โ unless you genuinely intend that audit logs exceeding available disk space should halt the system. like, actually want that. fr fr.
๐ฆ AUDIT LOG EXPIRATION SPECIFICATION
The expiration specification can be one value, or two values with the logical conjunction of AND/OR between them. Values for the audit log file age are numbers with these suffixes:
sโ log file age in seconds.hโ log file age in hours.dโ log file age in days.yโ log file age in years.
Values for the disk space used are numbers with these suffixes:
- (space) or
Bโ disk space used in Bytes. Kโ disk space used in Kilobytes.Mโ disk space used in Megabytes.Gโ disk space used in Gigabytes.
โ ๏ธ The suffixes on the values are case sensitive. If you use both an age and a disk space value, they're separated by AND or OR, and both values are used to determine when audit log files expire. With AND, both the age and disk space conditions must be met before the log file is removed. With OR, either condition may expire the log file. For example:
expire-after: 60d AND 1G
will expire files that are older than 60 days but only if 1 gigabyte of disk space total is being used by the audit logs. iconic behavior tbh ๐
๐ DEFAULT
These are the settings that appear in the default audit_control file:
dir:/var/audit
flags:lo
minfree:5
naflags:lo
policy:cnt,argv
filesz:2097152
So what's happening here? The flags parameter above specifies the system-wide mask corresponding to login/logout events. The policy parameter specifies that the system should neither fail stop nor suspend processes when the audit store fills, and that command line arguments should be audited for AUE_EXECVE events. And the trail file gets automatically rotated by the audit daemon when the file size reaches approximately 2MB. slay ๐
๐ FILES
/etc/security/audit_control
๐ SEE ALSO
auditon(2), audit(4), audit_class(5), audit_event(5), audit_user(5), audit(8), auditd(8)
โญ HISTORY
The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc. in 2004. It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. a little origin story for you ๐ง
๐ AUTHORS
This software was created by McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer Inc. Additional authors include Wayne Salamon, Robert Watson, and SPARTA Inc.
The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems.
k that's the whole page bestie ๐ซถ this one's a Debian page, dated January 29, 2009 โ yeah it's vintage, but it still ate. ๐ โจ
๐ฆ where this page comes from
- nixos 26.05: openbsm 1.1
- nixpkgs unstable: openbsm 1.1
- Copyright (c) 2004-2009 Apple Inc
- Copyright (c) 2006 Robert N. M. Watson
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms