AUDIT(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸŽ€ AUDIT(4) β€” the manual page, bestie edition πŸŽ€

ok so this is audit(4), straight out of the Kernel Interfaces Manual, and no cap it's the main character of security logging on FreeBSD. let's get into it πŸ’…


✨ NAME ✨

audit β€” Security Event Audit. that's the whole vibe. πŸ‘‘


🌸 SYNOPSIS 🌸

options AUDIT

that's it. one line. iconic. 🫢


πŸ’– DESCRIPTION πŸ’–

Security Event Audit is a whole facility for doing fine-grained, configurable logging of security-relevant events β€” and fr fr it's built to meet the requirements of the Common Criteria (CC) Common Access Protection Profile (CAPP) evaluation. so yeah, it's not just pretty, it's certified pretty. ✨

The FreeBSD audit facility implements the de facto industry standard BSM API, file formats, and command line interface, first found in the Solaris operating system. if you wanna read about the user space side of things, it's all in libbsm(3). πŸ’œ

Audit support is enabled at boot β€” if it's present in the kernel β€” using an rc.conf(5) flag. and the audit daemon, auditd(8), is the one actually responsible for configuring the kernel to perform audit, pushing configuration data from the various audit configuration files into the kernel. she's the manager. she delegates. πŸ’…

πŸ”₯ Audit Special Device πŸ”₯

The kernel audit facility provides a special device, /dev/audit, which is used by auditd(8) to monitor for audit events β€” think requests to cycle the log, low disk space conditions, and requests to terminate auditing. 🚨

bestie listen. this device is not intended for use by applications. hands off. πŸ™ˆ

πŸ¦‹ Audit Pipe Special Devices πŸ¦‹

Audit pipe special devices β€” discussed in auditpipe(4) β€” give you a configurable live tracking mechanism so applications can tee the audit trail, plus configure custom preselection parameters to track users and events in a fine-grained manner. very much the "i want a copy of that stream actually" energy. πŸ“

🌈 DTrace Audit Provider 🌈

The DTrace Audit Provider, dtaudit(4), lets D scripts enable capture of in-kernel audit records for kernel audit event types, and then process their contents during audit commit or BSM generation. lowkey the coolest crossover episode. ⭐


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, in order:


🧚 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 real glow-up story. 🌸

Support for kernel audit first appeared in FreeBSD 6.2. πŸŽ€


πŸ’€ 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. respect the elders. ✨

This manual page was written by Robert Watson <rwatson@FreeBSD.org>. thank you robert, king. πŸ‘‘


😭 BUGS 😭

ok the caveats, and we're taking these seriously:

  • The FreeBSD kernel does not fully validate that audit records submitted by user applications are syntactically valid BSM. as submission of records is limited to privileged processes, this is not a critical bug. so like… a bug but a chill one. πŸ’…
  • Instrumentation of auditable events in the kernel is not complete β€” some system calls do not generate audit records, or generate audit records with incomplete argument information. yeah. gaps. 🫠
  • Mandatory Access Control (MAC) labels, as provided by the mac(4) facility, are not audited as part of records involving MAC decisions.
  • Currently the audit syscalls are not supported for jailed processes. however β€” and this is the plot twist β€” if a process has audit session state associated with it, audit records will still be produced, and a zonename token containing the jail's ID or name will be present in the audit records. she contains multitudes. πŸ”₯

ngl the whole thing is AUDIT(4) from the Kernel Interfaces Manual, and this lil rewrite is dated April 28, 2019, with Debian holding it down on the source/version tip. mwah πŸ’‹ slay, stay audited πŸ’–πŸŒΈβœ¨
πŸ“¦ where this page comes from