2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH AUDITON 2 "Apr 6, 2009"
8 auditon \- manipulate auditing
12 cc [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ]
13 #include <sys/param.h>
14 #include <bsm/libbsm.h>
16 \fBint\fR \fBauditon\fR(\fBint\fR \fIcmd\fR, \fBcaddr_t\fR \fIdata\fR, \fBint\fR \fIlength\fR);
22 The \fBauditon()\fR function performs various audit subsystem control
23 operations. The \fIcmd\fR argument designates the particular audit control
24 command. The \fIdata\fR argument is a pointer to command-specific data. The
25 \fIlength\fR argument is the length in bytes of the command-specific data.
28 The following commands are supported:
36 Return the system audit on/off/disabled condition in the integer pointed to by
37 \fIdata\fR. The following values can be returned:
41 \fB\fBAUC_AUDITING\fR\fR
44 Auditing has been turned on.
50 \fB\fBAUC_DISABLED\fR\fR
53 Auditing system has not been enabled.
59 \fB\fBAUC_NOAUDIT\fR\fR
62 Auditing has been turned off.
68 \fB\fBAUC_NOSPACE\fR\fR
71 Auditing has blocked due to lack of space in audit partition.
83 Set the system's audit on/off condition to the value in the integer pointed to
84 by \fIdata\fR. The Solaris Audit subsystem must be enabled by \fBbsmconv\fR(1M)
85 before auditing can be turned on. The following audit states can be set:
89 \fB\fBAUC_AUDITING\fR\fR
92 Turns on audit record generation.
98 \fB\fBAUC_NOAUDIT\fR\fR
101 Turns off audit record generation.
109 \fB\fBA_GETCLASS\fR\fR
113 Return the event to class mapping for the designated audit event. The
114 \fIdata\fR argument points to the \fBau_evclass_map\fR structure containing the
115 event number. The preselection class mask is returned in the same structure.
121 \fB\fBA_SETCLASS\fR\fR
125 Set the event class preselection mask for the designated audit event. The
126 \fIdata\fR argument points to the \fBau_evclass_map\fR structure containing the
127 event number and class mask.
133 \fB\fBA_GETKMASK\fR\fR
137 Return the kernel preselection mask in the \fBau_mask\fR structure pointed to
138 by \fIdata\fR. This is the mask used to preselect non-attributable audit
145 \fB\fBA_SETKMASK\fR\fR
149 Set the kernel preselection mask. The \fIdata\fR argument points to the
150 \fBau_mask\fR structure containing the class mask. This is the mask used to
151 preselect non-attributable audit events.
157 \fB\fBA_GETPINFO\fR\fR
161 Return the audit ID, preselection mask, terminal ID and audit session ID of the
162 specified process in the \fBauditpinfo\fR structure pointed to by \fIdata\fR.
164 Note that \fBA_GETPINFO\fR can fail if the termial ID contains a network
165 address longer than 32 bits. In this case, the \fBA_GETPINFO_ADDR\fR command
172 \fB\fBA_GETPINFO_ADDR\fR\fR
176 Returns the audit ID, preselection mask, terminal ID and audit session ID of
177 the specified process in the \fBauditpinfo_addr\fR structure pointed to by
184 \fB\fBA_SETPMASK\fR\fR
188 Set the preselection mask of the specified process. The \fIdata\fR argument
189 points to the \fBauditpinfo\fR structure containing the process ID and the
190 preselection mask. The other fields of the structure are ignored and should be
197 \fB\fBA_SETUMASK\fR\fR
201 Set the preselection mask for all processes with the specified audit ID. The
202 \fIdata\fR argument points to the \fBauditinfo\fR structure containing the
203 audit ID and the preselection mask. The other fields of the structure are
204 ignored and should be set to \fINULL\fR.
210 \fB\fBA_SETSMASK\fR\fR
214 Set the preselection mask for all processes with the specified audit session
215 ID. The \fIdata\fR argument points to the \fBauditinfo\fR structure containing
216 the audit session \fBID\fR and the preselection mask. The other fields of the
217 structure are ignored and should be set to \fINULL.\fR
223 \fB\fBA_GETQCTRL\fR\fR
227 Return the kernel audit queue control parameters. These control the high and
228 low water marks of the number of audit records allowed in the audit queue. The
229 high water mark is the maximum allowed number of undelivered audit records. The
230 low water mark determines when threads blocked on the queue are wakened.
231 Another parameter controls the size of the data buffer used to write data to
232 the audit trail. There is also a parameter that specifies a maximum delay
233 before data is attempted to be written to the audit trail. The audit queue
234 parameters are returned in the \fBau_qctrl\fR structure pointed to by
241 \fB\fBA_SETQCTRL\fR\fR
245 Set the kernel audit queue control parameters as described above in the
246 \fBA_GETQCTRL\fR command. The \fIdata\fR argument points to the \fBau_qctrl\fR
247 structure containing the audit queue control parameters. The default and
248 maximum values 'A/B' for the audit queue control parameters are:
255 \fB100/10000\fR (audit records)
264 \fB10/1024\fR (audit records)
270 \fBoutput buffer size\fR
273 \fB1024/1048576\fR (bytes)
282 \fB20/20000\fR (hundredths second)
294 Return the current working directory as kept by the audit subsystem. This is a
295 path anchored on the real root, rather than on the active root. The \fIdata\fR
296 argument points to a buffer into which the path is copied. The \fIlength\fR
297 argument is the length of the buffer.
307 Return the current active root as kept by the audit subsystem. This path can be
308 used to anchor an absolute path for a path token generated by an application.
309 The \fIdata\fR argument points to a buffer into which the path is copied. The
310 \fIlength\fR argument is the length of the buffer.
316 \fB\fBA_GETSTAT\fR\fR
320 Return the system audit statistics in the \fBaudit_stat\fR structure pointed to
327 \fB\fBA_SETSTAT\fR\fR
331 Reset system audit statistics values. The kernel statistics value is reset if
332 the corresponding field in the statistics structure pointed to by the
333 \fIdata\fR argument is \fBCLEAR_VAL\fR. Otherwise, the value is not changed.
339 \fB\fBA_GETPOLICY\fR\fR
343 Return the audit policy flags in the integer pointed to by \fIdata\fR.
349 \fB\fBA_SETPOLICY\fR\fR
353 Set the audit policy flags to the values in the integer pointed to by
354 \fIdata\fR. The following policy flags are recognized:
358 \fB\fBAUDIT_CNT\fR\fR
362 Do not suspend processes when audit storage is full or inaccessible. The
363 default action is to suspend processes until storage becomes available.
369 \fB\fBAUDIT_AHLT\fR\fR
373 Halt the machine when a non-attributable audit record can not be delivered. The
374 default action is to count the number of events that could not be recorded.
380 \fB\fBAUDIT_ARGV\fR\fR
384 Include in the audit record the argument list for a member of the \fBexec\fR(2)
385 family of functions. The default action is not to include this information.
391 \fB\fBAUDIT_ARGE\fR\fR
395 Include the environment variables for the \fBexecv\fR(2) function in the audit
396 record. The default action is not to include this information.
402 \fB\fBAUDIT_SEQ\fR\fR
406 Add a \fIsequence\fR token to each audit record. The default action is not to
413 \fB\fBAUDIT_TRAIL\fR\fR
417 Append a \fItrailer\fR token to each audit record. The default action is not to
424 \fB\fBAUDIT_GROUP\fR\fR
428 Include the supplementary groups list in audit records. The default action is
435 \fB\fBAUDIT_PATH\fR\fR
439 Include secondary paths in audit records. Examples of secondary paths are
440 dynamically loaded shared library modules and the command shell path for
441 executable scripts. The default action is to include only the primary path from
448 \fB\fBAUDIT_WINDATA_DOWN\fR\fR
452 Include in an audit record any downgraded data moved between windows. This
453 policy is available only if the system is configured with Trusted Extensions.
454 By default, this information is not included.
460 \fB\fBAUDIT_WINDATA_UP\fR\fR
464 Include in an audit record any upgraded data moved between windows. This policy
465 is available only if the system is configured with Trusted Extensions. By
466 default, this information is not included.
472 \fB\fBAUDIT_PERZONE\fR\fR
476 Enable auditing for each local zone. If not set, audit records from all zones
477 are collected in a single log accessible in the global zone and certain
478 \fBauditconfig\fR(1M) operations are disallowed. This policy can be set only
479 from the global zone.
485 \fB\fBAUDIT_ZONENAME\fR\fR
489 Generate a zone ID token with each audit record.
497 Upon successful completion, \fBauditon()\fR returns \fB0\fR. Otherwise, \(mi1
498 is returned and \fBerrno\fR is set to indicate the error.
502 The \fBauditon()\fR function will fail if:
509 The \fIlength\fR field for the command was too small to hold the returned
519 The copy of data to/from the kernel failed.
528 One of the arguments was illegal, Solaris Audit has not been installed, or the
529 operation is not valid from a local zone.
538 The {\fBPRIV_SYS_AUDIT\fR} privilege is not asserted in the effective set of
541 Neither the {\fBPRIV_PROC_AUDIT\fR} nor the {\fBPRIV_SYS_AUDIT\fR} privilege is
542 asserted in the effective set of the calling process and the command is one of
543 \fBA_GETCAR\fR, \fBA_GETCLASS\fR, \fBA_GETCOND\fR, \fBA_GETCWD\fR,
544 \fBA_GETPINFO\fR, \fBA_GETPOLICY\fR.
550 The \fBauditon()\fR function can be invoked only by processes with appropriate
554 The use of \fBauditon()\fR to change system audit state is permitted only in
555 the global zone. From any other zone \fBauditon()\fR returns \(mi1 with
556 \fBerrno\fR set to \fBEPERM\fR. The following \fBauditon()\fR commands are
557 permitted only in the global zone: \fBA_SETCOND\fR, \fBA_SETCLASS\fR,
558 \fBA_SETKMASK\fR, \fBA_SETQCTRL\fR, \fBA_SETSTAT\fR, \fBA_SETFSIZE\fR, and
559 \fBA_SETPOLICY\fR. All other \fBauditon()\fR commands are valid from any zone.
563 See \fBattributes\fR(5) for descriptions of the following attributes:
571 ATTRIBUTE TYPE ATTRIBUTE VALUE
573 Interface Stability Committed
581 \fBauditconfig\fR(1M), \fBauditd\fR(1M), \fBbsmconv\fR(1M), \fBaudit\fR(2),
582 \fBexec\fR(2), \fBaudit.log\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5)
586 The functionality described in this man page is available only if the Solaris
587 Auditing has been enabled. See \fBbsmconv\fR(1M) for more information.
590 The auditon options that modify or display process-based information are not
591 affected by the "perzone" audit policy. Those that modify system audit data
592 such as the terminal ID and audit queue parameters are valid only in the global
593 zone unless the "perzone" policy is set. The "get" options for system audit
594 data reflect the local zone if "perzone" is set; otherwise they reflects the
595 settings of the global zone.