xref: /freebsd/contrib/openbsm/man/audit_control.5 (revision 6ae1554a5d9b318f8ad53ccc39fa5a961403da73)
1.\" Copyright (c) 2004-2009 Apple Inc.
2.\" Copyright (c) 2006 Robert N. M. Watson
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1.  Redistributions of source code must retain the above copyright
9.\"     notice, this list of conditions and the following disclaimer.
10.\" 2.  Redistributions in binary form must reproduce the above copyright
11.\"     notice, this list of conditions and the following disclaimer in the
12.\"     documentation and/or other materials provided with the distribution.
13.\" 3.  Neither the name of Apple Inc. ("Apple") nor the names of
14.\"     its contributors may be used to endorse or promote products derived
15.\"     from this software without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
21.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27.\" POSSIBILITY OF SUCH DAMAGE.
28.\"
29.\" $P4: //depot/projects/trustedbsd/openbsm/man/audit_control.5#26 $
30.\"
31.Dd May 14, 2009
32.Dt AUDIT_CONTROL 5
33.Os
34.Sh NAME
35.Nm audit_control
36.Nd "audit system parameters"
37.Sh DESCRIPTION
38The
39.Nm
40file contains several audit system parameters.
41Each line of this file is of the form:
42.Pp
43.D1 Ar parameter Ns : Ns Ar value
44.Pp
45The parameters are:
46.Bl -tag -width indent
47.It Va dir
48The directory where audit log files are stored.
49There may be more than one of these entries.
50Changes to this entry can only be enacted by restarting the
51audit system.
52See
53.Xr audit 8
54for a description of how to restart the audit system.
55.It Va dist
56When set to
57.Va on
58or
59.Va yes ,
60.Xr auditd 8
61will be creating hardlinks to all trail files in
62.Pa /var/audit/dist
63directory.
64Those hardlinks will be consumed by the
65.Xr auditdistd 8
66daemon.
67.It Va flags
68Specifies which audit event classes are audited for all users.
69.Xr audit_user 5
70describes how to audit events for individual users.
71See the information below for the format of the audit flags.
72.It Va host
73Specify the hostname or IP address to be used when setting the local
74systems's audit host information.
75This hostname will be converted into an IP or IPv6 address and will
76be included in the header of each audit record.
77Due to the possibility of transient errors coupled with the
78security issues in the DNS protocol itself, the use of DNS
79should be avoided.
80Instead, it is strongly recommended that the hostname be
81specified in the /etc/hosts file.
82For more information see
83.Xr hosts 5 .
84.It Va naflags
85Contains the audit flags that define what classes of events are audited when
86an action cannot be attributed to a specific user.
87.It Va minfree
88The minimum free space required on the file system audit logs are being written to.
89When the free space falls below this limit a warning will be issued.
90If no value for the minimum free space is set, the default of 20 percent is
91applied by the kernel.
92.It Va policy
93A list of global audit policy flags specifying various behaviors, such as
94fail stop, auditing of paths and arguments, etc.
95.It Va filesz
96Maximum trail size in bytes; if set to a non-0 value, the audit daemon will
97rotate the audit trail file at around this size.
98Sizes less than the minimum trail size (default of 512K) will be rejected as
99invalid.
100If 0, trail files will not be automatically rotated based on file size.
101For convenience, the trail size may be expressed with suffix letters:
102B (Bytes), K (Kilobytes), M (Megabytes), or G (Gigabytes).
103For example, 2M is the same as 2097152.
104.It Va expire-after
105Specifies when audit log files will expire and be removed.
106This may be after a time period has passed since the file was last
107written to or when the aggregate of all the trail files have reached a
108specified size or a combination of both.
109If no expire-after parameter is given then audit log files will not
110expire and be removed by the audit control system.
111See the information below for the format of the expiration
112specification.
113.El
114.Sh AUDIT FLAGS
115Audit flags are a comma-delimited list of audit classes as defined in the
116.Xr audit_class 5
117file.
118Event classes may be preceded by a prefix which changes their interpretation.
119The following prefixes may be used for each class:
120.Pp
121.Bl -tag -width indent -compact -offset indent
122.It (none)
123Record both successful and failed events.
124.It Li +
125Record successful events.
126.It Li -
127Record failed events.
128.It Li ^
129Record neither successful nor failed events.
130.It Li ^+
131Do not record successful events.
132.It Li ^-
133Do not record failed events.
134.El
135.Sh AUDIT POLICY FLAGS
136The policy flags field is a comma-delimited list of policy flags from the
137following list:
138.Pp
139.Bl -tag -width ".Cm zonename" -compact -offset indent
140.It Cm cnt
141Allow processes to continue running even though events are not being audited.
142If not set, processes will be suspended when the audit store space is
143exhausted.
144Currently, this is not a recoverable state.
145.It Cm ahlt
146Fail stop the system if unable to audit an event\[em]this consists of first
147draining pending records to disk, and then halting the operating system.
148.It Cm argv
149Audit command line arguments to
150.Xr execve 2 .
151.It Cm arge
152Audit environmental variable arguments to
153.Xr execve 2 .
154.It Cm seq
155Include a unique audit sequence number token in generated audit records (not
156implemented on
157.Fx
158or Darwin).
159.It Cm group
160Include supplementary groups list in generated audit records (not implemented
161on
162.Fx
163or Darwin; supplementary groups are never included in records on
164these systems).
165.It Cm trail
166Append a trailer token to each audit record (not implemented on
167.Fx
168or
169Darwin; trailers are always included in records on these systems).
170.It Cm path
171Include secondary file paths in audit records (not implemented on
172.Fx
173or
174Darwin; secondary paths are never included in records on these systems).
175.It Cm zonename
176Include a zone ID token with each audit record (not implemented on
177.Fx
178or
179Darwin;
180.Fx
181audit records do not currently include the jail ID or name).
182.It Cm perzone
183Enable auditing for each local zone (not implemented on
184.Fx
185or Darwin; on
186.Fx ,
187audit records are collected from all jails and placed in a single
188global trail, and only limited audit controls are permitted within a jail).
189.El
190.Pp
191It is recommended that installations set the
192.Cm cnt
193flag but not
194.Cm ahlt
195flag unless it is intended that audit logs exceeding available disk space
196halt the system.
197.Sh AUDIT LOG EXPIRATION SPECIFICATION
198The expiration specification can be one value or two values with the
199logical conjunction of AND/OR between them.
200Values for the audit log file age are numbers with the following
201suffixes:
202.Pp
203.Bl -tag -width "(space) or" -compact -offset indent
204.It Li s
205Log file age in seconds.
206.It Li h
207Log file age in hours.
208.It Li d
209Log file age in days.
210.It Li y
211Log file age in years.
212.El
213.Pp
214Values for the disk space used are numbers with the following suffixes:
215.Pp
216.Bl -tag -width "(space) or" -compact -offset indent
217.It (space) or
218.It Li B
219Disk space used in Bytes.
220.It Li K
221Disk space used in Kilobytes.
222.It Li M
223Disk space used in Megabytes.
224.It Li G
225Disk space used in Gigabytes.
226.El
227.Pp
228The suffixes on the values are case sensitive.
229If both an age and disk space value are used they are separated by
230AND or OR and both values are used to determine when audit
231log files expire.
232In the case of AND, both the age and disk space conditions must be met
233before the log file is removed.
234In the case of OR, either condition may expire the log file.
235For example:
236.Bd -literal -offset indent
237expire-after: 60d AND 1G
238.Ed
239.Pp
240will expire files that are older than 60 days but only if 1
241gigabyte of disk space total is being used by the audit logs.
242.Sh DEFAULT
243The following settings appear in the default
244.Nm
245file:
246.Bd -literal -offset indent
247dir:/var/audit
248flags:lo,aa
249minfree:5
250naflags:lo,aa
251policy:cnt,argv
252filesz:2M
253expire-after:10M
254.Ed
255.Pp
256The
257.Va flags
258parameter above specifies the system-wide mask corresponding to login/logout
259as well as authentication and authorization events.
260The
261.Va policy
262parameter specifies that the system should neither fail stop nor suspend
263processes when the audit store fills and that command line arguments should
264be audited for
265.Dv AUE_EXECVE
266events.
267The trail file will be automatically rotated by the audit daemon when the
268file size reaches approximately 2MB.
269Trail files will expire when their aggregate size exceeds 10MB.
270.Sh FILES
271.Bl -tag -width ".Pa /etc/security/audit_control" -compact
272.It Pa /etc/security/audit_control
273.El
274.Sh SEE ALSO
275.Xr auditon 2 ,
276.Xr audit 4 ,
277.Xr audit_class 5 ,
278.Xr audit_event 5 ,
279.Xr audit_user 5 ,
280.Xr audit 8 ,
281.Xr auditd 8
282.Sh HISTORY
283The OpenBSM implementation was created by McAfee Research, the security
284division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004.
285It was subsequently adopted by the TrustedBSD Project as the foundation for
286the OpenBSM distribution.
287.Sh AUTHORS
288.An -nosplit
289This software was created by McAfee Research, the security research division
290of McAfee, Inc., under contract to Apple Computer Inc.
291Additional authors include
292.An Wayne Salamon ,
293.An Robert Watson ,
294and SPARTA Inc.
295.Pp
296The Basic Security Module (BSM) interface to audit records and audit event
297stream format were defined by Sun Microsystems.
298