1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
|
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
.\" 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.
.\" 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.
.\" 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]
.TH AUDITON 2 "Apr 6, 2009"
.SH NAME
auditon \- manipulate auditing
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ]
#include <sys/param.h>
#include <bsm/libbsm.h>
\fBint\fR \fBauditon\fR(\fBint\fR \fIcmd\fR, \fBcaddr_t\fR \fIdata\fR, \fBint\fR \fIlength\fR);
.fi
.SH DESCRIPTION
.sp
.LP
The \fBauditon()\fR function performs various audit subsystem control
operations. The \fIcmd\fR argument designates the particular audit control
command. The \fIdata\fR argument is a pointer to command-specific data. The
\fIlength\fR argument is the length in bytes of the command-specific data.
.sp
.LP
The following commands are supported:
.sp
.ne 2
.na
\fB\fBA_GETCOND\fR\fR
.ad
.sp .6
.RS 4n
Return the system audit on/off/disabled condition in the integer pointed to by
\fIdata\fR. The following values can be returned:
.sp
.ne 2
.na
\fB\fBAUC_AUDITING\fR\fR
.ad
.RS 16n
Auditing has been turned on.
.RE
.sp
.ne 2
.na
\fB\fBAUC_DISABLED\fR\fR
.ad
.RS 16n
Auditing system has not been enabled.
.RE
.sp
.ne 2
.na
\fB\fBAUC_NOAUDIT\fR\fR
.ad
.RS 16n
Auditing has been turned off.
.RE
.sp
.ne 2
.na
\fB\fBAUC_NOSPACE\fR\fR
.ad
.RS 16n
Auditing has blocked due to lack of space in audit partition.
.RE
.RE
.sp
.ne 2
.na
\fB\fBA_SETCOND\fR\fR
.ad
.sp .6
.RS 4n
Set the system's audit on/off condition to the value in the integer pointed to
by \fIdata\fR. The Solaris Audit subsystem must be enabled by \fBbsmconv\fR(1M)
before auditing can be turned on. The following audit states can be set:
.sp
.ne 2
.na
\fB\fBAUC_AUDITING\fR\fR
.ad
.RS 16n
Turns on audit record generation.
.RE
.sp
.ne 2
.na
\fB\fBAUC_NOAUDIT\fR\fR
.ad
.RS 16n
Turns off audit record generation.
.RE
.RE
.sp
.ne 2
.na
\fB\fBA_GETCLASS\fR\fR
.ad
.sp .6
.RS 4n
Return the event to class mapping for the designated audit event. The
\fIdata\fR argument points to the \fBau_evclass_map\fR structure containing the
event number. The preselection class mask is returned in the same structure.
.RE
.sp
.ne 2
.na
\fB\fBA_SETCLASS\fR\fR
.ad
.sp .6
.RS 4n
Set the event class preselection mask for the designated audit event. The
\fIdata\fR argument points to the \fBau_evclass_map\fR structure containing the
event number and class mask.
.RE
.sp
.ne 2
.na
\fB\fBA_GETKMASK\fR\fR
.ad
.sp .6
.RS 4n
Return the kernel preselection mask in the \fBau_mask\fR structure pointed to
by \fIdata\fR. This is the mask used to preselect non-attributable audit
events.
.RE
.sp
.ne 2
.na
\fB\fBA_SETKMASK\fR\fR
.ad
.sp .6
.RS 4n
Set the kernel preselection mask. The \fIdata\fR argument points to the
\fBau_mask\fR structure containing the class mask. This is the mask used to
preselect non-attributable audit events.
.RE
.sp
.ne 2
.na
\fB\fBA_GETPINFO\fR\fR
.ad
.sp .6
.RS 4n
Return the audit ID, preselection mask, terminal ID and audit session ID of the
specified process in the \fBauditpinfo\fR structure pointed to by \fIdata\fR.
.sp
Note that \fBA_GETPINFO\fR can fail if the termial ID contains a network
address longer than 32 bits. In this case, the \fBA_GETPINFO_ADDR\fR command
should be used.
.RE
.sp
.ne 2
.na
\fB\fBA_GETPINFO_ADDR\fR\fR
.ad
.sp .6
.RS 4n
Returns the audit ID, preselection mask, terminal ID and audit session ID of
the specified process in the \fBauditpinfo_addr\fR structure pointed to by
\fIdata\fR.
.RE
.sp
.ne 2
.na
\fB\fBA_SETPMASK\fR\fR
.ad
.sp .6
.RS 4n
Set the preselection mask of the specified process. The \fIdata\fR argument
points to the \fBauditpinfo\fR structure containing the process ID and the
preselection mask. The other fields of the structure are ignored and should be
set to \fINULL\fR.
.RE
.sp
.ne 2
.na
\fB\fBA_SETUMASK\fR\fR
.ad
.sp .6
.RS 4n
Set the preselection mask for all processes with the specified audit ID. The
\fIdata\fR argument points to the \fBauditinfo\fR structure containing the
audit ID and the preselection mask. The other fields of the structure are
ignored and should be set to \fINULL\fR.
.RE
.sp
.ne 2
.na
\fB\fBA_SETSMASK\fR\fR
.ad
.sp .6
.RS 4n
Set the preselection mask for all processes with the specified audit session
ID. The \fIdata\fR argument points to the \fBauditinfo\fR structure containing
the audit session \fBID\fR and the preselection mask. The other fields of the
structure are ignored and should be set to \fINULL.\fR
.RE
.sp
.ne 2
.na
\fB\fBA_GETQCTRL\fR\fR
.ad
.sp .6
.RS 4n
Return the kernel audit queue control parameters. These control the high and
low water marks of the number of audit records allowed in the audit queue. The
high water mark is the maximum allowed number of undelivered audit records. The
low water mark determines when threads blocked on the queue are wakened.
Another parameter controls the size of the data buffer used to write data to
the audit trail. There is also a parameter that specifies a maximum delay
before data is attempted to be written to the audit trail. The audit queue
parameters are returned in the \fBau_qctrl\fR structure pointed to by
\fIdata\fR.
.RE
.sp
.ne 2
.na
\fB\fBA_SETQCTRL\fR\fR
.ad
.sp .6
.RS 4n
Set the kernel audit queue control parameters as described above in the
\fBA_GETQCTRL\fR command. The \fIdata\fR argument points to the \fBau_qctrl\fR
structure containing the audit queue control parameters. The default and
maximum values 'A/B' for the audit queue control parameters are:
.sp
.ne 2
.na
\fBhigh water\fR
.ad
.RS 22n
\fB100/10000\fR (audit records)
.RE
.sp
.ne 2
.na
\fBlow water\fR
.ad
.RS 22n
\fB10/1024\fR (audit records)
.RE
.sp
.ne 2
.na
\fBoutput buffer size\fR
.ad
.RS 22n
\fB1024/1048576\fR (bytes)
.RE
.sp
.ne 2
.na
\fBdelay\fR
.ad
.RS 22n
\fB20/20000\fR (hundredths second)
.RE
.RE
.sp
.ne 2
.na
\fB\fBA_GETCWD\fR\fR
.ad
.sp .6
.RS 4n
Return the current working directory as kept by the audit subsystem. This is a
path anchored on the real root, rather than on the active root. The \fIdata\fR
argument points to a buffer into which the path is copied. The \fIlength\fR
argument is the length of the buffer.
.RE
.sp
.ne 2
.na
\fB\fBA_GETCAR\fR\fR
.ad
.sp .6
.RS 4n
Return the current active root as kept by the audit subsystem. This path can be
used to anchor an absolute path for a path token generated by an application.
The \fIdata\fR argument points to a buffer into which the path is copied. The
\fIlength\fR argument is the length of the buffer.
.RE
.sp
.ne 2
.na
\fB\fBA_GETSTAT\fR\fR
.ad
.sp .6
.RS 4n
Return the system audit statistics in the \fBaudit_stat\fR structure pointed to
by \fIdata\fR.
.RE
.sp
.ne 2
.na
\fB\fBA_SETSTAT\fR\fR
.ad
.sp .6
.RS 4n
Reset system audit statistics values. The kernel statistics value is reset if
the corresponding field in the statistics structure pointed to by the
\fIdata\fR argument is \fBCLEAR_VAL\fR. Otherwise, the value is not changed.
.RE
.sp
.ne 2
.na
\fB\fBA_GETPOLICY\fR\fR
.ad
.sp .6
.RS 4n
Return the audit policy flags in the integer pointed to by \fIdata\fR.
.RE
.sp
.ne 2
.na
\fB\fBA_SETPOLICY\fR\fR
.ad
.sp .6
.RS 4n
Set the audit policy flags to the values in the integer pointed to by
\fIdata\fR. The following policy flags are recognized:
.sp
.ne 2
.na
\fB\fBAUDIT_CNT\fR\fR
.ad
.sp .6
.RS 4n
Do not suspend processes when audit storage is full or inaccessible. The
default action is to suspend processes until storage becomes available.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_AHLT\fR\fR
.ad
.sp .6
.RS 4n
Halt the machine when a non-attributable audit record can not be delivered. The
default action is to count the number of events that could not be recorded.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_ARGV\fR\fR
.ad
.sp .6
.RS 4n
Include in the audit record the argument list for a member of the \fBexec\fR(2)
family of functions. The default action is not to include this information.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_ARGE\fR\fR
.ad
.sp .6
.RS 4n
Include the environment variables for the \fBexecv\fR(2) function in the audit
record. The default action is not to include this information.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_SEQ\fR\fR
.ad
.sp .6
.RS 4n
Add a \fIsequence\fR token to each audit record. The default action is not to
include it.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_TRAIL\fR\fR
.ad
.sp .6
.RS 4n
Append a \fItrailer\fR token to each audit record. The default action is not to
include it.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_GROUP\fR\fR
.ad
.sp .6
.RS 4n
Include the supplementary groups list in audit records. The default action is
not to include it.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_PATH\fR\fR
.ad
.sp .6
.RS 4n
Include secondary paths in audit records. Examples of secondary paths are
dynamically loaded shared library modules and the command shell path for
executable scripts. The default action is to include only the primary path from
the system call.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_WINDATA_DOWN\fR\fR
.ad
.sp .6
.RS 4n
Include in an audit record any downgraded data moved between windows. This
policy is available only if the system is configured with Trusted Extensions.
By default, this information is not included.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_WINDATA_UP\fR\fR
.ad
.sp .6
.RS 4n
Include in an audit record any upgraded data moved between windows. This policy
is available only if the system is configured with Trusted Extensions. By
default, this information is not included.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_PERZONE\fR\fR
.ad
.sp .6
.RS 4n
Enable auditing for each local zone. If not set, audit records from all zones
are collected in a single log accessible in the global zone and certain
\fBauditconfig\fR(1M) operations are disallowed. This policy can be set only
from the global zone.
.RE
.sp
.ne 2
.na
\fB\fBAUDIT_ZONENAME\fR\fR
.ad
.sp .6
.RS 4n
Generate a zone ID token with each audit record.
.RE
.RE
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fBauditon()\fR returns \fB0\fR. Otherwise, \(mi1
is returned and \fBerrno\fR is set to indicate the error.
.SH ERRORS
.sp
.LP
The \fBauditon()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBE2BIG\fR\fR
.ad
.RS 10n
The \fIlength\fR field for the command was too small to hold the returned
value.
.RE
.sp
.ne 2
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 10n
The copy of data to/from the kernel failed.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
One of the arguments was illegal, Solaris Audit has not been installed, or the
operation is not valid from a local zone.
.RE
.sp
.ne 2
.na
\fB\fBEPERM\fR\fR
.ad
.RS 10n
The {\fBPRIV_SYS_AUDIT\fR} privilege is not asserted in the effective set of
the calling process.
.sp
Neither the {\fBPRIV_PROC_AUDIT\fR} nor the {\fBPRIV_SYS_AUDIT\fR} privilege is
asserted in the effective set of the calling process and the command is one of
\fBA_GETCAR\fR, \fBA_GETCLASS\fR, \fBA_GETCOND\fR, \fBA_GETCWD\fR,
\fBA_GETPINFO\fR, \fBA_GETPOLICY\fR.
.RE
.SH USAGE
.sp
.LP
The \fBauditon()\fR function can be invoked only by processes with appropriate
privileges.
.sp
.LP
The use of \fBauditon()\fR to change system audit state is permitted only in
the global zone. From any other zone \fBauditon()\fR returns \(mi1 with
\fBerrno\fR set to \fBEPERM\fR. The following \fBauditon()\fR commands are
permitted only in the global zone: \fBA_SETCOND\fR, \fBA_SETCLASS\fR,
\fBA_SETKMASK\fR, \fBA_SETQCTRL\fR, \fBA_SETSTAT\fR, \fBA_SETFSIZE\fR, and
\fBA_SETPOLICY\fR. All other \fBauditon()\fR commands are valid from any zone.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Committed
_
MT-Level MT-Safe
.TE
.SH SEE ALSO
.sp
.LP
\fBauditconfig\fR(1M), \fBauditd\fR(1M), \fBbsmconv\fR(1M), \fBaudit\fR(2),
\fBexec\fR(2), \fBaudit.log\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5)
.SH NOTES
.sp
.LP
The functionality described in this man page is available only if the Solaris
Auditing has been enabled. See \fBbsmconv\fR(1M) for more information.
.sp
.LP
The auditon options that modify or display process-based information are not
affected by the "perzone" audit policy. Those that modify system audit data
such as the terminal ID and audit queue parameters are valid only in the global
zone unless the "perzone" policy is set. The "get" options for system audit
data reflect the local zone if "perzone" is set; otherwise they reflects the
settings of the global zone.
|