10739bd60SRobert Watson.\" Copyright (c) 2006 Robert N. M. Watson 20739bd60SRobert Watson.\" All rights reserved. 30739bd60SRobert Watson.\" 40739bd60SRobert Watson.\" Redistribution and use in source and binary forms, with or without 50739bd60SRobert Watson.\" modification, are permitted provided that the following conditions 60739bd60SRobert Watson.\" are met: 70739bd60SRobert Watson.\" 1. Redistributions of source code must retain the above copyright 80739bd60SRobert Watson.\" notice, this list of conditions and the following disclaimer. 90739bd60SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 100739bd60SRobert Watson.\" notice, this list of conditions and the following disclaimer in the 110739bd60SRobert Watson.\" documentation and/or other materials provided with the distribution. 120739bd60SRobert Watson.\" 130739bd60SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 140739bd60SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 150739bd60SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 160739bd60SRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 170739bd60SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 180739bd60SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 190739bd60SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 200739bd60SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 210739bd60SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 220739bd60SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 230739bd60SRobert Watson.\" SUCH DAMAGE. 240739bd60SRobert Watson.\" 250739bd60SRobert Watson.\" $FreeBSD$ 260739bd60SRobert Watson.\" 27f10a5f6cSRobert Watson.Dd February 6, 2006 280739bd60SRobert Watson.Os 290739bd60SRobert Watson.Dt AUDIT 4 300739bd60SRobert Watson.Sh NAME 310739bd60SRobert Watson.Nm audit 320739bd60SRobert Watson.Nd Security Event Audit 330739bd60SRobert Watson.Sh SYNOPSIS 340739bd60SRobert Watson.Cd "options AUDIT" 350739bd60SRobert Watson.Sh DESCRIPTION 360739bd60SRobert WatsonSecurity Event Audit is a facility to provide fine-grained, configurable 370739bd60SRobert Watsonlogging of security-relevant events, and is intended to meet the requirements 380739bd60SRobert Watsonof the Common Criteria (CC) Common Access Protection Profile (CAPP) 390739bd60SRobert Watsonevaluation. 400739bd60SRobert WatsonThe 410739bd60SRobert Watson.Fx 420739bd60SRobert Watsonaudit facility implements the de facto industry standard BSM API, file 430739bd60SRobert Watsonformats, and command line interface, first found in the Solaris operating 440739bd60SRobert Watsonsystem. 450739bd60SRobert WatsonInformation on the user space implementation can be found in 469ca971bcSChristian Brueffer.Xr libbsm 3 . 470739bd60SRobert Watson.Pp 480739bd60SRobert WatsonAudit support is enabled at boot, if present in the kernel, using an 490739bd60SRobert Watson.Xr rc.conf 5 500739bd60SRobert Watsonflag. 510739bd60SRobert WatsonThe audit daemon, 520739bd60SRobert Watson.Xr auditd 8 , 530739bd60SRobert Watsonis responsible for configuring the kernel to perform audit, pushing 540739bd60SRobert Watsonconfiguration data from the various audit configuration files into the 550739bd60SRobert Watsonkernel. 56f10a5f6cSRobert Watson.Ss Audit Special Device 57f10a5f6cSRobert WatsonThe kernel audit facility provides a special device, 58f10a5f6cSRobert Watson.Pa /dev/audit , 59f10a5f6cSRobert Watsonwhich is used by 60f10a5f6cSRobert Watson.Xr auditd 8 61f10a5f6cSRobert Watsonto monitor for audit events, such as requests to cycle the log, low disk 62f10a5f6cSRobert Watsonspace conditions, and requests to terminate auditing. 63f10a5f6cSRobert WatsonThis device is not intended for use by applications. 64f10a5f6cSRobert Watson.Ss Audit Pipe Special Devices 65f10a5f6cSRobert WatsonThe kernel audit facility also a clonable special device, 66f10a5f6cSRobert Watson.Pa /dev/auditpipe , 67f10a5f6cSRobert Watsonwhich allows appropriately privileged applications to gain direct access to 68f10a5f6cSRobert Watsonthe BSM audit stream without accessing audit trail files. 69f10a5f6cSRobert WatsonAs audit trail files are owned by the audit daemon until terminated, they 70f10a5f6cSRobert Watsonare an unreliable way for applications to access live audit data; this 71f10a5f6cSRobert Watsonspecial device inserts a "tee" in the audit event stream. 72f10a5f6cSRobert WatsonThis facility is appropriate for use by live monitoring tools, including 73f10a5f6cSRobert Watsonintrusion detection. 74f10a5f6cSRobert WatsonAs the device is clonable, more than one instance of the device may be opened 75f10a5f6cSRobert Watsonat a time; each device instance will provide access to all records. 76f10a5f6cSRobert Watson.Pp 77f10a5f6cSRobert WatsonThe audit pipe device provides discreet BSM audit records; if the read buffer 78f10a5f6cSRobert Watsonpassed by the application is too small to hold the next record in the 79f10a5f6cSRobert Watsonsequence, it will be dropped. 80f10a5f6cSRobert WatsonUnlike audit data written to the audit trail, the reliability of record 81f10a5f6cSRobert Watsondelivery is not guaranteed. 82f10a5f6cSRobert WatsonIn particular, when an audit pipe queue fills, records will be dropped. 83f10a5f6cSRobert WatsonAudit pipe devices are blocking by default, but support non-blocking I/O, 84f10a5f6cSRobert Watsonasynchronous I/O using SIGIO, and support for polled operation via 85f10a5f6cSRobert Watson.Xr select 2 86f10a5f6cSRobert Watsonand 87f10a5f6cSRobert Watson.Xr poll 2 . 880739bd60SRobert Watson.Sh SEE ALSO 890739bd60SRobert Watson.Xr auditreduce 1 , 900739bd60SRobert Watson.Xr praudit 1 , 910739bd60SRobert Watson.Xr audit 2 , 920739bd60SRobert Watson.Xr auditctl 2 , 930739bd60SRobert Watson.Xr auditon 2 , 940739bd60SRobert Watson.Xr getaudit 2 , 950739bd60SRobert Watson.Xr getauid 2 , 96f10a5f6cSRobert Watson.Xr poll 2 , 97f10a5f6cSRobert Watson.Xr select 2 , 980739bd60SRobert Watson.Xr setaudit 2 , 990739bd60SRobert Watson.Xr setauid 2 , 1000739bd60SRobert Watson.Xr libbsm 3 , 1010739bd60SRobert Watson.Xr audit.log 5 , 1020739bd60SRobert Watson.Xr audit_class 5 , 1030739bd60SRobert Watson.Xr audit_control 5 , 1040739bd60SRobert Watson.Xr audit_event 5 , 1050739bd60SRobert Watson.Xr audit_user 5 , 1060739bd60SRobert Watson.Xr audit_warn 5 , 1070739bd60SRobert Watson.Xr rc.conf 5 , 1080739bd60SRobert Watson.Xr audit 8 , 1090739bd60SRobert Watson.Xr auditd 8 1100739bd60SRobert Watson.Sh AUTHORS 1110739bd60SRobert WatsonThis software was created by McAfee Research, the security research division 1120739bd60SRobert Watsonof McAfee, Inc., under contract to Apple Computer Inc. 1130739bd60SRobert WatsonAdditional authors include Wayne Salamon, Robert Watson, and SPARTA Inc. 1140739bd60SRobert Watson.Pp 1150739bd60SRobert WatsonThe Basic Security Module (BSM) interface to audit records and audit event 1160739bd60SRobert Watsonstream format were defined by Sun Microsystems. 1170739bd60SRobert Watson.Pp 1180739bd60SRobert WatsonThis manual page was written by 1190739bd60SRobert Watson.An Robert Watson Aq rwatson@FreeBSD.org . 1200739bd60SRobert Watson.Sh HISTORY 1210739bd60SRobert WatsonThe OpenBSM implementation was created by McAfee Research, the security 1220739bd60SRobert Watsondivision of McAfee Inc., under contract to Apple Computer Inc. in 2004. 1230739bd60SRobert WatsonIt was subsequently adopted by the TrustedBSD Project as the foundation for 1240739bd60SRobert Watsonthe OpenBSM distribution. 1250739bd60SRobert Watson.Pp 1260739bd60SRobert WatsonSupport for kernel audit first appeared in 1270739bd60SRobert Watson.Fx 6.1 . 1280739bd60SRobert Watson.Sh BUGS 1290739bd60SRobert WatsonThe audit facility in 1300739bd60SRobert Watson.Fx 1310739bd60SRobert Watsonis considered experimental, and production deployment should occur only after 1320739bd60SRobert Watsoncareful consideration of the risks of deploying experimental software. 1330739bd60SRobert Watson.Pp 1340739bd60SRobert WatsonThe 1350739bd60SRobert Watson.Fx 1360739bd60SRobert Watsonkernel does not fully validate that audit records submitted by user 1370739bd60SRobert Watsonapplications are syntactically valid BSM; as submission of records is limited 1380739bd60SRobert Watsonto privileged processes, this is not a critical bug. 1390739bd60SRobert Watson.Pp 1400739bd60SRobert WatsonInstrumentation of auditable events in the kernel is not complete, as some 1410739bd60SRobert Watsonsystem calls do not generate audit records, or generate audit records with 1420739bd60SRobert Watsonincomplete argument information. 1430739bd60SRobert Watson.Pp 1440739bd60SRobert WatsonMandatory Access Control (MAC) labels, as provided by the 1450739bd60SRobert Watson.Xr mac 4 1460739bd60SRobert Watsonfacility, are not audited as part of records involving MAC decisions. 147