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