1 .\" Copyright (c) 2004 Apple Computer, Inc.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
13 .\" its contributors may be used to endorse or promote products derived
14 .\" from this software without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
20 .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 .\" POSSIBILITY OF SUCH DAMAGE.
28 .\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.1#14 $
35 .Nd "select records from audit trail files"
39 .Op Fl a Ar YYYYMMDD Ns Op Ar HH Ns Op Ar MM Ns Op Ar SS
40 .Op Fl b Ar YYYYMMDD Ns Op Ar HH Ns Op Ar MM Ns Op Ar SS
48 .Op Fl o Ar object Ns = Ns Ar value
55 utility selects records from the audit trail files based on the specified
57 Matching audit records are printed to the standard output in
58 their raw binary form.
61 argument is specified, the standard input is used
65 utility to print the selected audit records in human-readable form.
67 The options are as follows:
68 .Bl -tag -width indent
71 .It Fl a Ar YYYYMMDD Ns Op Ar HH Ns Op Ar MM Ns Op Ar SS
72 Select records that occurred after or on the given datetime.
73 .It Fl b Ar YYYYMMDD Ns Op Ar HH Ns Op Ar MM Ns Op Ar SS
74 Select records that occurred before the given datetime.
76 Select records matching the given audit classes specified as a comma
77 separated list of audit flags.
80 for a description of audit flags.
82 Select records that occurred on a given date.
83 This option cannot be used with
88 Select records with the given effective user ID or name.
90 Select records with the given effective group ID or name.
92 Select records with the given real group ID or name.
94 Select records having a subject token with matching ID.
96 Select records with the given event name or number.
99 for a description of audit event names and numbers.
100 .It Fl o Ar object Ns = Ns Ar value
101 .Bl -tag -width ".Cm msgqid"
103 Select records containing path tokens, where the pathname matches
104 one of the comma delimited extended regular expression contained in
106 Regular expressions which are prefixed with a tilde
109 from the search results.
110 These extended regular expressions are processed from left to right,
111 and a path will either be selected or deslected based on the first match.
113 Since commas are used to delimit the regular expressions, a backslash
115 character should be used to escape the comma if it is a part of the search
118 Select records containing the given message queue ID.
120 Select records containing the given process ID.
122 Select records containing the given semaphore ID.
124 Select records containing the given shared memory ID.
127 Select records with the given real user ID or name.
129 Select records with the given audit ID.
132 To select all records associated with effective user ID root from the audit
134 .Pa /var/audit/20031016184719.20031017122634 :
135 .Bd -literal -offset indent
136 auditreduce -e root \e
137 /var/audit/20031016184719.20031017122634
142 events from that log:
143 .Bd -literal -offset indent
144 auditreduce -m AUE_SETLOGIN \e
145 /var/audit/20031016184719.20031017122634
148 Output from the above command lines will typically be piped to a new trail
149 file, or via standard output to the
153 Select all records containing a path token where the pathname contains
154 .Pa /etc/master.passwd :
155 .Bd -literal -offset indent
156 auditreduce -o file="/etc/master.passwd" \e
157 /var/audit/20031016184719.20031017122634
160 Select all records containing path tokens, where the pathname is a TTY
162 .Bd -literal -offset indent
163 auditreduce -o file="/dev/tty[a-zA-Z][0-9]+" \e
164 /var/audit/20031016184719.20031017122634
167 Select all records containing path tokens, where the pathname is a TTY
170 .Bd -literal -offset indent
171 auditreduce -o file="~/dev/ttyp2,/dev/tty[a-zA-Z][0-9]+" \e
172 /var/audit/20031016184719.20031017122634
176 .Xr audit_control 5 ,
179 The OpenBSM implementation was created by McAfee Research, the security
180 division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004.
181 It was subsequently adopted by the TrustedBSD Project as the foundation for
182 the OpenBSM distribution.
185 This software was created by McAfee Research, the security research division
186 of McAfee, Inc., under contract to Apple Computer Inc.
187 Additional authors include
192 The Basic Security Module (BSM) interface to audit records and audit event
193 stream format were defined by Sun Microsystems.