AUDIT_CONTROL(5)

๐Ÿ“ฆ
version 1.1 ยท 2 versions
, in nixos 26.05, nixpkgs unstable

โœจ 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. See audit(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/hosts file. More info in hosts(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's 0, 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), or G (Gigabytes). For example, 2M is the same as 2097152. 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 an expire-after parameter 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 to execve(2).
  • arge โ€” audit environmental variable arguments to execve(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 the cnt flag but not the ahlt flag โ€” 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