]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/openbsm/bin/auditreduce/auditreduce.1
Fix completion descriptors alignment for the ENA
[FreeBSD/FreeBSD.git] / contrib / openbsm / bin / auditreduce / auditreduce.1
1 .\" Copyright (c) 2004 Apple Inc.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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 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.
15 .\"
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.
27 .\"
28 .Dd February 20, 2020
29 .Dt AUDITREDUCE 1
30 .Os
31 .Sh NAME
32 .Nm auditreduce
33 .Nd "select records from audit trail files"
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl A
37 .Op Fl a Ar YYYYMMDD Ns Op Ar HH Ns Op Ar MM Ns Op Ar SS
38 .Op Fl b Ar YYYYMMDD Ns Op Ar HH Ns Op Ar MM Ns Op Ar SS
39 .Op Fl c Ar flags
40 .Op Fl d Ar YYYYMMDD
41 .Op Fl e Ar euid
42 .Op Fl f Ar egid
43 .Op Fl g Ar rgid
44 .Op Fl j Ar id
45 .Op Fl m Ar event
46 .Op Fl o Ar object Ns = Ns Ar value
47 .Op Fl r Ar ruid
48 .Op Fl u Ar auid
49 .Op Fl v
50 .Op Fl z Ar zone
51 .Op Ar
52 .Sh DESCRIPTION
53 The
54 .Nm
55 utility selects records from the audit trail files based on the specified
56 criteria.
57 Matching audit records are printed to the standard output in
58 their raw binary form.
59 If no
60 .Ar file
61 argument is specified, the standard input is used
62 by default.
63 Use the
64 .Xr praudit 1
65 utility to print the selected audit records in human-readable form.
66 .Pp
67 The options are as follows:
68 .Bl -tag -width indent
69 .It Fl A
70 Select all records.
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.
75 .It Fl c Ar flags
76 Select records matching the given audit classes specified as a comma
77 separated list of audit flags.
78 See
79 .Xr audit_control 5
80 for a description of audit flags.
81 .It Fl d Ar YYYYMMDD
82 Select records that occurred on a given date.
83 This option cannot be used with
84 .Fl a
85 or
86 .Fl b .
87 .It Fl e Ar euid
88 Select records with the given effective user ID or name.
89 .It Fl f Ar egid
90 Select records with the given effective group ID or name.
91 .It Fl g Ar rgid
92 Select records with the given real group ID or name.
93 .It Fl j Ar id
94 Select records having a subject token with matching ID, where ID is a process ID.
95 .It Fl m Ar event
96 Select records with the given event name or number. This option can
97 be used more then once to select records of multiple event types.
98 See
99 .Xr audit_event 5
100 for a description of audit event names and numbers.
101 .It Fl o Ar object Ns = Ns Ar value
102 .Bl -tag -width ".Cm msgqid"
103 .It Cm file
104 Select records containing path tokens, where the pathname matches
105 one of the comma delimited extended regular expression contained in
106 given specification.
107 Regular expressions which are prefixed with a tilde
108 .Pq Ql ~
109 are excluded
110 from the search results.
111 These extended regular expressions are processed from left to right,
112 and a path will either be selected or deslected based on the first match.
113 .Pp
114 Since commas are used to delimit the regular expressions, a backslash
115 .Pq Ql \e
116 character should be used to escape the comma if it is a part of the search
117 pattern.
118 .It Cm msgqid
119 Select records containing the given message queue ID.
120 .It Cm pid
121 Select records containing the given process ID.
122 .It Cm semid
123 Select records containing the given semaphore ID.
124 .It Cm shmid
125 Select records containing the given shared memory ID.
126 .El
127 .It Fl r Ar ruid
128 Select records with the given real user ID or name.
129 .It Fl u Ar auid
130 Select records with the given audit ID.
131 .It Fl v
132 Invert sense of matching, to select records that do not match.
133 .It Fl z Ar zone
134 Select records from the given zone(s).
135 .Ar zone
136 is a glob for zones to match.
137 .El
138 .Sh EXAMPLES
139 To select all records associated with effective user ID root from the audit
140 log
141 .Pa /var/audit/20031016184719.20031017122634 :
142 .Bd -literal -offset indent
143 auditreduce -e root \e
144     /var/audit/20031016184719.20031017122634
145 .Ed
146 .Pp
147 To select all
148 .Xr setlogin 2
149 events from that log:
150 .Bd -literal -offset indent
151 auditreduce -m AUE_SETLOGIN \e
152     /var/audit/20031016184719.20031017122634
153 .Ed
154 .Pp
155 Output from the above command lines will typically be piped to a new trail
156 file, or via standard output to the
157 .Xr praudit 1
158 command.
159 .Pp
160 Select all records containing a path token where the pathname contains
161 .Pa /etc/master.passwd :
162 .Bd -literal -offset indent
163 auditreduce -o file="/etc/master.passwd" \e
164     /var/audit/20031016184719.20031017122634
165 .Ed
166 .Pp
167 Select all records containing path tokens, where the pathname is a TTY
168 device:
169 .Bd -literal -offset indent
170 auditreduce -o file="/dev/tty[a-zA-Z][0-9]+" \e
171     /var/audit/20031016184719.20031017122634
172 .Ed
173 .Pp
174 Select all records containing path tokens, where the pathname is a TTY
175 except for
176 .Pa /dev/ttyp2 :
177 .Bd -literal -offset indent
178 auditreduce -o file="~/dev/ttyp2,/dev/tty[a-zA-Z][0-9]+" \e
179     /var/audit/20031016184719.20031017122634
180 .Ed
181 .Sh SEE ALSO
182 .Xr praudit 1 ,
183 .Xr audit_control 5 ,
184 .Xr audit_event 5
185 .Sh HISTORY
186 The OpenBSM implementation was created by McAfee Research, the security
187 division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004.
188 It was subsequently adopted by the TrustedBSD Project as the foundation for
189 the OpenBSM distribution.
190 .Sh AUTHORS
191 .An -nosplit
192 This software was created by McAfee Research, the security research division
193 of McAfee, Inc., under contract to Apple Computer Inc.
194 Additional authors include
195 .An Wayne Salamon ,
196 .An Robert Watson ,
197 and SPARTA Inc.
198 .Pp
199 The Basic Security Module (BSM) interface to audit records and audit event
200 stream format were defined by Sun Microsystems.