2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright 2015, Joyent, Inc. All Rights Reserved
4 .\" Copyright (c) 2017 Peter Tribble
5 .\" 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.
6 .\" 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.
7 .\" 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]
8 .TH AUDITCONFIG 1M "Mar 6, 2017"
10 auditconfig \- configure auditing
14 \fBauditconfig\fR \fIoption\fR...
19 \fBauditconfig\fR provides a command line interface to get and set kernel audit
23 The setting of the \fBperzone\fR policy determines the scope of the audit
24 setting controlled by \fBauditconfig\fR. If \fBperzone\fR is set, then the
25 values reflect the local zone except as noted. Otherwise, the settings are for
26 the entire system. Any restriction based on the \fBperzone\fR setting is noted
27 for each option to which it applies.
30 A non-global zone administrator can set all audit policy options except
31 \fBperzone\fR and \fBahlt\fR. \fBperzone\fR and \fBahlt\fR apply only to the
32 global zone; setting these policies requires the privileges of a global zone
33 administrator. \fBperzone\fR and \fBahlt\fR are described under the
34 \fB-setpolicy\fR option, below.
42 Set the non-attributable audit mask to the value set using the \fb-setnaflags\fR
48 Configured non-attributable event mask.
58 \fB\fB-audit\fR \fIevent\fR \fIsorf\fR \fIretval\fR \fIstring\fR\fR
62 This command constructs an audit record for audit event \fIevent\fR using the
63 process's audit characteristics containing a text token \fIstring\fR. The
64 return token is constructed from the \fIsorf\fR (success/failure flag) and the
65 \fIretval\fR (return value). The event is type \fBchar*\fR, the \fIsorf\fR is
66 0/1 for success/failure, \fIretval\fR is an errno value, \fIstring\fR is type
67 \fB*char\fR. This command is useful for constructing an audit record with a
68 shell script. An example of this option:
72 # auditconfig -audit AUE_ftpd 0 0 "test string"
75 audit record from audit trail:
76 header,76,2,ftp access,,Fri Dec 08 08:44:02 2000, + 669 msec
77 subject,abc,root,other,root,other,104449,102336,235 197121 elbow
93 Checks that the current non-attributable event flags set in the kernel
94 matches the configuration. If the runtime class mask of a
95 kernel audit event does not match the configured class mask, a mismatch is
106 Check the configuration of kernel audit event to class mappings. If the runtime
107 class mask of a kernel audit event does not match the configured class mask, a
108 mismatch is reported.
118 Configure kernel audit event to class mappings. Runtime class mappings are
119 changed to match those in the audit event to class database file.
129 Prints the audit session ID of the current process. For example:
133 # auditconfig -getasid
134 audit session id = 102336
144 \fB\fB-getaudit\fR\fR
148 Returns the audit characteristics of the current process.
152 # auditconfig -getaudit
154 process preselection mask = lo(0x1000,0x1000)
155 terminal id (maj,min,host) = 235,197121,elbow(172.146.89.77)
156 audit session id = 102336
170 Prints the audit ID of the current process. For example:
174 # auditconfig -getauid
189 Prints current active root location (anchored from root [or local zone root] at
190 system boot). For example:
194 # auditconfig -getcar
195 current active root = /
205 \fB\fB-getclass\fR \fIevent\fR\fR
209 Display the preselection mask associated with the specified kernel audit event.
210 \fIevent\fR is the kernel event number or event name.
220 Display the kernel audit condition. The condition displayed is the literal
221 string \fBauditing\fR meaning auditing is enabled and turned on (the kernel
222 audit module is constructing and queuing audit records); \fBnoaudit\fR, meaning
223 auditing is enabled but turned off (the kernel audit module is not constructing
224 and queuing audit records); or \fBnospace\fR, meaning there is no space for
225 saving audit records. See \fBauditon\fR(2) and \fBauditd\fR(1M) for further
236 Prints current working directory (anchored from zone root at system boot). For
242 # auditconfig -getcwd
243 current working directory = /var/tmp
252 \fB\fB-getestate\fR \fIevent\fR\fR
256 For the specified event (string or event number), print out classes \fIevent\fR
257 has been assigned. For example:
261 # auditconfig -getestate 20
262 audit class mask for event AUE_REBOOT(20) = 0x800
263 # auditconfig -getestate AUE_RENAME
264 audit class mask for event AUE_RENAME(42) = 0x30
273 \fB\fB-getflags\fR\fR
277 Display the current active and configured user default audit flags. For
282 # auditconfig -getflags
283 active user default audit flags = no(0x0,0x0)
284 configured user default audit flags = ex,lo(0x40001000,0x40001000)
292 \fB\fB-getkaudit\fR\fR
296 Get audit characteristics of the current zone. For example:
300 # auditconfig -getkaudit
301 audit id = unknown(-2)
302 process preselection mask = lo,na(0x1400,0x1400)
303 terminal id (maj,min,host) = 0,0,(0.0.0.0)
309 If the audit policy \fBperzone\fR is not set, the terminal id is that of the
310 global zone. Otherwise, it is the terminal id of the local zone.
316 \fB\fB-getkmask\fR\fR
320 Get non-attributable pre-selection mask for the current zone. For example:
324 # auditconfig -getkmask
325 audit flags for non-attributable events = lo,na(0x1400,0x1400)
330 If the audit policy \fBperzone\fR is not set, the kernel mask is that of the
331 global zone. Otherwise, it is that of the local zone.
337 \fB\fB-getnaflags\fR\fR
341 Display the current active and configured non-attributable audit flags. For
346 # auditconfig -getnaflags
347 active non-attributable audit flags = no(0x0,0x0)
348 configured non-attributable audit flags = lo(0x1000,0x1000)
356 \fB\fB-getpinfo\fR \fIpid\fR\fR
360 Display the audit ID, preselection mask, terminal ID, and audit session ID for
361 the specified process.
367 \fB\fB-getplugin\fR [\fIplugin\fR]\fR
371 Display the currently installed plugins and their attributes. If \fIplugin\fR is
372 specified, \fB-getplugin\fR only shows information for that \fIplugin\fR. For
377 # auditconfig -getplugin
378 Plugin: audit_binfile (active)
379 Attributes: p_dir=/var/audit;p_fsize=0;p_minfree=0;
381 Plugin: audit_syslog (inactive)
382 Attributes: p_flags=;
384 Plugin: audit_remote (inactive)
385 Attributes: p_hosts=;p_retries=3;p_timeout=5;
393 \fB\fB-getpolicy\fR\fR
397 Display the kernel audit policy. The \fBahlt\fR and \fBperzone\fR policies
398 reflect the settings from the global zone. If \fBperzone\fR is set, all other
399 policies reflect the local zone's settings. If \fBperzone\fR is not set, the
400 policies are machine-wide.
406 \fB\fB-getqbufsz\fR\fR
410 Get audit queue write buffer size. For example:
414 # auditconfig -getqbufsz
415 audit queue buffer size (bytes) = 1024
425 \fB\fB-getqctrl\fR\fR
429 Get audit queue write buffer size, audit queue \fBhiwater\fR mark, audit queue
430 \fBlowater\fR mark, audit queue \fBprod\fR interval (ticks).
434 # auditconfig -getqctrl
435 audit queue hiwater mark (records) = 100
436 audit queue lowater mark (records) = 10
437 audit queue buffer size (bytes) = 1024
438 audit queue delay (ticks) = 20
448 \fB\fB-getqdelay\fR\fR
452 Get interval at which audit queue is prodded to start output. For example:
456 # auditconfig -getqdelay
457 audit queue delay (ticks) = 20
467 \fB\fB-getqhiwater\fR\fR
471 Get high water point in undelivered audit records when audit generation will
476 # auditconfig -getqhiwater
477 audit queue hiwater mark (records) = 100
487 \fB\fB-getqlowater\fR\fR
491 Get low water point in undelivered audit records where blocked processes will
496 # auditconfig -getqlowater
497 audit queue lowater mark (records) = 10
511 Print current audit statistics information. For example:
515 # auditconfig -getstat
516 gen nona kern aud ctl enq wrtn wblk rblk drop tot mem
517 910 1 725 184 0 910 910 0 231 0 88 48
522 See \fBauditstat\fR(1M) for a description of the headings in \fB-getstat\fR
533 Print audit terminal ID for current process. For example:
537 # auditconfig -gettid
538 terminal id (maj,min,host) = 235,197121,elbow(172.146.89.77)
552 Display the currently configured (runtime) kernel and user level audit event
559 \fB\fB-lspolicy\fR\fR
563 Display the kernel audit policies with a description of each policy.
569 \fB\fB-setasid\fR \fIsession-ID\fR [\fIcmd\fR]\fR
573 Execute shell or \fIcmd\fR with specified \fIsession-ID\fR. For example:
577 # auditconfig -setasid 2000 /bin/ksh
579 # auditconfig -getpinfo 104485
581 process preselection mask = lo(0x1000,0x1000)
582 terminal id (maj,min,host) = 235,197121,elbow(172.146.89.77)
583 audit session id = 2000
593 \fB\fB-setaudit\fR \fIaudit-ID\fR \fIpreselect_flags\fR \fIterm-ID\fR
594 \fIsession-ID\fR [\fIcmd\fR]\fR
598 Execute shell or \fIcmd\fR with the specified audit characteristics.
604 \fB\fB-setauid\fR \fIaudit-ID\fR [\fIcmd\fR]\fR
608 Execute shell or \fIcmd\fR with the specified \fIaudit-ID\fR.
614 \fB\fB-setclass\fR \fIevent audit_flag\fR[\fI,audit_flag .\|.\|.\fR]\fR
618 Map the kernel event \fIevent\fR to the classes specified by \fIaudit_flags\fR.
619 \fIevent\fR is an event number or name. An \fIaudit_flag\fR is a two character
620 string representing an audit class. If \fBperzone\fR is not set, this option
621 is valid only in the global zone.
627 \fB\fB-setflags\fR \fIaudit_flags\fR\fR
631 Sets the user default audit flags. For example, to set execute and login
632 auditing for all users:
636 # auditconfig -setflags ex,lo
637 user default audit flags = ex,lo(0x40001000,0x40001000)
645 \fB\fB-setkaudit\fR \fIIP-address_type\fR \fIIP_address\fR\fR
649 Set IP address of machine to specified values. \fIIP-address_type\fR is
650 \fBipv6\fR or \fBipv4\fR.
652 If \fBperzone\fR is not set, this option is valid only in the global zone.
658 \fB\fB-setkmask\fR \fIaudit_flags\fR\fR
662 Set non-attributes selection flags of machine.
664 If \fBperzone\fR is not set, this option is valid only in the global zone.
670 \fB\fB-setnaflags\fR \fIaudit_flags\fR\fR
674 Sets the non-attributable audit flags. For example:
678 # auditconfig -setnaflags lo
679 non-attributable audit flags = lo(0x1000,0x1000)
687 \fB\fB-setplugin\fR \fIname active\fR|\fIinactive\fR [\fIattributes\fR [\fIqsize\fR]]\fR
691 Configures a plugin's attributes. For example:
695 # auditconfig -setplugin audit_syslog active
703 \fB\fB-setpmask\fR \fIpid flags\fR\fR
707 Set the preselection mask of the specified process.
709 If \fBperzone\fR is not set, this option is valid only in the global zone.
716 [\fI+\fR|\fI-\fR]\fIpolicy_flag\fR[\fI,policy_flag ...\fR]\fR
720 Set the kernel audit policy. A policy \fIpolicy_flag\fR is literal strings that
721 denotes an audit policy. A prefix of \fB+\fR adds the policies specified to the
722 current audit policies. A prefix of \fB-\fR removes the policies specified from
723 the current audit policies. No policies can be set from a local zone unless the
724 \fBperzone\fR policy is first set from the global zone. The following are the
725 valid policy flag strings (\fBauditconfig\fR \fB-lspolicy\fR also lists the
726 current valid audit policy flag strings):
733 Include all policies that apply to the current zone.
742 Panic is called and the system dumps core if an asynchronous audit event occurs
743 that cannot be delivered because the audit queue has reached the high-water
744 mark or because there are insufficient resources to construct an audit record.
745 By default, records are dropped and a count is kept of the number of dropped
755 Include the \fBexecv\fR(2) system call environment arguments to the audit
756 record. This information is not included by default.
765 Include the \fBexecv\fR(2) system call parameter arguments to the audit record.
766 This information is not included by default.
775 Do not suspend processes when audit resources are exhausted. Instead, drop
776 audit records and keep a count of the number of records dropped. By default,
777 process are suspended until audit resources become available.
786 Include the supplementary group token in audit records. By default, the group
787 token is not included.
796 Include no policies. If used in other than the global zone, the \fBahlt\fR and
797 \fBperzone\fR policies are not changed.
806 Add secondary path tokens to audit record. These are typically the pathnames of
807 dynamically linked shared libraries or command interpreters for shell scripts.
808 By default, they are not included.
817 Maintain separate configuration, queues, and logs for each zone and execute a
818 separate version of \fBauditd\fR(1M) for each zone.
827 Audit public files. By default, read-type operations are not audited for
828 certain files which meet \fBpublic\fR characteristics: owned by root, readable
829 by all, and not writable by all.
838 Include the trailer token in every audit record. By default, the trailer token
848 Include the sequence token as part of every audit record. By default, the
849 sequence token is not included. The sequence token attaches a sequence number
850 to every audit record.
856 \fB\fBwindata_down\fR\fR
859 Include in an audit record any downgraded data moved between windows. This
860 policy is available only if the system is configured with Trusted Extensions.
861 By default, this information is not included.
867 \fB\fBwindata_up\fR\fR
870 Include in an audit record any upgraded data moved between windows. This policy
871 is available only if the system is configured with Trusted Extensions. By
872 default, this information is not included.
881 Include the \fBzonename\fR token as part of every audit record. By default, the
882 \fBzonename\fR token is not included. The \fBzonename\fR token gives the name
883 of the zone from which the audit record was generated.
891 \fB\fB-setqbufsz\fR \fIbuffer_size\fR\fR
895 Set the audit queue write buffer size (bytes).
901 \fB\fB-setqctrl\fR \fIhiwater\fR \fIlowater\fR \fIbufsz\fR \fIinterval\fR\fR
905 Set the audit queue write buffer size (bytes), hiwater audit record count,
906 lowater audit record count, and wakeup interval (ticks). Valid within a local
907 zone only if \fBperzone\fR is set.
913 \fB\fB-setqdelay\fR \fIinterval\fR\fR
917 Set the audit queue wakeup interval (ticks). This determines the interval at
918 which the kernel pokes the audit queue, to write audit records to the audit
919 trail. Valid within a local zone only if \fBperzone\fR is set.
925 \fB\fB-setqhiwater\fR \fIhiwater\fR\fR
929 Set the number of undelivered audit records in the audit queue at which audit
930 record generation blocks. Valid within a local zone only if \fBperzone\fR is
937 \fB\fB-setqlowater\fR \fIlowater\fR\fR
941 Set the number of undelivered audit records in the audit queue at which blocked
942 auditing processes unblock. Valid within a local zone only if \fBperzone\fR is
949 \fB\fB-setsmask\fR \fIasid flags\fR\fR
953 Set the preselection mask of all processes with the specified audit session ID.
954 Valid within a local zone only if \fBperzone\fR is set.
964 Reset audit statistics counters. Valid within a local zone only if
965 \fBperzone\fR is set.
971 \fB\fB-setumask\fR \fIauid flags\fR\fR
975 Set the preselection mask of all processes with the specified audit ID. Valid
976 within a local zone only if \fBperzone\fR is set.
981 \fBExample 1 \fRUsing \fBauditconfig\fR
984 The following is an example of an \fBauditconfig\fR program:
990 # map kernel audit event number 10 to the "fr" audit class
992 % auditconfig -setclass 10 fr
995 # turn on inclusion of exec arguments in exec audit records
997 % auditconfig -setpolicy +argv
1008 Successful completion.
1023 \fB\fB/etc/security/audit_event\fR\fR
1026 Stores event definitions used in the audit system.
1032 \fB\fB/etc/security/audit_class\fR\fR
1035 Stores class definitions used in the audit system.
1040 See \fBattributes\fR(5) for descriptions of the following attributes:
1048 ATTRIBUTE TYPE ATTRIBUTE VALUE
1050 Interface Stability Committed
1055 \fBaudit\fR(1M), \fBauditd\fR(1M), \fBauditstat\fR(1M),
1056 \fBpraudit\fR(1M), \fBauditon\fR(2), \fBexecv\fR(2), \fBaudit_class\fR(4),
1057 \fBaudit_event\fR(4), \fBattributes\fR(5),
1058 \fBaudit_binfile\fR(5), \fBaudit_remote\fR(5), \fBaudit_syslog\fR(5)
1061 If the \fBaudit_remote\fR or \fBaudit_syslog\fR plugins are active, the
1062 behavior of the system with respect to the \fB-setpolicy\fR \fB+cnt\fR and the
1063 \fB-setqhiwater\fR options is modified slightly. If \fB-setpolicy\fR \fB+cnt\fR
1064 is set, data will continue to be sent to the selected plugin, even though
1065 output to the binary audit log is stopped, pending the freeing of disk space.
1066 If \fB-setpolicy\fR \fB-cnt\fR is used, the blocking behavior is as described
1067 under OPTIONS, above. The value set for the queue high water mark is used
1068 within \fBauditd\fR as the default value for its queue limits unless overridden
1069 by means of the \fBqsize\fR attribute.
1072 The \fBauditconfig\fR options that modify or display process-based information
1073 are not affected by the \fBperzone\fR policy. Those that modify system audit
1074 data such as the terminal id and audit queue parameters are valid only in the
1075 global zone, unless the \fBperzone\fR policy is set. The display of a system
1076 audit reflects the local zone if \fBperzone\fR is set. Otherwise, it reflects
1077 the settings of the global zone.
1080 The \fB-setcond\fR option has been removed. Use \fBaudit\fR(1M) to enable or
1084 The \fB-getfsize\fR and \fB-setfsize\fR options have been removed. Use
1085 \fBaudit_binfile\fR(5) \fBp_fsize\fR to set the audit file size.