<?Pub UDT _bookmark _target?><?Pub CX solbook(?><chapter id="auditref-1"><?Pub Tag atict:info tracking="off" ref="0"?><?Pub Tag atict:user user="sharonr" fullname="Sharon Veach"?><?Pub Tag atict:user
user="kathys" fullname="Kathy Slattery"?><title>Solaris Auditing (Reference)</title><highlights><itemizedlist><para>This chapter describes the important components of Solaris auditing.
The following is a list of the reference information in this chapter.</para><listitem><para><olink targetptr="auditref-36" remap="internal">Audit Commands</olink></para>
</listitem><listitem><para><olink targetptr="auditref-13" remap="internal">Files Used in the Auditing
Service</olink></para>
</listitem><listitem><para><olink targetptr="auditref-22" remap="internal">Rights Profiles for Administering
Auditing</olink></para>
</listitem><listitem><para><olink targetptr="auditref-28" remap="internal">Auditing and Solaris Zones</olink></para>
</listitem><listitem><para><olink targetptr="auditref-48" remap="internal">Audit Classes</olink></para>
</listitem><listitem><para><olink targetptr="auditref-74" remap="internal">Audit Policy</olink></para>
</listitem><listitem><para><olink targetptr="auditref-55" remap="internal">Process Audit Characteristics</olink></para>
</listitem><listitem><para><olink targetptr="auditref-75" remap="internal">Audit Trail</olink></para>
</listitem><listitem><para><olink targetptr="auditref-77" remap="internal">Conventions for Binary Audit
File Names</olink></para>
</listitem><listitem><para><olink targetptr="auditref-20" remap="internal">Audit Record Structure</olink></para>
</listitem><listitem><para><olink targetptr="aparecord-11" remap="internal">Audit Token Formats</olink></para>
</listitem>
</itemizedlist><para>For an overview of Solaris auditing, see <olink targetptr="auditov-1" remap="internal">Chapter&nbsp;28, Solaris Auditing (Overview)</olink>. For planning suggestions, see <olink targetptr="auditplan-1" remap="internal">Chapter&nbsp;29, Planning for Solaris Auditing</olink>.
For procedures to configure auditing at your site, see <olink targetptr="audittask-1" remap="internal">Chapter&nbsp;30, Managing Solaris Auditing (Tasks)</olink>.</para>
</highlights><sect1 id="auditref-36"><title>Audit Commands</title><indexterm><primary>commands</primary><secondary>auditing commands</secondary>
</indexterm><itemizedlist><para>This section provides information about the following commands:</para><listitem><para><olink targetptr="auditref-14" remap="internal">auditd Daemon</olink></para>
</listitem><listitem><para><olink targetptr="auditref-3" remap="internal">audit Command</olink></para>
</listitem><listitem><para><olink targetptr="auditref-56" remap="internal">bsmrecord Command</olink></para>
</listitem><listitem><para><olink targetptr="auditref-11" remap="internal">auditreduce Command</olink></para>
</listitem><listitem><para><olink targetptr="auditref-76" remap="internal">praudit Command</olink></para>
</listitem><listitem><para><olink targetptr="auditref-18" remap="internal">auditconfig Command</olink></para>
</listitem>
</itemizedlist><sect2 id="auditref-14"><title><command>auditd</command> Daemon</title><indexterm><primary><command>auditd</command> daemon</primary><secondary>audit trail creation</secondary>
</indexterm><indexterm><primary><command>auditd</command> daemon</primary><secondary>functions</secondary>
</indexterm><indexterm><primary>creating</primary><secondary>audit trail</secondary><tertiary><command>auditd</command> daemon's role</tertiary>
</indexterm><indexterm><primary>daemons</primary><secondary><command>auditd</command></secondary>
</indexterm><para>The following list summarizes what the <command>auditd</command> daemon
does.</para><itemizedlist><listitem><para>The <command>auditd</command> daemon opens and closes audit
files in the directories that are specified in the <filename>audit_control</filename> file.
The files are opened in order.</para>
</listitem><listitem><para>The <command>auditd</command> daemon loads one or more plugins.
Sun provides two plugins. The <command>/lib/security/audit_binfile.so.1</command> plugin
writes binary audit data to a file. The <command>/lib/security audit_syslog.so.1</command> plugin
sends text summaries of audit records to the <command>syslogd</command> daemon.</para>
</listitem><listitem><para>The <command>auditd</command> daemon reads audit data from
the kernel and outputs the data by using an <command>auditd</command> plugin.</para>
</listitem><listitem><para><indexterm><primary><command>auditd</command> daemon</primary><secondary><filename>audit_warn</filename> script</secondary><tertiary>execution of</tertiary></indexterm><indexterm><primary><filename>audit_warn</filename> script</primary><secondary><command>auditd</command> daemon execution of</secondary></indexterm><indexterm><primary>configuration files</primary><secondary><filename>audit_control</filename> file</secondary></indexterm>The <command>auditd</command> daemon
executes the <filename>audit_warn</filename> script to warn of configuration
errors. The <command>binfile.so.1</command> plugin executes the <filename>audit_warn</filename> script. The script, by default, sends warnings to the <command>audit_warn</command> email alias and to the console. The <command>syslog.so.1</command> plugin
does not execute the <filename>audit_warn</filename> script.</para>
</listitem><listitem><para><indexterm><primary>audit trail</primary><secondary>creating</secondary><tertiary><command>auditd</command> daemon's role</tertiary></indexterm><indexterm><primary>directories</primary><secondary><command>auditd</command> daemon pointer</secondary></indexterm>By default, when all audit directories are
full, processes that generate audit records are suspended. In addition, the <command>auditd</command> daemon writes a message to the console and to the <command>audit_warn</command> email alias. At this point, only the system administrator can fix
the auditing service. The administrator can log in to write audit files to
offline media, delete audit files from the system, and do other cleanup tasks.</para><para>The audit policy can be reconfigured with the <command>auditconfig</command> command.</para>
</listitem>
</itemizedlist><para><indexterm><primary>log files</primary><secondary>space for audit records</secondary></indexterm>The <command>auditd</command> daemon can be started automatically
when the system is brought up to multiuser mode. Or, you can start the daemon
from the command line. When the <command>auditd</command> daemon is started,
it calculates the amount of free space necessary for audit files.</para><para><indexterm><primary>audit records</primary><secondary>audit directories full</secondary></indexterm><indexterm><primary>directories</primary><secondary>audit directories full</secondary></indexterm><indexterm><primary>errors</primary><secondary>audit directories full</secondary></indexterm><indexterm><primary><command>audit</command> command</primary><secondary>resetting directory pointer (<option>n</option> option)</secondary></indexterm><indexterm><primary><option>s</option> option</primary><secondary><command>audit</command> command</secondary></indexterm><indexterm><primary><command>audit</command> command</primary><secondary>rereading audit files (<option>s</option> option)</secondary></indexterm><indexterm><primary>audit files</primary><secondary>switching to new file</secondary></indexterm><indexterm><primary><option>n</option> option</primary><secondary><command>audit</command> command</secondary></indexterm><indexterm><primary>directories</primary><secondary><command>auditd</command> daemon pointer</secondary></indexterm>The <command>auditd</command> daemon
uses the list of audit directories in the <filename>audit_control</filename> file
as possible locations for creating audit files. The daemon maintains a pointer
into this list of directories, starting with the first directory. Every time
the <command>auditd</command> daemon needs to create an audit file, the daemon
puts the file into the first available directory in the list. The list starts
at the <command>auditd</command> daemon's current pointer. You can reset the
pointer to the beginning of the list by running the <command>audit</command> <option>s</option> command. The <command>audit</command> <option>n</option> command
instructs the daemon to switch to a new audit file. The new file is created
in the same directory as the current file.</para>
</sect2><sect2 id="auditref-3"><title><command>audit</command> Command</title><indexterm><primary><command>audit</command> command</primary><secondary>description</secondary>
</indexterm><itemizedlist><para>The <command>audit</command> command controls the actions of the <command>auditd</command> daemon. The <command>audit</command> command can do the following
tasks:</para><listitem><para>Enable and disable auditing</para>
</listitem><listitem><para>Reset the <command>auditd</command> daemon</para>
</listitem><listitem><para><indexterm><primary>administering</primary><secondary>auditing</secondary><tertiary>process preselection mask</tertiary></indexterm><indexterm><primary>preselection mask (auditing)</primary><secondary>reducing storage costs</secondary></indexterm><indexterm><primary>audit characteristics</primary><secondary>process preselection mask</secondary></indexterm>Adjust the auditing preselection
mask on the local system</para>
</listitem><listitem><para>Write audit records to a different audit file</para>
</listitem>
</itemizedlist><para>For a discussion of the available options, see the <olink targetdoc="group-refman" targetptr="audit-1m" remap="external"><citerefentry><refentrytitle>audit</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-56"><title><command>bsmrecord</command> Command</title><indexterm><primary>audit records</primary><secondary>displaying formats of</secondary><tertiary>summary</tertiary>
</indexterm><indexterm><primary><command>bsmrecord</command> command</primary><secondary>description</secondary>
</indexterm><para>The <command>bsmrecord</command> command displays the format of audit
events that are defined in the <filename class="directory">/etc/security/audit_event</filename> file. The output includes the event's audit ID, audit class, audit
flag, and the record's audit tokens in order. With no option, the <command>bsmrecord</command> output displays in a terminal window. With the <option>h</option> option,
the output is suitable for viewing in a browser. For examples of the use of
the <command>bsmrecord</command> command, see <olink targetptr="audittask-10" remap="internal">How
to Display Audit Record Formats</olink>. Also, see the <olink targetdoc="group-refman" targetptr="bsmrecord-1m" remap="external"><citerefentry><refentrytitle>bsmrecord</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-11"><title><command>auditreduce</command> Command</title><para><indexterm><primary>audit files</primary><secondary><command>auditreduce</command> command</secondary></indexterm><indexterm><primary>audit files</primary><secondary>combining</secondary></indexterm><indexterm><primary>audit files</primary><secondary>reducing</secondary></indexterm><indexterm><primary><command>auditreduce</command> command</primary></indexterm><indexterm><primary><command>auditreduce</command> command</primary><secondary>description</secondary></indexterm><indexterm><primary>combining audit files</primary><secondary><command>auditreduce</command> command</secondary></indexterm><indexterm><primary>reducing</primary><secondary>audit files</secondary></indexterm><indexterm><primary>size of audit files</primary><secondary>reducing</secondary></indexterm>The <command>auditreduce</command> command summarizes audit records
that are stored in binary format. The command can merge audit records from
one or more input audit files. The command can also be used to perform a post
selection of audit records. The records remain in binary format. To merge
the entire audit trail, run this command on the audit server. The audit server
is the system that mounts all the audit file systems for the installation.
For more information, see the <olink targetdoc="group-refman" targetptr="auditreduce-1m" remap="external"><citerefentry><refentrytitle>auditreduce</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para><para><indexterm><primary>log files</primary><secondary>examining audit records</secondary></indexterm>The <command>auditreduce</command> command enables you to track
all audited actions on multiple systems from a single location. The command
can read the logical combination of all audit files as a single audit trail.
You must identically configure all systems at a site for auditing, and create
servers and local directories for the audit files. The <command>auditreduce</command> command
ignores how the records were generated or where the records are stored. Without
options, the <command>auditreduce</command> command merges audit records from
all the audit files in all of the subdirectories in the audit root directory.
Typically, <filename>/etc/security/audit</filename> is the audit root directory.
The <command>auditreduce</command> command sends the merged results to standard
output. You can also place the results into a single, chronologically ordered
output file. The file contains binary data.</para><para>The <command>auditreduce</command> command can also select particular
types of records for analysis. The merging functions and selecting functions
of the <command>auditreduce</command> command are logically independent. The <command>auditreduce</command> command captures data from the input files as the records
are read, before the files are merged and then written to disk.</para><itemizedlist><para><indexterm><primary><command>auditreduce</command> command</primary><secondary>options</secondary></indexterm>By specifying options to the <command>auditreduce</command> command, you can also do the following:</para><listitem><para>Request audit records that were generated by specified audit
classes</para>
</listitem><listitem><para>Request audit records that were generated by one particular
user</para>
</listitem><listitem><para>Request audit records that were generated on specific dates</para>
</listitem>
</itemizedlist><para><indexterm><primary>audit trail</primary><secondary>merging all files</secondary></indexterm><indexterm><primary><command>auditreduce</command> command</primary><secondary>without options</secondary></indexterm><indexterm><primary>audit directory</primary><secondary>sample structure</secondary></indexterm>With
no arguments, the <command>auditreduce</command> command checks the subdirectories
within the <filename class="directory">/etc/security/audit</filename> directory,
the default audit root directory. The command checks for a <filename class="directory">files</filename> directory in which the <replaceable>start-time.end-time.hostname</replaceable> files reside. The <command>auditreduce</command> command is
very useful when audit data resides in separate directories. <olink targetptr="auditref-fig-2" remap="internal">Figure&nbsp;31&ndash;1</olink> illustrates audit data
in separate directories for different hosts. <olink targetptr="auditref-fig-3" remap="internal">Figure&nbsp;31&ndash;2</olink> illustrates audit data in separate directories for different
audit servers.</para><figure id="auditref-fig-2"><title>Audit Trail Storage Sorted by Host</title><mediaobject><imageobject><imagedata entityref="trailbyh.epsi"/>
</imageobject><textobject><simpara>Diagram shows a default audit root directory whose top
directory names are host names.</simpara>
</textobject>
</mediaobject>
</figure><figure id="auditref-fig-3"><title>Audit Trail Storage Sorted by Server</title><mediaobject><imageobject><imagedata entityref="trailbys.epsi"/>
</imageobject><textobject><simpara>Diagram shows a default audit root directory whose top
directory names are server names.</simpara>
</textobject>
</mediaobject>
</figure><para>If the partition for the <filename class="directory">/etc/security/audit</filename> directory
is very small, you might not store audit data in the default directory. You
can pass the <command>auditreduce</command> command another directory by using
the <option>R</option> option:</para><screen># auditreduce -R /var/<replaceable>audit-alt</replaceable> </screen><para>You can also specify a particular subdirectory by using the <option>S</option> option:</para><screen># auditreduce -S /var/<replaceable>audit-alt</replaceable>/<replaceable>host1</replaceable> </screen><para>For other options and more examples, see the <olink targetdoc="group-refman" targetptr="auditreduce-1m" remap="external"><citerefentry><refentrytitle>auditreduce</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-76"><title><command>praudit</command> Command</title><para><indexterm><primary><command>praudit</command> command</primary><secondary>output formats</secondary></indexterm><indexterm><primary><command>praudit</command> command</primary><secondary>options</secondary></indexterm><indexterm><primary>analysis</primary><secondary><command>praudit</command> command</secondary></indexterm><indexterm><primary>audit records</primary><secondary>converting to readable format</secondary></indexterm><indexterm><primary>audit trail</primary><secondary>analysis with <command>praudit</command> command</secondary></indexterm><indexterm><primary><command>praudit</command> command</primary><secondary>converting audit records to readable format</secondary></indexterm><indexterm><primary>readable audit record format</primary><secondary>converting audit records to</secondary></indexterm><indexterm><primary>audit records</primary><secondary>converting to readable format</secondary></indexterm><indexterm><primary>converting</primary><secondary>audit records to readable format</secondary></indexterm>The <command>praudit</command> command makes the binary output
of the <command>auditreduce</command> command readable. The <command>praudit</command> command
reads audit records in binary format from standard input and displays the
records in a presentable format. The input can be piped from the <command>auditreduce</command> command or from a single audit file. Input can also be produced
with the <command>cat</command> command to concatenate several files, or the <command>tail</command> command for a current audit file.</para><para><indexterm><primary><option>l</option> option</primary><secondary><command>praudit</command> command</secondary></indexterm><indexterm><primary><option>d</option> option</primary><secondary><command>praudit</command> command</secondary></indexterm>The <command>praudit</command> command can generate four output formats. A fifth option, <option>l</option> (long), prints one audit record per line of output. The default
is to place one audit token per line of output. The <option>d</option> option
changes the delimiter that is used between token fields and between tokens.
The default delimiter is a comma.</para><itemizedlist><listitem><para><indexterm><primary><command>praudit</command> command</primary><secondary>with no options</secondary></indexterm><emphasis role="strong">Default &ndash;</emphasis> The <command>praudit</command> command with no options displays
one audit token per line. The command displays the audit event by its description,
such as the <literal>ioctl(2)</literal> system call. Any value that can be
displayed as text is displayed in text format. For example, a user is displayed
as the user name, not as the user ID.</para>
</listitem><listitem><para><indexterm><primary>raw <command>praudit</command> output format</primary></indexterm><indexterm><primary><option>r</option> option</primary><secondary><command>praudit</command> command</secondary></indexterm><emphasis role="strong">&ndash;r option &ndash;</emphasis> The raw option displays as
a number any value that could be numeric. For example, a user is displayed
by user ID, Internet addresses are in hexadecimal format, and modes are in
octal format. The audit event is displayed as its event number, such as <literal>158</literal>.</para>
</listitem><listitem><para><indexterm><primary>short <command>praudit</command> output format</primary></indexterm><indexterm><primary><option>s</option> option</primary><secondary><command>praudit</command> command</secondary></indexterm><emphasis role="strong">&ndash;s option &ndash;</emphasis> The short option displays
the audit event by its table name, for example, <literal>AUE_IOCTL</literal>.
The option displays the other tokens as the default option displays them.</para>
</listitem><listitem><para><indexterm><primary><option>x</option> option</primary><secondary><command>praudit</command> command</secondary></indexterm><indexterm><primary>XML option</primary><secondary><command>praudit</command> command</secondary></indexterm><indexterm><primary>viewing</primary><secondary>XML audit records</secondary></indexterm><emphasis role="strong">&ndash;x option &ndash;</emphasis> The
XML option displays the audit record in XML format. This option is useful
as input to browsers, or as input to scripts that manipulate XML.</para><para><indexterm><primary><filename class="directory">/usr/share/lib/xml</filename> directory</primary></indexterm><indexterm><primary><command>praudit</command> command</primary><secondary>DTD for <option>x</option> option</secondary></indexterm><indexterm><primary>DTD for <command>praudit</command> command</primary></indexterm>The
XML is described by a DTD that the auditing service provides. Solaris software
also provides a style sheet. The DTD and the style sheet are in the <filename class="directory">/usr/share/lib/xml</filename> directory.</para>
</listitem>
</itemizedlist><para>In the default output format of the <command>praudit</command> command,
each record is easily identified as a sequence of audit tokens. Each token
is presented on a separate line. Each record begins with a <command>header</command> token.
You could, for example, further process the output with the <command>awk</command> command.</para><para><indexterm><primary>defaults</primary><secondary><command>praudit</command> output format</secondary></indexterm>Here is the output from the <command>praudit</command> <option>l</option> command for a <command>header</command> token:</para><screen>header,173,2,settppriv(2),,example1,2003-10-13 13:46:02.174 -07:00</screen><para><indexterm><primary>defaults</primary><secondary><command>praudit</command> output format</secondary></indexterm>Here is the output from the <command>praudit</command> <option>r</option> command for the same <command>header</command> token:</para><screen>121,173,2,289,0x0000,192.168.86.166,1066077962,174352445</screen><example id="auditref-946"><title>Processing <command>praudit</command> Output
With a Script</title><indexterm><primary>scripts</primary><secondary>processing <command>praudit</command> output</secondary>
</indexterm><indexterm><primary><command>praudit</command> command</primary><secondary>use in a script</secondary>
</indexterm><para>You might want to process output from the <command>praudit</command> command
as lines of text. For example, you might want to select records that the <command>auditreduce</command> command cannot select. You can use a simple shell script
to process the output of the <command>praudit</command> command. The following
simple example script puts one audit record on one line, searches for a user-specified
string, then returns the audit file to its original form.</para><screen>#!/bin/sh
#
## This script takes an argument of a user-specified string.
#  The sed command prefixes the header tokens with Control-A
#  The first tr command puts the audit tokens for one record 
#  onto one line while preserving the line breaks as Control-A
#
praudit | sed -e '1,2d' -e '$s/^file.*$//' -e 's/^header/^aheader/' \\
| tr '\\012\\001' '\\002\\012' \\
| grep "$1" \\ <lineannotation>Finds the user-specified string</lineannotation>
| tr '\\002' '\\012' <lineannotation>Restores the original newline breaks</lineannotation></screen><para>Note that the <literal>^a</literal> in the script is <keysym>Control-A</keysym>,
not the two characters <literal>^</literal> and <literal>a</literal>. The
prefix distinguishes the <literal>header</literal> token from the string <literal>header</literal> that might appear as text.</para>
</example>
</sect2><sect2 id="auditref-18"><title><command>auditconfig</command> Command</title><indexterm><primary><command>auditconfig </command> command</primary><secondary>description</secondary>
</indexterm><indexterm><primary>configuring</primary><secondary><command>auditconfig</command> command</secondary>
</indexterm><itemizedlist><para>The <command>auditconfig</command> command provides a command-line interface
to retrieve and set audit configuration parameters. The <filename>auditconfig</filename> command
can do the following tasks:</para><listitem><para>Display, check, and configure audit policy</para>
</listitem><listitem><para>Determine if auditing is turned on or turned off</para>
</listitem><listitem><para>Turn auditing off and turn auditing on</para>
</listitem><listitem><para>Manage the audit directory and the audit file</para>
</listitem><listitem><para>Manage the audit queue</para>
</listitem><listitem><para>Get and set preselection masks</para>
</listitem><listitem><para>Get and set audit event to audit class mappings</para>
</listitem><listitem><para>Get and set configuration information, such as session ID
and audit ID</para>
</listitem><listitem><para>Configure audit characteristics for a process, a shell, and
a session</para>
</listitem><listitem><para>Reset audit statistics</para>
</listitem>
</itemizedlist><para>For a discussion of the command options, see the <olink targetdoc="group-refman" targetptr="auditconfig-1m" remap="external"><citerefentry><refentrytitle>auditconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2>
</sect1><sect1 id="auditref-13"><title>Files Used in the Auditing Service</title><itemizedlist><para>The auditing service uses the following files:</para><listitem><para><olink targetptr="auditref-6" remap="internal">system File</olink></para>
</listitem><listitem><para><olink targetptr="auditref-7" remap="internal">syslog.conf File</olink></para>
</listitem><listitem><para><olink targetptr="auditref-10" remap="internal">audit_class File</olink></para>
</listitem><listitem><para><olink targetptr="auditref-12" remap="internal">audit_control File</olink></para>
</listitem><listitem><para><olink targetptr="auditref-16" remap="internal">audit_event File</olink></para>
</listitem><listitem><para><olink targetptr="auditref-46" remap="internal">audit_startup Script</olink></para>
</listitem><listitem><para><olink targetptr="auditref-17" remap="internal">audit_user Database</olink></para>
</listitem><listitem><para><olink targetptr="auditref-25" remap="internal">audit_warn Script</olink></para>
</listitem><listitem><para><olink targetptr="auditref-19" remap="internal">bsmconv Script</olink></para>
</listitem>
</itemizedlist><sect2 id="auditref-6"><title><filename>system</filename> File</title><indexterm><primary>scripts</primary><secondary><command>bsmconv</command> effect</secondary>
</indexterm><indexterm><primary><filename>system</filename> file</primary><secondary><command>bsmconv</command> effect on</secondary>
</indexterm><indexterm><primary><filename>/etc/system</filename> file</primary>
</indexterm><indexterm><primary>configuration files</primary><secondary><filename>system</filename> file</secondary>
</indexterm><para>The <filename>/etc/system</filename> file contains commands that the
kernel reads during initialization to customize the system operations. The <command>bsmconv</command> and <command>bsmunconv</command> shell scripts, which are
used to activate and deactivate auditing, modify the <filename>/etc/system</filename> file.
The <command>bsmconv</command> shell script adds the following line to the <filename>/etc/system</filename> file:</para><screen>set c2audit:audit_load=1</screen><para><indexterm><primary><literal>c2audit:audit_load</literal> entry</primary><secondary><filename>system</filename> file</secondary></indexterm>The <command>set
c2audit:audit_load=1</command> entry causes the kernel module for auditing
to be loaded when the system is booted. The <command>bsmunconv</command> shell
script disables auditing when the system is rebooted. The command removes
the <filename>c2audit</filename> line from the <filename>/etc/system</filename> file.</para>
</sect2><sect2 id="auditref-7"><title><filename>syslog.conf</filename> File</title><indexterm><primary>log files</primary><secondary><literal>syslog</literal> audit records</secondary>
</indexterm><indexterm><primary><filename>syslog.conf</filename> file</primary><secondary>and auditing</secondary>
</indexterm><indexterm><primary><filename>/etc/syslog.conf</filename> file</primary><secondary>auditing and</secondary>
</indexterm><indexterm><primary>configuration files</primary><secondary><filename>syslog.conf</filename> file</secondary>
</indexterm><indexterm><primary><literal>syslog</literal> format</primary><secondary>audit records</secondary>
</indexterm><indexterm><primary>files</primary><secondary><literal>syslog.conf</literal> file</secondary>
</indexterm><para>The <filename>/etc/syslog.conf</filename> file works with the <filename>audit_control</filename> file to store audit records in text format. The <filename>syslog.conf</filename> file can be configured to enable the <filename>syslog</filename> utility
to store audit records. For an example, see <olink targetptr="audittask-11" remap="internal">How
to Configure syslog Audit Logs</olink>.</para>
</sect2><sect2 id="auditref-10"><title><filename>audit_class</filename> File</title><indexterm><primary>configuration files</primary><secondary><filename>audit_class</filename> file</secondary>
</indexterm><indexterm><primary>audit_class<filename></filename> file</primary><secondary>description<filename></filename> file</secondary>
</indexterm><para>The <filename>/etc/security/audit_class</filename> file defines the
audit classes. Audit classes are groups of audit events. You use the class
name in the <filename>audit_control</filename> file to preselect the classes
whose events you want to audit. The classes accept prefixes to select only
failed events or only successful events. For more information, see <olink targetptr="auditref-51" remap="internal">Audit Class Syntax</olink>.</para><para>The superuser, or an administrator in an equivalent role, can modify
the definitions of audit classes. This administrator can define new audit
classes, rename existing classes, or otherwise change existing classes by
editing the <filename>audit_class</filename> file in a text editor. For more
information, see the <olink targetdoc="group-refman" targetptr="audit-class-4" remap="external"><citerefentry><refentrytitle>audit_class</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-12"><title><filename>audit_control</filename> File</title><para><indexterm><primary><filename>audit_control</filename> file</primary><secondary>description</secondary></indexterm><indexterm><primary>configuration files</primary><secondary><filename>audit_control</filename> file</secondary></indexterm><indexterm><primary>audit configuration file</primary><see><filename>audit_control</filename> file</see></indexterm>The <filename>/etc/security/audit_control</filename> file on each system contains configuration information for the <command>auditd</command> daemon. The file enables every system to mount a remote audit
file system to store their audit records.</para><para>You can specify five kinds of information in the <filename>audit_control</filename> file.
Each line of information begins with a keyword.</para><itemizedlist><listitem><para><indexterm><primary>audit classes</primary><secondary>entries in <filename>audit_control</filename> file</secondary></indexterm><indexterm><primary><filename>audit_control</filename> file</primary><secondary>entries</secondary></indexterm><indexterm><primary><literal>flags</literal> line</primary><secondary><filename>audit_control</filename> file</secondary></indexterm><indexterm><primary>audit classes</primary><secondary>system-wide</secondary></indexterm><indexterm><primary>mask (auditing)</primary><secondary>system-wide process preselection</secondary></indexterm><indexterm><primary>preselection mask (auditing)</primary><secondary>system-wide</secondary></indexterm><literal>flags</literal> <emphasis role="strong">keyword &ndash;</emphasis> Begins the entry that preselects
which classes of events are audited for all users on the system. The audit
classes that are specified here determine the <emphasis>system-wide audit
preselection mask</emphasis>. The audit classes are separated by commas.</para>
</listitem><listitem><para><indexterm><primary><literal>naflags</literal> line</primary><secondary><filename>audit_control</filename> file</secondary></indexterm><indexterm><primary>nonattributable classes</primary></indexterm><literal>naflags</literal> <emphasis role="strong">keyword &ndash;</emphasis> Begins the entry that preselects
which classes of events are audited when an action cannot be attributed to
a specific user. The audit classes are separated by commas. The <literal>na</literal> event
class belongs in this entry. The <literal>naflags</literal> entry can be used
to log other event classes that are normally attributable but cannot be attributed.
For example, if a program that starts at boot reads a file, then an <literal>fr</literal> in
the <literal>naflags</literal> entry would create a record for that event.</para>
</listitem><listitem><para><indexterm><primary>audit files</primary><secondary>minimum free space for file systems</secondary></indexterm><indexterm><primary>audit threshold</primary></indexterm><indexterm><primary><literal>minfree</literal> line</primary><secondary><filename>audit_control</filename> file</secondary></indexterm><indexterm><primary>soft limit</primary><secondary><literal>minfree</literal> line description</secondary></indexterm><literal>minfree</literal> <emphasis role="strong">keyword &ndash;</emphasis> Begins the entry that defines the
minimum free-space level for all audit file systems. The <literal>minfree</literal> percentage
must be equal to <literal>0</literal> or greater than <literal>0</literal>.
The default is 20 percent. When an audit file system is 80 percent full, the
audit data is then stored in the next available audit directory. For more
information, see the <olink targetdoc="group-refman" targetptr="audit-warn-1m" remap="external"><citerefentry><refentrytitle>audit_warn</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</listitem><listitem><para><indexterm><primary><literal>dir</literal> line</primary><secondary><filename>audit_control</filename> file</secondary></indexterm><indexterm><primary>directories</primary><secondary><filename>audit_control</filename> file definitions</secondary></indexterm><indexterm><primary><command>auditd</command> daemon</primary><secondary>order audit files are opened</secondary></indexterm><indexterm><primary>audit files</primary><secondary>order for opening</secondary></indexterm><indexterm><primary><command>auditd</command> daemon</primary><secondary>order audit files are opened</secondary></indexterm><indexterm><primary>primary audit directory</primary></indexterm><indexterm><primary>secondary audit directory</primary></indexterm><literal>dir</literal> <emphasis role="strong">keyword &ndash;</emphasis> Begins the <emphasis>directory definition</emphasis> lines. Each line defines an audit file system and directory that
the system uses to store its audit files. You can define one or more directory
definition lines. The order of the <literal>dir</literal> lines is significant.
The <command>auditd</command> daemon creates audit files in the directories
in the specified order. The first directory is the <emphasis>primary audit
directory</emphasis> for the system. The second directory is the <emphasis>secondary
audit directory</emphasis> where the <command>auditd</command> daemon creates
audit files when the first directory becomes full, and so on. For more information,
see the <olink targetdoc="group-refman" targetptr="audit-1m" remap="external"><citerefentry><refentrytitle>audit</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</listitem><listitem><para><indexterm><primary>audit logs</primary><secondary>in text</secondary></indexterm><indexterm><primary><literal>plugin</literal> line</primary><secondary><filename>audit_control</filename> file</secondary></indexterm><literal>plugin</literal> <emphasis role="strong">keyword &ndash;</emphasis> Specifies
the <emphasis>plugin path</emphasis> and the audit classes for the <command>syslog</command> plugin module. The module provides real-time conversion of Solaris
audit records to text. The audit classes in the <literal>plugin</literal> line
must be a subset of the audit classes in the <literal>flags</literal> line
and the <literal>naflags</literal> line.</para>
</listitem>
</itemizedlist><para>For more information about the <filename>audit_control</filename> file,
see the <olink targetdoc="group-refman" targetptr="audit-control-4" remap="external"><citerefentry><refentrytitle>audit_control</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para><example id="auditref-47"><title>Sample <filename>audit_control</filename> File</title><para><indexterm><primary>naming conventions</primary><secondary>audit directories</secondary></indexterm><indexterm><primary><filename>audit_control</filename> file</primary><secondary>examples</secondary></indexterm>The following is a sample <filename>audit_control</filename> file for the system <literal>noddy</literal>. <literal>noddy</literal> uses two audit file systems on the audit server <literal>blinken</literal>,
and a third audit file system that is mounted from the second audit server <command>winken</command>. The third file system is used only when the audit file systems
on <literal>blinken</literal> become full or unavailable. The <literal>minfree</literal> value
of 20 percent specifies that the warning script is run when the file systems
are 80 percent full. The settings specify that logins and administrative operations
are to be audited. The operations are audited for success and for failure.
Failures of all types, except failures to create a file system object, are
to be audited. Nonattributable events are also audited. The <filename>syslog</filename> audit
log records fewer audit events. This log contains text summaries of failed
logins and failed administrative operations.</para><screen>flags:lo,am,-all,^-fc
naflags:lo,nt
minfree:20
dir:/etc/security/audit/blinken/files
dir:/etc/security/audit/blinken.1/files
#
# Audit filesystem used when blinken fills up
#
dir:/etc/security/audit/winken
plugin:name=audit_syslog.so.1; p_flags=-lo,-am</screen>
</example>
</sect2><sect2 id="auditref-16"><title><filename>audit_event</filename> File</title><indexterm><primary>configuration files</primary><secondary><filename>audit_event</filename> file</secondary>
</indexterm><para>The <filename>/etc/security/audit_event</filename> file contains the
default audit event-class mappings. You can edit this file to change the class
mappings. When you change class mappings, you must reboot the system or run
the <command>auditconfig -conf</command> command to read the changed mappings
into the kernel. For more information, see the <olink targetdoc="group-refman" targetptr="audit-event-4" remap="external"><citerefentry><refentrytitle>audit_event</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-46"><title><filename>audit_startup</filename> Script</title><indexterm><primary><command>audit_startup</command> script</primary><secondary>description</secondary>
</indexterm><indexterm><primary>automatically enabling auditing</primary>
</indexterm><indexterm><primary><filename>/etc/security/audit_startup</filename> file</primary>
</indexterm><indexterm><primary>defaults</primary><secondary><filename>audit_startup</filename> script</secondary>
</indexterm><indexterm><primary>scripts</primary><secondary><filename>audit_startup</filename> script</secondary>
</indexterm><indexterm><primary>configuration files</primary><secondary><filename>audit_startup</filename> script</secondary>
</indexterm><itemizedlist><para>The <filename>/etc/security/audit_startup</filename> script automatically
configures the auditing service when the system enters multiuser mode. The <command>auditd</command> daemon starts after the script performs the following tasks:</para><listitem><para>Configures the audit event-class mappings</para>
</listitem><listitem><para>Sets the audit policy options</para>
</listitem>
</itemizedlist><para>For more information, see the <olink targetdoc="group-refman" targetptr="audit-startup-1m" remap="external"><citerefentry><refentrytitle>audit_startup</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-17"><title><filename>audit_user</filename> Database</title><indexterm><primary>configuration files</primary><secondary><filename>audit_user</filename> database</secondary>
</indexterm><indexterm><primary>databases</primary><secondary><filename>audit_user</filename></secondary>
</indexterm><indexterm><primary>audit classes</primary><secondary>exceptions in <filename>audit_user</filename> database</secondary>
</indexterm><indexterm><primary><filename>audit_user</filename> database</primary><secondary>user audit fields</secondary>
</indexterm><indexterm><primary>user audit fields</primary><secondary><filename>audit_user</filename> database</secondary>
</indexterm><indexterm><primary><filename>audit_control</filename> file</primary><secondary>exceptions in <filename>audit_user</filename> database</secondary>
</indexterm><itemizedlist><para>The <filename>/etc/security/audit_user</filename> database modifies
the system-wide preselected classes for an individual user. The classes that
you add to a user's entry in the <filename>audit_user</filename> database
modify the settings in the <filename>audit_control</filename> file in two
ways:</para><listitem><para>By specifying audit classes that are always to be audited
for this user</para>
</listitem><listitem><para>By specifying audit classes that are never to be audited for
this user</para>
</listitem>
</itemizedlist><para>Each user entry in the <filename>audit_user</filename> database contains
three fields:</para><screen><replaceable>username</replaceable>:<replaceable>always-audit-classes</replaceable>:<replaceable>never-audit-classes</replaceable></screen><para><indexterm><primary>always-audit classes</primary><secondary><filename>audit_user</filename> database</secondary></indexterm>The audit fields are processed
in sequence. The <replaceable>always-audit-classes</replaceable> field turns
on the auditing of the classes in that field. The <replaceable>never-audit-classes</replaceable> field turns off the auditing of the classes in that field.</para><note><para><indexterm><primary><literal>all</literal></primary><secondary>in user audit fields</secondary></indexterm>Avoid the common mistake of placing
the <literal>all</literal> audit class in the <replaceable>never-audit-classes</replaceable> field.
This mistake causes all auditing to be turned off for that user, which overrides
the settings in the <replaceable>always-audit-classes</replaceable> field.
The setting also overrides system-wide audit class settings in the <filename>audit_control</filename> file.</para>
</note><para><indexterm><primary>never-audit classes</primary><secondary><filename>audit_user</filename> database</secondary></indexterm>The <replaceable>never-audit-classes</replaceable> settings
for a user override the system defaults. You might not want to override system
defaults. For example, suppose you want to audit everything for user <literal>tamiko</literal>, except for successful reads of file system objects. You also want
to apply the system defaults to <literal>tamiko</literal>. Note the placement
of the second colon (<literal>:</literal>) in the following <filename>audit_user</filename> entries:</para><screen>tamiko:all,^+fr:  <lineannotation>correct entry</lineannotation></screen><para>The correct entry means, &ldquo;always audit everything, except for
successful file-reads.&rdquo;</para><screen>tamiko:all:+fr    <lineannotation>incorrect entry</lineannotation></screen><para>The incorrect entry means, &ldquo;always audit everything, but never
audit successful file-reads.&rdquo; The <replaceable>never-audit-classes</replaceable> field,
which follows the second colon, overrides the system defaults. In the correct
entry, the <replaceable>always-audit-classes</replaceable> field includes
the exception to the <literal>all</literal> audit class. Because no audit
class is in the <replaceable>never-audit-classes</replaceable> field, the
system defaults from the <filename>audit_control</filename> file are not overridden.</para><note><para>Successful events and failed events are treated separately. A
process could generate more audit records for failed events than for successful
events.</para>
</note>
</sect2><sect2 id="auditref-25"><title><filename>audit_warn</filename> Script</title><para><indexterm><primary><filename>audit_warn</filename> script</primary><secondary>description</secondary></indexterm><indexterm><primary>scripts</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm><indexterm><primary><filename>/etc/security/audit_warn</filename> script</primary></indexterm><indexterm><primary><command>auditd</command> daemon</primary><secondary><filename>audit_warn</filename> script</secondary><tertiary>description</tertiary></indexterm>The <filename>/etc/security/audit_warn</filename> script
notifies an email alias when the <command>auditd</command> daemon encounters
an unusual condition while writing audit records. You can customize this script
for your site to warn of conditions that might require manual intervention.
Or, you could specify how to handle those conditions automatically. For all
error conditions, the <literal>audit_warn</literal> script writes a message
to <filename>syslog</filename> with the severity of <literal>daemon.alert</literal>.
You can use <command>syslog.conf</command> to configure console display of <filename>syslog</filename> messages. The <literal>audit_warn</literal> script also
sends a message to the <literal>audit_warn</literal> email alias. You should
set up this alias when you enable auditing.</para><para><indexterm><primary><command>auditd</command> daemon</primary><secondary><filename>audit_warn</filename> script</secondary><tertiary>description</tertiary></indexterm><indexterm><primary><filename>audit_warn</filename> script</primary><secondary>conditions invoking</secondary></indexterm>When the <command>auditd</command> daemon
detects the following conditions, the daemon invokes the <filename>audit_warn</filename> script.
The script sends email to the <literal>audit_warn</literal> alias.</para><itemizedlist><listitem><para><indexterm><primary>soft limit</primary><secondary><filename>audit_warn</filename> condition</secondary></indexterm><indexterm><primary><literal>minfree</literal> line</primary><secondary><filename>audit_warn</filename> condition</secondary></indexterm>An audit directory has become more full than the <option role="nodash">minfree</option> value allows. The <option role="nodash">minfree</option> value
or soft limit is a percentage of the available space on an audit file system.</para><para><indexterm><primary><filename>audit_control</filename> file</primary><secondary><literal>minfree</literal> warning</secondary></indexterm><indexterm><primary>soft string</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm>The <filename>audit_warn</filename> script is invoked with the
string <option role="nodash">soft</option> and the name of the directory whose
available space is below the minimum value. The <command>auditd</command> daemon
switches automatically to the next suitable directory. The daemon writes the
audit files in this new directory until the directory reaches its <literal>minfree</literal> limit. The <command>auditd</command> daemon then goes to each remaining
directory in the order that is listed in the <filename>audit_control</filename> file.
The daemon writes audit records until each directory is at its <literal>minfree</literal> limit.</para>
</listitem><listitem><para><indexterm><primary><literal>allsoft</literal> string</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm>All
the audit directories have reached the <option role="nodash">minfree</option> threshold.</para><para>The <filename>audit_warn</filename> script is invoked with the
string <option role="nodash">allsoft</option>. A message is written to the
console. Email is also sent to the <literal>audit_warn</literal> alias.</para><para>When all audit directories that are listed in the <filename>audit_control</filename> file
have reached their <literal>minfree</literal> threshold, the <command>auditd</command> daemon
switches back to the first directory. The daemon writes audit records until
the directory becomes completely full.</para>
</listitem><listitem><para><indexterm><primary>hard string</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm>An audit directory has become completely
full with no space remaining.</para><para>The <filename>audit_warn</filename> script
is invoked with the string <option role="nodash">hard</option> and the name
of the directory. A message is written to the console. Email is also sent
to the <literal>audit_warn</literal> alias.</para><para>The <command>auditd</command> daemon
switches automatically to the next suitable directory with any space available.
The <command>auditd</command> daemon goes to each remaining directory in the
order that is listed in the <filename>audit_control</filename> file. The daemon
writes audit records until each directory is full.</para>
</listitem><listitem><para><indexterm><primary><literal>allhard</literal> string</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm><indexterm><primary>audit records</primary><secondary>audit directories full</secondary></indexterm><indexterm><primary><filename>audit_warn</filename> script</primary><secondary>strings</secondary></indexterm><indexterm><primary>directories</primary><secondary>audit directories full</secondary></indexterm>All the audit directories
are completely full. The <filename>audit_warn</filename> script is invoked
with the string <option role="nodash">allhard</option> as an argument.</para><para>By default, a message is written to the console. Email is also sent
to the <literal>audit_warn</literal> alias. Processes that would otherwise
generate audit records continue to occur, but audit records are counted. Audit
records are not generated. For an example of how to handle this situation,
see <olink targetptr="audittask-90" remap="internal">Example&nbsp;30&ndash;14</olink> and <olink targetptr="audittask-83" remap="internal">How to Prevent Audit Trail Overflow</olink>.</para>
</listitem><listitem><itemizedlist><para><indexterm><primary>errors</primary><secondary>audit directories full</secondary></indexterm><indexterm><primary>errors</primary><secondary>internal errors</secondary></indexterm>An internal error occurs. Possible internal errors include the
following:</para><listitem><para><indexterm><primary><literal>ebusy</literal> string</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm><literal>ebusy</literal> &ndash; Another <command>auditd</command> daemon process is
already running</para>
</listitem><listitem><para><indexterm><primary>tmpfile string</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm><literal>tmpfile</literal> &ndash;
A temporary file cannot be used</para>
</listitem><listitem><para><indexterm><primary>ending</primary><secondary>signal received during auditing shutdown</secondary></indexterm><indexterm><primary>postsigterm string</primary><secondary><filename>audit_warn</filename> script</secondary></indexterm><indexterm><primary>signal received during auditing shutdown</primary></indexterm><indexterm><primary>terminating</primary><secondary>signal received during auditing shutdown</secondary></indexterm><literal>postsigterm</literal> &ndash;
A signal was received during auditing shutdown</para>
</listitem>
</itemizedlist>
</listitem><listitem><para><indexterm><primary><filename>audit_control</filename> file</primary><secondary>syntax problem</secondary></indexterm>A problem is discovered with
the syntax of the <filename>audit_control</filename> file. By default, a message
is sent to the console. Email is also sent to the <literal>audit_warn</literal> alias.</para>
</listitem>
</itemizedlist><para>For further information, see the <olink targetdoc="group-refman" targetptr="audit-warn-1m" remap="external"><citerefentry><refentrytitle>audit_warn</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-19"><title><filename>bsmconv</filename> Script</title><para><indexterm><primary><command>bsmconv</command> script</primary><secondary>description</secondary></indexterm><indexterm><primary>scripts</primary><secondary><command>bsmconv</command> script</secondary></indexterm><indexterm><primary><filename>/etc/security/bsmconv</filename> script</primary><secondary>description</secondary></indexterm>The <filename>/etc/security/bsmconv</filename> script enables the auditing service. The <command>bsmunconv</command> command disables the auditing service. After the <command>bsmconv</command> script is run, you configure the audit directories and audit configuration
files. Upon reboot, auditing is enabled.</para><para>For further information, see the <olink targetdoc="group-refman" targetptr="bsmconv-1m" remap="external"><citerefentry><refentrytitle>bsmconv</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2>
</sect1><sect1 id="auditref-22"><title>Rights Profiles for Administering
Auditing</title><indexterm><primary>auditing</primary><secondary>rights profiles for</secondary>
</indexterm><indexterm><primary>rights profiles</primary><secondary sortas="auditing">for auditing service</secondary>
</indexterm><para>The Solaris OS provides rights profiles for configuring the auditing service
and for analyzing the audit trail.</para><itemizedlist><listitem><para><indexterm><primary>Audit Control rights profile</primary></indexterm><emphasis role="strong">Audit Control &ndash;</emphasis> Enables
a role to configure Solaris auditing. This rights profile grants authorizations
to configure files that are used by the auditing service. The profile also
enables a role to run audit commands. A role with the Audit Control profile
can run the following commands: <command>audit</command>, <command>auditd</command>, <command>auditconfig</command>, <command>bsmconv</command>, and <command>bsmunconv</command>.</para>
</listitem><listitem><para><indexterm><primary>Audit Review rights profile</primary></indexterm><emphasis role="strong">Audit Review &ndash;</emphasis> Enables
a role to analyze Solaris audit records. This rights profile grants authorization
to read audit records with the <command>praudit</command> and <command>auditreduce</command> commands. A role with this rights profile can also run the <command>auditstat</command> command.</para>
</listitem><listitem><para><indexterm><primary>RBAC</primary><secondary>audit profiles</secondary></indexterm><emphasis role="strong">System Administrator &ndash;</emphasis> Includes
the Audit Review rights profile. A role with the System Administrator rights
profile can analyze audit records.</para>
</listitem>
</itemizedlist><para>To configure roles to handle the auditing service, see <olink targetptr="rbactask-15" remap="internal">Configuring RBAC (Task Map)</olink>.</para>
</sect1><sect1 id="auditref-28"><title>Auditing and Solaris Zones</title><indexterm><primary>administering</primary><secondary>auditing</secondary><tertiary sortas="zones">in zones</tertiary>
</indexterm><indexterm><primary>managing</primary><secondary>auditing in zones</secondary>
</indexterm><indexterm><primary>auditing</primary><secondary>zones and</secondary>
</indexterm><indexterm><primary>configuring</primary><secondary>auditing in zones</secondary>
</indexterm><indexterm><primary>audit policy</primary><secondary>setting in global zone</secondary>
</indexterm><indexterm><primary>zones</primary><secondary>auditing and</secondary>
</indexterm><indexterm><primary>zones</primary><secondary><literal>perzone</literal> audit policy</secondary>
</indexterm><indexterm><primary>zones</primary><secondary><literal>zonename</literal> audit policy</secondary>
</indexterm><indexterm><primary><literal>perzone</literal> audit policy</primary><secondary>using</secondary>
</indexterm><indexterm><primary><literal>zonename</literal> audit policy</primary><secondary>using</secondary>
</indexterm><indexterm><primary><filename>audit_control</filename> file</primary><secondary>entries and zones</secondary>
</indexterm><para>Non-global zones can be audited exactly as the global zone is audited,
or nonglobal zones can set their own flags, storage, and audit policy.</para><para>When all zones are being audited identically, the configuration files
in the global zone provide the settings for auditing in every zone. The <option role="plus">zonename</option> policy option is useful. When this option is
set, the audit records from all zones include the name of the zone. Audit
records can then be postselected by zone name. To understand audit policy,
see <olink targetptr="auditplan-5" remap="internal">Determining Audit Policy</olink>. For an
example, see <olink targetptr="audittask-18" remap="internal">How to Configure Audit Policy</olink>.</para><para><indexterm><primary>audit events</primary><secondary>selecting from audit trail in zones</secondary></indexterm><indexterm><primary>audit trail</primary><secondary>viewing events from different zones</secondary></indexterm><indexterm><primary>combining audit files</primary><secondary>from different zones</secondary></indexterm>Zones can also be audited individually. When the policy option, <literal>perzone</literal>, is set in the global zone, each non-global zone runs its
own audit daemon, handles its own audit queue, and specifies the content and
location of its audit records. A non-global zone can also set most audit policy
options. It cannot set policy that affects the entire system, so a non-global
zone cannot set the <literal>ahlt</literal> or <literal>perzone</literal> policy.
For further discussion, see <olink targetptr="auditov-8" remap="internal">Auditing on a System
With Zones</olink> and <olink targetptr="auditplan-10" remap="internal">How to Plan Auditing
in Zones</olink>.</para><para>To learn about zones, see <olink targetdoc="group-sa" targetptr="zone" remap="external">Part&nbsp;II, <citetitle remap="chapter">Zones,</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>.</para>
</sect1><sect1 id="auditref-48"><title>Audit Classes</title><para><indexterm><primary>administering</primary><secondary>auditing</secondary><tertiary>audit classes</tertiary></indexterm><indexterm><primary>audit classes</primary><secondary>setting system-wide</secondary></indexterm><indexterm><primary>defaults</primary><secondary>system-wide auditing</secondary></indexterm>System-wide
defaults for Solaris auditing are preselected by specifying one or more classes
of events. The classes are preselected for each system in the system's <filename>audit_control</filename> file. Anyone who uses the system is audited for these
classes of events. The file is described in <olink targetptr="auditref-12" remap="internal">audit_control
File</olink>.</para><para>You can configure audit classes and make new audit classes. Audit class
names can be up to 8 characters in length. The class description is limited
to 72 characters. Numeric and non-alphanumeric characters are allowed.</para><para><indexterm><primary><command>auditconfig</command> command</primary><secondary>audit classes as arguments</secondary></indexterm>You can modify
what is audited for individual users by adding audit classes to a user's entry
in the <command>audit_user</command> database. The audit classes are also
used as arguments to the <command>auditconfig</command> command. For details,
see the <olink targetdoc="group-refman" targetptr="auditconfig-1m" remap="external"><citerefentry><refentrytitle>auditconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para><sect2 id="auditref-49"><title>Definitions of Audit Classes</title><para><indexterm><primary>administering</primary><secondary>auditing</secondary><tertiary>audit classes</tertiary></indexterm><indexterm><primary>audit classes</primary><secondary>definitions</secondary></indexterm><indexterm><primary>names</primary><secondary>audit classes</secondary></indexterm>The following table shows
each predefined audit class, the descriptive name for each audit class, and
a short description.</para><table frame="topbot" id="auditref-tbl-2"><title>Predefined Audit Classes</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="1*"/><colspec colnum="2" colname="column2" colwidth="2*"/><colspec colnum="3" colname="column3" colwidth="5*"/><thead><row rowsep="1"><entry><para>Audit Class</para>
</entry><entry><para>Descriptive Name</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>all</command></para>
</entry><entry><para><indexterm><primary><literal>all</literal> audit class</primary><secondary>description</secondary></indexterm><command>all</command></para>
</entry><entry><para>All classes (meta-class)</para>
</entry>
</row><row><entry><para><command>no</command></para>
</entry><entry><para><indexterm><primary><literal>no_class</literal> audit class</primary></indexterm><command>no_class</command></para>
</entry><entry><para><indexterm><primary><literal>null</literal> audit class</primary></indexterm>Null value for turning off event preselection</para>
</entry>
</row><row><entry><para><command>na</command></para>
</entry><entry><para><indexterm><primary><literal>non_attrib</literal> audit class</primary></indexterm><command>non_attrib</command></para>
</entry><entry><para>Nonattributable events</para>
</entry>
</row><row><entry><para><command>fr</command></para>
</entry><entry><para><indexterm><primary><literal>file_read audit</literal> class</primary></indexterm><command>file_read</command></para>
</entry><entry><para>Read of data, open for reading</para>
</entry>
</row><row><entry><para><command>fw</command></para>
</entry><entry><para><indexterm><primary><literal>file_write</literal> audit class</primary></indexterm><command>file_write</command></para>
</entry><entry><para>Write of data, open for writing</para>
</entry>
</row><row><entry><para><command>fa</command></para>
</entry><entry><para><indexterm><primary><literal>file_attr_acc</literal> audit class</primary></indexterm><command>file_attr_acc</command></para>
</entry><entry><para>Access of object attributes: <command>stat</command>, <command>pathconf</command></para>
</entry>
</row><row><entry><para><command>fm</command></para>
</entry><entry><para><indexterm><primary><literal>file_attr_mod</literal> audit class</primary></indexterm><command>file_attr_mod</command></para>
</entry><entry><para>Change of object attributes: <command>chown</command>, <command>flock</command></para>
</entry>
</row><row><entry><para><command>fc</command></para>
</entry><entry><para><indexterm><primary><literal>file_creation</literal> audit class</primary></indexterm><command>file_creation</command></para>
</entry><entry><para>Creation of object</para>
</entry>
</row><row><entry><para><command>fd</command></para>
</entry><entry><para><indexterm><primary><literal>file_deletion</literal> audit class</primary></indexterm><command>file_deletion</command></para>
</entry><entry><para>Deletion of object</para>
</entry>
</row><row><entry><para><command>cl</command></para>
</entry><entry><para><indexterm><primary><literal>file_close</literal> audit class</primary></indexterm><command>file_close</command></para>
</entry><entry><para><indexterm><primary>system calls</primary><secondary><command>close</command></secondary></indexterm><command>close</command> system call</para>
</entry>
</row><row><entry><para><command>ap</command></para>
</entry><entry><para><indexterm><primary><literal>application</literal> audit class</primary></indexterm><command>application</command></para>
</entry><entry><para>Application-defined event</para>
</entry>
</row><row><entry><para><command>ad</command></para>
</entry><entry><para><indexterm><primary><literal>administrative (old)</literal> audit class</primary></indexterm><command>administrative</command></para>
</entry><entry><para>Administrative actions (old administrative meta-class)</para>
</entry>
</row><row><entry><para><command>am</command></para>
</entry><entry><para><indexterm><primary><literal>administrative</literal> audit class</primary></indexterm><command>administrative</command></para>
</entry><entry><para>Administrative actions (meta-class)</para>
</entry>
</row><row><entry><para><command>ss</command></para>
</entry><entry><para><indexterm><primary><literal>system state</literal> audit class</primary></indexterm><command>system state</command></para>
</entry><entry><para>Change system state</para>
</entry>
</row><row><entry><para><command>as</command></para>
</entry><entry><para><indexterm><primary><literal>system-wide administration</literal> audit class</primary></indexterm><command>system-wide administration</command></para>
</entry><entry><para>System-wide administration</para>
</entry>
</row><row><entry><para><command>ua</command></para>
</entry><entry><para><indexterm><primary><literal>user administration</literal> audit class</primary></indexterm><command>user administration</command></para>
</entry><entry><para>User administration</para>
</entry>
</row><row><entry><para><command>aa</command></para>
</entry><entry><para><indexterm><primary><literal>audit administration</literal> audit class</primary></indexterm><command>audit administration</command></para>
</entry><entry><para>Audit utilization</para>
</entry>
</row><row><entry><para><command>ps</command></para>
</entry><entry><para><indexterm><primary><literal>process start</literal> audit class</primary></indexterm><command>process start</command></para>
</entry><entry><para>Process start and process stop</para>
</entry>
</row><row><entry><para><command>pm</command></para>
</entry><entry><para><indexterm><primary><literal>process modify</literal> audit class</primary></indexterm><command>process modify</command></para>
</entry><entry><para>Process modify</para>
</entry>
</row><row><entry><para><command>pc</command></para>
</entry><entry><para><indexterm><primary><literal>process</literal> audit class</primary></indexterm><command>process</command></para>
</entry><entry><para>Process (meta-class)</para>
</entry>
</row><row><entry><para><command>ex</command></para>
</entry><entry><para><indexterm><primary><literal>exec</literal> audit class</primary></indexterm><command>exec</command></para>
</entry><entry><para>Program execution</para>
</entry>
</row><row><entry><para><command>io</command></para>
</entry><entry><para><indexterm><primary><literal>ioctl</literal> audit class</primary></indexterm><command>ioctl</command></para>
</entry><entry><para><indexterm><primary>system calls</primary><secondary><function>ioctl</function></secondary></indexterm><indexterm><primary><function>ioctl</function> system calls</primary></indexterm><function>ioctl</function> system call</para>
</entry>
</row><row><entry><para><literal>ip</literal></para>
</entry><entry><para><indexterm><primary><literal>ipc</literal> audit class</primary></indexterm><command>ipc</command></para>
</entry><entry><para><indexterm><primary>System V IPC</primary><secondary><literal>ipc</literal> audit class</secondary></indexterm>System V IPC operations</para>
</entry>
</row><row><entry><para><command>lo</command></para>
</entry><entry><para><indexterm><primary><literal>login_logout</literal> audit class</primary></indexterm><command>login_logout</command></para>
</entry><entry><para>Login and logout events</para>
</entry>
</row><row><entry><para><command>nt</command></para>
</entry><entry><para><indexterm><primary><literal>network</literal> audit class</primary></indexterm><command>network</command></para>
</entry><entry><para>Network events: <command>bind</command>, <command>connect</command>, <command>accept</command></para>
</entry>
</row><row><entry><para><command>ot</command></para>
</entry><entry><para><indexterm><primary><literal>other</literal> audit class</primary></indexterm><command>other</command></para>
</entry><entry><para>Miscellaneous, such as device allocation and <function>memcntl</function></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>You can define new classes by modifying the <filename>/etc/security/audit_class</filename> file. You can also rename existing classes. For more information,
see the <olink targetdoc="group-refman" targetptr="audit-class-4" remap="external"><citerefentry><refentrytitle>audit_class</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="auditref-51"><title>Audit Class Syntax</title><para><indexterm><primary>audit classes</primary><secondary>syntax</secondary></indexterm><indexterm><primary>+ (plus sign)</primary><secondary>audit class prefix</secondary></indexterm><indexterm><primary>- (minus sign)</primary><secondary>audit class prefix</secondary></indexterm><indexterm><primary>audit classes</primary><secondary>prefixes</secondary></indexterm><indexterm><primary>minus sign (-)</primary><secondary>audit class prefix</secondary></indexterm><indexterm><primary>plus sign (+)</primary><secondary>audit class prefix</secondary></indexterm><indexterm><primary>prefixes for audit classes</primary></indexterm><indexterm><primary>failure</primary><secondary>audit class prefix</secondary></indexterm><indexterm><primary>success</primary><secondary>audit class prefix</secondary></indexterm>Events
can be audited for success, events can be audited for failure, and events
can be audited for both. Without a prefix, a class of events is audited for
success and for failure. With a plus (<literal>+</literal>) prefix, a class
of events is audited for success only. With a minus (<literal>-</literal>)
prefix, a class of events is audited for failure only. The following table
shows some possible representations of audit classes.</para><table frame="topbot" id="auditref-tbl-3"><title>Plus and Minus Prefixes to
Audit Classes</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="1.24*"/><colspec colnum="2" colname="column2" colwidth="4.76*"/><thead><row rowsep="1"><entry><para><literal>[</literal><replaceable>prefix</replaceable><literal>]</literal><replaceable>class</replaceable></para>
</entry><entry><para>Explanation</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>lo</literal></para>
</entry><entry><para>Audit all successful attempts to log in and log out, and all failed
attempts to log in. A user cannot fail an attempt to log out.</para>
</entry>
</row><row><?PubTbl row rht="0.56in"?><entry><para><literal>+lo</literal></para>
</entry><entry><para>Audit all successful attempts to log in and log out.</para>
</entry>
</row><row><entry><para><literal>-all</literal></para>
</entry><entry><para>Audit all failed events.</para>
</entry>
</row><row><entry><para><literal>+all</literal></para>
</entry><entry><para>Audit all successful events.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><caution><para><indexterm><primary><literal>all</literal> audit class</primary><secondary>caution for using</secondary></indexterm><indexterm><primary>audit classes</primary><secondary>syntax</secondary></indexterm>The <literal>all</literal> class
can generate large amounts of data and quickly fill audit file systems. Use
the <literal>all</literal> class only if you have extraordinary reasons to
audit all activities.</para>
</caution><para><indexterm><primary><literal>^</literal> (caret) in audit class prefixes</primary></indexterm><indexterm><primary>caret (<literal>^</literal>) in audit class prefixes</primary></indexterm><indexterm><primary><command>auditconfig</command> command</primary><secondary>prefixes for classes</secondary></indexterm><indexterm><primary><filename>audit_control</filename> file</primary><secondary>prefixes in <literal>flags</literal> line</secondary></indexterm><indexterm><primary><filename>audit_user</filename> database</primary><secondary>prefixes for classes</secondary></indexterm><indexterm><primary>failure</primary><secondary>turning off audit classes for</secondary></indexterm>Audit classes that were previously selected
can be further modified by a caret prefix, <literal>^</literal>. The following
table shows how the caret prefix modifies a preselected audit class.</para><table frame="topbot" id="auditref-tbl-4"><title>Caret Prefix That Modifies
Already-Specified Audit Classes</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="1.70*"/><colspec colnum="2" colname="column2" colwidth="6.30*"/><thead><row rowsep="1"><entry><para><literal>^</literal>[<replaceable>prefix</replaceable>]<replaceable>class</replaceable></para>
</entry><entry><para>Explanation</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>-all,^-fc</literal></para>
</entry><entry><para>Audit all failed events, except do not audit failed attempts to create
file objects</para>
</entry>
</row><row><entry><para><literal>am,^+aa</literal></para>
</entry><entry><para><indexterm><primary>success</primary><secondary>turning off audit classes for</secondary></indexterm>Audit all administrative events for success and
for failure, except do not audit successful attempts to administer auditing</para>
</entry>
</row><row><entry><para><literal>am,^ua</literal></para>
</entry><entry><para>Audit all administrative events for success and for failure, except
do not audit user administration events</para>
</entry>
</row>
</tbody>
</tgroup>
</table><itemizedlist><para>The audit classes and their prefixes can be used in the following files
and commands:</para><listitem><para>In the <literal>flags</literal> line in the <filename>audit_control</filename> file</para>
</listitem><listitem><para>In the <literal>plugin ...p_flags=</literal> line in the <filename>audit_control</filename> file</para>
</listitem><listitem><para>In the user's entry in the <filename>audit_user</filename> database</para>
</listitem><listitem><para>As arguments to <command>auditconfig</command> command options</para>
</listitem>
</itemizedlist><para>See <olink targetptr="auditref-12" remap="internal">audit_control File</olink> for an
example of using the prefixes in the <filename>audit_control</filename> file.</para>
</sect2>
</sect1><sect1 id="auditref-74"><title>Audit Policy</title><para>Audit policy determines if additional information is added to the audit
trail. The effects of the different audit policy options are described in <olink targetptr="auditplan-5" remap="internal">Determining Audit Policy</olink>.</para>
</sect1><sect1 id="auditref-55"><title>Process Audit Characteristics</title><indexterm><primary>audit characteristics</primary><secondary>processes</secondary>
</indexterm><itemizedlist><para>The following audit characteristics are set at initial login:</para><listitem><para><indexterm><primary>audit characteristics</primary><secondary>user process preselection mask</secondary></indexterm><indexterm><primary>audit classes</primary><secondary>process preselection mask</secondary></indexterm><indexterm><primary><filename>audit_control</filename> file</primary><secondary><literal>flags</literal> line</secondary><tertiary>process preselection mask</tertiary></indexterm><indexterm><primary><filename>audit_user</filename> database</primary><secondary>process preselection mask</secondary></indexterm><indexterm><primary>mask (auditing)</primary><secondary>description of process preselection</secondary></indexterm><indexterm><primary>preselection mask (auditing)</primary><secondary>description</secondary></indexterm><indexterm><primary>process audit characteristics</primary><secondary>process preselection mask</secondary></indexterm><indexterm><primary>process preselection mask</primary><secondary>description</secondary></indexterm><emphasis role="strong">Process preselection mask &ndash;</emphasis> A combination of the audit classes from the <filename>audit_control</filename> file
and the <filename>audit_user</filename> database. When a user logs in, the
login process combines the preselected classes to establish the <emphasis>process
preselection mask</emphasis> for the user's processes. The process preselection
mask specifies whether events in each audit class are to generate audit records.</para><para>The following algorithm describes how the system obtains the user's
process preselection mask:</para><screen>(flags <replaceable>line</replaceable> + <replaceable>always-audit-classes</replaceable>) - <replaceable>never-audit-classes</replaceable></screen><para><indexterm><primary><literal>flags</literal> line</primary><secondary>process preselection mask</secondary></indexterm><indexterm><primary>always-audit classes</primary><secondary>process preselection mask</secondary></indexterm>Add
the audit classes from the <literal>flags</literal> line in the <filename>audit_control</filename> file to the classes from the <replaceable>always-audit-classes</replaceable> field
in the user's entry in the <filename>audit_user</filename> database. Then,
subtract from the total the classes from the user's <replaceable>never-audit-classes</replaceable> field.</para>
</listitem><listitem><para><indexterm><primary>audit ID</primary><secondary>mechanism</secondary></indexterm><indexterm><primary>IDs</primary><secondary>audit</secondary><tertiary>mechanism</tertiary></indexterm><indexterm><primary>process audit characteristics</primary><secondary>audit ID</secondary></indexterm><indexterm><primary>audit characteristics</primary><secondary>audit ID</secondary></indexterm><indexterm><primary>user ID</primary><secondary>audit ID and</secondary></indexterm><emphasis role="strong">Audit ID &ndash;</emphasis> A process
acquires an audit ID when the user logs in. The audit ID is inherited by all
child processes that were started by the user's initial process. The audit
ID helps enforce accountability. Even after a user becomes <literal>root</literal>,
the audit ID remains the same. The audit ID that is saved in each audit record
always allows you to trace actions back to the original user who had logged
in.</para>
</listitem><listitem><para><indexterm><primary>audit session ID</primary></indexterm><indexterm><primary>audit characteristics</primary><secondary>session ID</secondary></indexterm><indexterm><primary>IDs</primary><secondary>audit session</secondary></indexterm><indexterm><primary>process audit characteristics</primary><secondary>audit session ID</secondary></indexterm><indexterm><primary>session ID</primary><secondary>audit</secondary></indexterm><emphasis role="strong">Audit
Session ID &ndash;</emphasis> The audit session ID is assigned at login. The
session ID is inherited by all child processes.</para>
</listitem><listitem><para><indexterm><primary>audit characteristics</primary><secondary>terminal ID</secondary></indexterm><indexterm><primary>process audit characteristics</primary><secondary>terminal ID</secondary></indexterm><indexterm><primary>terminal ID</primary><secondary>audit</secondary></indexterm><emphasis role="strong">Terminal
ID (port ID, machine ID) &ndash;</emphasis> The terminal ID consists of the
host name and the Internet address, followed by a unique number that identifies
the physical device on which the user logged in. Most often, the login is
through the console. The number that corresponds to the console device is <literal>0</literal>.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="auditref-75"><title>Audit Trail</title><para><indexterm><primary><command>auditd</command> daemon</primary><secondary>audit trail creation</secondary></indexterm><indexterm><primary>creating</primary><secondary> audit trail</secondary><tertiary><command>auditd</command> daemon</tertiary></indexterm>The <emphasis>audit trail</emphasis> is contains binary audit
files. The trail is created by the <command>auditd</command> daemon. Once
the auditing service has been enabled with the <command>bsmconv</command> command,
the <command>auditd</command> daemon starts when the system is booted. The <command>auditd</command> daemon is responsible for collecting the audit trail data
and writing the audit records.</para><para>The audit records are stored in binary format on file systems that are
dedicated to audit files. Even though you can physically locate audit directories
within file systems that are not dedicated to auditing, do <emphasis>not</emphasis> do
so except for directories of last resort. Directories of last resort are directories
where audit files are written only when no other suitable directory is available.</para><para>There is one other scenario where locating audit directories outside
of dedicated audit file systems could be acceptable. You might do so in a
software development environment where auditing is optional. To make full
use of disk space might be more important than to keep an audit trail. However,
in a security-conscious environment, the placement of audit directories within
other file systems is not acceptable.</para><itemizedlist><para>You should also consider the following factors when administering audit
file systems:</para><listitem><para>A host should have at least one local audit directory. The
local directory can be used as a directory of last resort if the host is unable
to communicate with the audit server.</para>
</listitem><listitem><para><indexterm><primary>directories</primary><secondary>mounting audit directories</secondary></indexterm><indexterm><primary>mounting</primary><secondary>audit directories</secondary></indexterm>Mount audit directories
with the read-write (<option role="nodash">rw</option>) option. When you mount
audit directories remotely, also use the <option role="nodash">intr</option> and <option role="nodash">noac</option> options.</para>
</listitem><listitem><para>List the audit file systems on the audit server where they
reside. The export list should include all systems that are being audited
at the site.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="auditref-77"><title>Conventions for Binary Audit File
Names</title><para>Each binary audit file is a self-contained collection of records. The
file's name identifies the time span during which the records were generated
and the system that generated them.</para><sect2 id="auditref-78"><title>Binary Audit File Names</title><para><indexterm><primary>naming conventions</primary><secondary>audit files</secondary></indexterm>Audit files that are complete have names of the following form:</para><screen><replaceable>start-time.end-time.system</replaceable></screen><variablelist><varlistentry><term><replaceable>start-time</replaceable></term><listitem><para>Is the time that the first audit record in the audit file
was generated</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>end-time</replaceable></term><listitem><para>Is the time that the last record was written to the file</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>system</replaceable></term><listitem><para>Is the name of the system that generated the file</para>
</listitem>
</varlistentry>
</variablelist><para><indexterm><primary>audit files</primary><secondary>names</secondary></indexterm><indexterm><primary>names</primary><secondary>audit files</secondary></indexterm>An audit file that is still active has a name of the following
form:</para><screen><replaceable>start-time</replaceable>.not_terminated.<replaceable>system</replaceable></screen><para>For examples of <literal>not_terminated</literal> and closed audit file
names, see <olink targetptr="audittask-12" remap="internal">How to Clean Up a not_terminated
Audit File</olink>.</para>
</sect2><sect2 id="auditref-79"><title>Binary Audit File Timestamps</title><para><indexterm><primary>audit files</primary><secondary>time stamps</secondary></indexterm><indexterm><primary>timestamps</primary><secondary>audit files</secondary></indexterm>The timestamps in file names are used by the <command>auditreduce</command> command
to locate records within a specific time range. These timestamps are important
because there can be a month's accumulation or more of audit files online.
To search all the files for records that were generated in the last 24 hours
would be unacceptably expensive.</para><para><indexterm><primary>audit files</primary><secondary>names</secondary></indexterm><indexterm><primary>audit files</primary><secondary>time stamps</secondary></indexterm><indexterm><primary><command>auditreduce</command> command</primary><secondary>timestamp use</secondary></indexterm>The <replaceable>start-time</replaceable> and <replaceable>end-time</replaceable> are timestamps with one-second resolution. They are
specified in Greenwich Mean Time (GMT). The format is four digits for the
year, followed by two digits for each month, day, hour, minute, and second,
as follows:</para><screen><replaceable>YYYYMMDDHHMMSS</replaceable></screen><para>The timestamps are in GMT to ensure that they sort in proper order,
even across time zones. Because they are in GMT, the date and hour must be
translated to the current time zone to be meaningful. Beware of this point
whenever you manipulate these files with standard file commands rather than
with the <command>auditreduce</command> command.</para>
</sect2>
</sect1><sect1 id="auditref-20"><title>Audit Record Structure</title><para><indexterm><primary>audit records</primary><secondary>format</secondary></indexterm><indexterm><primary>audit records</primary><secondary>sequence of tokens</secondary></indexterm><indexterm><primary>audit tokens</primary><secondary>audit record format</secondary></indexterm>An audit record is a
sequence of audit tokens. Each audit token contains event information such
as user ID, time, and date. A <command>header</command> token begins an audit
record, and an optional <literal>trailer</literal> token concludes the record.
Other audit tokens contain information relevant to the audit event. The following
figure shows a typical audit record.</para><figure id="auditref-fig-4"><title>Typical Audit Record Structure</title><mediaobject><imageobject><imagedata entityref="audrecord.epsi"/>
</imageobject><textobject><simpara>Diagram shows a typical audit record structure, which
includes a header token followed by an arg, a data, a subject, and a return
token.</simpara>
</textobject>
</mediaobject>
</figure><sect2 id="auditref-24"><title>Audit Record Analysis</title><para>Audit record analysis involves postselecting records from the audit
trail. You can use one of two approaches to parsing the binary data that was
collected.</para><itemizedlist><listitem><para>You can parse the binary data stream. To parse the data stream,
you need to know the order of the fields in each token, and the order of tokens
in each record. You also need to know the variants of an audit record. For
example, the <function>ioctl</function> system call creates an audit record
for &ldquo;Bad file name&rdquo; that contains different tokens from the audit
record for &ldquo;Invalid file descriptor&rdquo;.</para><itemizedlist><listitem><para>For a description of the order of binary data in each audit
token, see the <olink targetdoc="group-refman" targetptr="audit.log-4" remap="external"><citerefentry><refentrytitle>audit.log</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page.</para>
</listitem><listitem><para><indexterm><primary><literal>[]</literal> (square brackets)</primary><secondary><command>bsmrecord</command> output</secondary></indexterm><indexterm><primary>square brackets (<literal>[]</literal>)</primary><secondary><command>bsmrecord</command> output</secondary></indexterm><indexterm><primary><command>bsmrecord</command> command</primary><secondary><literal>[]</literal> (square brackets) in output</secondary></indexterm><indexterm><primary><command>bsmrecord</command> command</primary><secondary>optional tokens (<literal>[]</literal>)</secondary></indexterm>For
a description of the order of tokens in an audit record, use the <command>bsmrecord</command> command. Output from the <command>bsmrecord</command> command includes
the different formats that occur under different conditions. Square brackets
(<literal>[]</literal>) indicate that an audit token is optional. For more
information, see the <olink targetdoc="group-refman" targetptr="bsmrecord-1m" remap="external"><citerefentry><refentrytitle>bsmrecord</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page. For examples, see also <olink targetptr="audittask-10" remap="internal">How to Display
Audit Record Formats</olink>.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para>You can use the <command>praudit</command> command. Options
to the command provide different text outputs. For example, the <command>praudit
-x</command> command provides XML for input into scripts and browsers. <command>praudit</command> outputs do not include fields whose sole purpose is to help to
parse the binary data. The outputs do not necessarily follow the order of
the binary fields. Also, the order and format of <command>praudit</command> output
is not guaranteed between Solaris releases.</para><para>For examples of <command>praudit</command> output, see <olink targetptr="audittask-22" remap="internal">How to View
the Contents of Binary Audit Files</olink>, and the <olink targetdoc="group-refman" targetptr="praudit-1m" remap="external"><citerefentry><refentrytitle>praudit</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para><para>For
a description of the <command>praudit</command> output for each audit token,
see the individual tokens in the <olink targetptr="aparecord-11" remap="internal">Audit Token
Formats</olink> section.</para>
</listitem>
</itemizedlist>
</sect2>
</sect1><sect1 id="aparecord-11"><title>Audit Token Formats</title><para><indexterm><primary>audit tokens</primary><secondary>format</secondary></indexterm><indexterm><primary>audit tokens</primary><secondary>list of</secondary></indexterm>Each audit token has a token type identifier, which is followed
by data that is specific to the token. Each token type has its own format.
The following table shows the token names with a brief description of each
token. Obsolete tokens are maintained for compatibility with previous Solaris
releases.</para><table frame="topbot" pgwide="1" id="auditref-tbl-1"><title>Audit Tokens for
Solaris Auditing</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="2.36*"/><colspec colnum="2" colname="column2" colwidth="5.33*"/><colspec colnum="3" colname="colspec0" colwidth="5.30*"/><thead><row rowsep="1"><entry><para>Token Name</para>
</entry><entry><para>Description</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>acl</literal></para>
</entry><entry><para>Access Control List (ACL) information</para>
</entry><entry><para><olink targetptr="aparecord-3" remap="internal">acl Token</olink></para>
</entry>
</row><row><entry><para><literal>arbitrary</literal></para>
</entry><entry><para>Data with format
and type information</para>
</entry><entry><para><olink targetptr="aparecord-5" remap="internal">arbitrary Token  (Obsolete)</olink></para>
</entry>
</row><row><entry><para><literal>arg</literal></para>
</entry><entry><para>System call argument value</para>
</entry><entry><para><olink targetptr="aparecord-6" remap="internal">arg Token</olink></para>
</entry>
</row><row><entry><para><literal>attribute</literal></para>
</entry><entry><para>File vnode tokens</para>
</entry><entry><para><olink targetptr="aparecord-4" remap="internal">attribute Token</olink></para>
</entry>
</row><row><entry><para><literal>cmd</literal></para>
</entry><entry><para><indexterm><primary>environment variables</primary><secondary>presence in audit records</secondary></indexterm>Command arguments and environment variables</para>
</entry><entry><para><olink targetptr="auditref-26" remap="internal">cmd Token</olink></para>
</entry>
</row><row><entry><para><literal>exec_args</literal></para>
</entry><entry><para>Exec system call arguments</para>
</entry><entry><para><olink targetptr="aparecord-10" remap="internal">exec_args Token</olink></para>
</entry>
</row><row><entry><para><literal>exec_env</literal></para>
</entry><entry><para>Exec system call environment variables</para>
</entry><entry><para><olink targetptr="aparecord-12" remap="internal">exec_env Token</olink></para>
</entry>
</row><row><entry><para><literal>exit</literal></para>
</entry><entry><para>Program exit information</para>
</entry><entry><para><olink targetptr="aparecord-14" remap="internal">exit Token  (Obsolete)</olink></para>
</entry>
</row><row><entry><para><literal>file</literal></para>
</entry><entry><para>Audit file information</para>
</entry><entry><para><olink targetptr="aparecord-16" remap="internal">file Token</olink></para>
</entry>
</row><row><entry><para><literal>group</literal></para>
</entry><entry><para>Process groups information</para>
</entry><entry><para><olink targetptr="aparecord-18" remap="internal">group Token (Obsolete)</olink></para>
</entry>
</row><row><entry><para><literal>groups</literal></para>
</entry><entry><para>Process groups information</para>
</entry><entry><para><olink targetptr="aparecord-25" remap="internal">groups Token</olink></para>
</entry>
</row><row><entry><para><literal>header</literal></para>
</entry><entry><para>Indicates start of audit record</para>
</entry><entry><para><olink targetptr="aparecord-20" remap="internal">header Token</olink></para>
</entry>
</row><row><entry><para><literal>in_addr</literal></para>
</entry><entry><para>Internet address</para>
</entry><entry><para><olink targetptr="aparecord-22" remap="internal">in_addr Token</olink></para>
</entry>
</row><row><entry><para><literal>ip</literal></para>
</entry><entry><para>IP header information</para>
</entry><entry><para><olink targetptr="aparecord-24" remap="internal">ip Token (Obsolete)</olink></para>
</entry>
</row><row><entry><para><literal>ipc</literal></para>
</entry><entry><para>System V IPC information</para>
</entry><entry><para><olink targetptr="aparecord-26" remap="internal">ipc Token</olink></para>
</entry>
</row><row><entry><para><literal>ipc_perm</literal></para>
</entry><entry><para>System V IPC object tokens</para>
</entry><entry><para><olink targetptr="aparecord-23" remap="internal">ipc_perm Token</olink></para>
</entry>
</row><row><entry><para><literal>iport</literal></para>
</entry><entry><para>Internet port address</para>
</entry><entry><para><olink targetptr="aparecord-7" remap="internal">iport Token</olink></para>
</entry>
</row><row><entry><para><literal>opaque</literal></para>
</entry><entry><para>Unstructured data
(unspecified format)</para>
</entry><entry><para><olink targetptr="aparecord-27" remap="internal">opaque Token  (Obsolete)</olink></para>
</entry>
</row><row><entry><para><literal>path</literal></para>
</entry><entry><para>Path information</para>
</entry><entry><para><olink targetptr="aparecord-29" remap="internal">path Token</olink></para>
</entry>
</row><row><entry><para><literal>path_attr</literal></para>
</entry><entry><para>Access path information</para>
</entry><entry><para><olink targetptr="auditref-21" remap="internal">path_attr Token</olink></para>
</entry>
</row><row><entry><para><literal>privilege</literal></para>
</entry><entry><para>Privilege set information</para>
</entry><entry><para><olink targetptr="auditref-23" remap="internal">privilege Token</olink></para>
</entry>
</row><row><entry><para><literal>process</literal></para>
</entry><entry><para>Process token information</para>
</entry><entry><para><olink targetptr="aparecord-28" remap="internal">process Token</olink></para>
</entry>
</row><row><entry><para><literal>return</literal></para>
</entry><entry><para>Status of system call</para>
</entry><entry><para><olink targetptr="aparecord-30" remap="internal">return Token</olink></para>
</entry>
</row><row><entry><para><literal>sequence</literal></para>
</entry><entry><para>Sequence number token</para>
</entry><entry><para><olink targetptr="aparecord-31" remap="internal">sequence Token</olink></para>
</entry>
</row><row><entry><para><literal>socket</literal></para>
</entry><entry><para>Socket type and addresses</para>
</entry><entry><para><olink targetptr="aparecord-32" remap="internal">socket Token</olink></para>
</entry>
</row><row><entry><para><literal>subject</literal></para>
</entry><entry><para>Subject token information (same format as <command>process</command> token)</para>
</entry><entry><para><olink targetptr="aparecord-33" remap="internal">subject Token</olink></para>
</entry>
</row><row><entry><para><literal>text</literal></para>
</entry><entry><para>ASCII string</para>
</entry><entry><para><olink targetptr="aparecord-34" remap="internal">text Token</olink></para>
</entry>
</row><row><entry><para><literal>trailer</literal></para>
</entry><entry><para>Indicates end of audit record</para>
</entry><entry><para><olink targetptr="aparecord-35" remap="internal">trailer Token</olink></para>
</entry>
</row><row><entry><para><literal>uauth</literal></para>
</entry><entry><para>Use of authorization</para>
</entry><entry><para><olink targetptr="auditref-27" remap="internal">uauth Token</olink></para>
</entry>
</row><row><entry><para><literal>zonename</literal></para>
</entry><entry><para>Name of zone</para>
</entry><entry><para><olink targetptr="auditref-15" remap="internal">zonename Token</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>An audit record always begins with a <literal>header</literal> token.
The <literal>header</literal> token indicates where the audit record begins
in the audit trail. In the case of attributable events, the <literal>subject</literal> and
the <literal>process</literal> tokens refer to the values of the process that
caused the event. In the case of nonattributable events, the <literal>process</literal> token
refers to the system.</para><sect2 id="aparecord-3"><title><literal>acl</literal> Token</title><indexterm><primary><literal>acl</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>acl</literal> token records information about Access Control
Lists (ACLs). This token consists of four fixed fields:</para><listitem><para>A token ID that identifies this token as an <literal>acl</literal> token</para>
</listitem><listitem><para>A field that specifies the ACL type</para>
</listitem><listitem><para>An ACL value field</para>
</listitem><listitem><para>A field that lists the permissions associated with this ACL</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>acl</literal> token
as follows:</para><screen>acl,jdoe,staff,0755</screen>
</sect2><sect2 id="aparecord-5"><title><literal>arbitrary</literal> Token
 (Obsolete)</title><indexterm><primary><literal>arbitrary</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>arbitrary</literal> token encapsulates data for the audit
trail. This token consists of four fixed fields and an array of data. The
fixed fields are as follows:</para><listitem><para>A token ID that identifies this token as an <literal>arbitrary</literal> token</para>
</listitem><listitem><para>A suggested print format field, such as hexadecimal</para>
</listitem><listitem><para><indexterm><primary>item size field </primary><secondary><literal>arbitrary</literal> token</secondary></indexterm><indexterm><primary><literal>arbitrary</literal> audit token</primary><secondary>item size field</secondary></indexterm>An item size field that specifies the size of the data that is
encapsulated, such as short</para>
</listitem><listitem><para>A count field that provides the number of following items</para>
</listitem>
</itemizedlist><para>The remainder of the token is composed of <replaceable>count</replaceable> of
the specified type. The <command>praudit</command> command displays the <literal>arbitrary</literal> token as follows:</para><screen>arbitrary,decimal,int,1
42</screen><para><indexterm><primary>print format field</primary><secondary><literal>arbitrary</literal> token</secondary></indexterm><indexterm><primary><literal>arbitrary</literal> audit token</primary><secondary>print format field</secondary></indexterm>The following
table shows the possible values of the print format field.</para><table frame="topbot" id="aparecord-21"><title>Values for the <literal>arbitrary</literal> Token's
Print Format Field</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="2*"/><colspec colnum="2" colname="column2" colwidth="4*"/><thead><row rowsep="1"><entry><para>Value</para>
</entry><entry><para>Action</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>AUP_BINARY</literal></para>
</entry><entry><para>Prints the date in binary format</para>
</entry>
</row><row><entry><para><literal>AUP_OCTAL</literal></para>
</entry><entry><para>Prints the date in octal format</para>
</entry>
</row><row><entry><para><literal>AUP_DECIMAL</literal></para>
</entry><entry><para>Prints the date in decimal format</para>
</entry>
</row><row><entry><para><literal>AUP_HEX</literal></para>
</entry><entry><para>Prints the date in hexadecimal format</para>
</entry>
</row><row><entry><para><literal>AUP_STRING</literal></para>
</entry><entry><para>Prints the date as a string</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The following table shows the possible values of the item size field.</para><table frame="topbot" id="aparecord-tbl-2"><title>Values for the <literal>arbitrary</literal> Token's Item Size Field</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="2*"/><colspec colnum="2" colname="column2" colwidth="4*"/><thead><row rowsep="1"><entry><para>Value</para>
</entry><entry><para>Action</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>AUR_BYTE</literal></para>
</entry><entry><para>Data is printed in units of bytes in 1 byte</para>
</entry>
</row><row><entry><para><literal>AUR_SHORT</literal></para>
</entry><entry><para>Data is printed in units of shorts in 2 bytes</para>
</entry>
</row><row><entry><para><literal>AUR_LONG</literal></para>
</entry><entry><para>Data is printed in units of longs in 4 bytes</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="aparecord-6"><title><literal>arg</literal> Token</title><indexterm><primary><literal>arg</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>system calls</primary><secondary><literal>arg</literal> audit token</secondary>
</indexterm><itemizedlist><para>The <literal>arg</literal> token contains information about the arguments
to a system call: the argument number of the system call, the argument value,
and an optional description. This token allows a 32-bit integer system-call
argument in an audit record. The <literal>arg</literal> token has five fields:</para><listitem><para>A token ID that identifies this token as an <literal>arg</literal> token</para>
</listitem><listitem><para>An argument ID that tells which system call argument that
the token refers to</para>
</listitem><listitem><para>The argument value</para>
</listitem><listitem><para>The length of the descriptive text string</para>
</listitem><listitem><para>The text string</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>arg</literal> token
without the fourth field, as follows:</para><screen>argument,4,0xffbfe0ac,pri</screen><para>The <command>praudit -x</command> command includes the names of the
fields that are displayed:</para><screen>&lt;argument arg-num="4" value="0xffbfe0ac" desc="pri"/&gt;</screen>
</sect2><sect2 id="aparecord-4"><title><literal>attribute</literal> Token</title><indexterm><primary><literal>attribute</literal> audit token</primary>
</indexterm><indexterm><primary>file <literal>vnode</literal> audit token</primary>
</indexterm><indexterm><primary><literal>vnode</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>attribute</literal> token contains information from the
file vnode. This token has seven fields:</para><listitem><para>A token ID that identifies this token as an <literal>attribute</literal> token</para>
</listitem><listitem><para>The file access mode and type</para>
</listitem><listitem><para>The owner user ID</para>
</listitem><listitem><para>The owner group ID</para>
</listitem><listitem><para>The file system ID</para>
</listitem><listitem><para>The node ID</para>
</listitem><listitem><para>The device ID that the file might represent</para>
</listitem>
</itemizedlist><para>For further information about the file system ID and the device ID,
see the <olink targetdoc="refman" targetptr="statvfs-2" remap="external"><citerefentry><refentrytitle>statvfs</refentrytitle><manvolnum>2</manvolnum></citerefentry></olink> man
page.</para><para>The <literal>attribute</literal> token usually accompanies a <literal>path</literal> token.
The <literal>attribute</literal> token is produced during path searches. If
a path-search error occurs, there is no vnode available to obtain the necessary
file information. Therefore, the <literal>attribute</literal> token is not
included as part of the audit record. The <command>praudit</command> command
displays the <literal>attribute</literal> token as follows:</para><screen>attribute,20666,root,root,247,4829,450971566127</screen>
</sect2><sect2 id="auditref-26"><title><literal>cmd</literal> Token</title><indexterm><primary><literal>cmd</literal> audit token</primary>
</indexterm><indexterm><primary>variables</primary><secondary>auditing those associated with a command</secondary>
</indexterm><para>The <literal>cmd</literal> token records the list of arguments and the
list of environment variables that are associated with a command.</para><itemizedlist><para>The <literal>cmd</literal> token contains the following fields:</para><listitem><para>A token ID that identifies this token as a <literal>cmd</literal> token</para>
</listitem><listitem><para>A count of the command's arguments</para>
</listitem><listitem><para>The argument list</para>
</listitem><listitem><para>The length of the next field</para>
</listitem><listitem><para>The content of the arguments</para>
</listitem><listitem><para>A count of the environment variables</para>
</listitem><listitem><para>The list of environment variables</para>
</listitem><listitem><para>The length of the next field</para>
</listitem><listitem><para>The content of the environment variables</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>cmd</literal> token
as follows:</para><screen>cmd,argcnt,3,ls,-l,/etc,envcnt,0,</screen>
</sect2><sect2 id="aparecord-10"><title><literal>exec_args</literal> Token</title><indexterm><primary><literal>argv</literal> audit policy</primary><secondary> and <literal>exec_args</literal> token</secondary>
</indexterm><indexterm><primary><literal>exec_args</literal> audit token</primary><secondary><literal>argv</literal> policy and</secondary>
</indexterm><indexterm><primary><literal>exec_args</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>system calls</primary><secondary><literal>exec_args</literal> audit token</secondary>
</indexterm><itemizedlist><para>The <literal>exec_args</literal> token records the arguments to an <function>exec</function> system call. The <literal>exec_args</literal> token has two
fixed fields:</para><listitem><para>A token ID field that identifies this token as an <literal>exec_args</literal> token</para>
</listitem><listitem><para>A count that represents the number of arguments that are passed
to the <function>exec</function> system call</para>
</listitem>
</itemizedlist><para>The remainder of this token is composed of <replaceable>count</replaceable> strings.
 The <command>praudit</command> command displays the <literal>exec_args</literal> token
as follows:</para><screen>exec_args,2,vi,/etc/security/audit_user</screen><note><para>The <literal>exec_args</literal> token is output only when the <literal>argv</literal> audit policy option is active.</para>
</note>
</sect2><sect2 id="aparecord-12"><title><literal>exec_env</literal> Token</title><indexterm><primary><literal>exec_env</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>system calls</primary><secondary><literal>exec_env</literal> audit token</secondary>
</indexterm><indexterm><primary><literal>arge</literal> audit policy</primary><secondary>and <literal>exec_env</literal> token</secondary>
</indexterm><indexterm><primary>environment variables</primary><secondary>audit token for</secondary>
</indexterm><indexterm><primary>variables</primary><secondary>adding to audit record</secondary>
</indexterm><itemizedlist><para>The <literal>exec_env</literal> token records the current environment
variables to an <function>exec</function> system call. The <literal>exec_env</literal> token
has two fixed fields:</para><listitem><para>A token ID field that identifies this token as an <literal>exec_env</literal> token</para>
</listitem><listitem><para>A count that represents the number of arguments that are passed
to the <function>exec</function> system call</para>
</listitem>
</itemizedlist><para>The remainder of this token is composed of <replaceable>count</replaceable> strings.
The <command>praudit</command> command displays the <literal>exec_env</literal> token
as follows:</para><screen>exec_env,25,
GROUP=staff,HOME=/export/home/jdoe,HOST=exm1,HOSTTYPE=sun4u,HZ=100,
LC_COLLATE=en_US.ISO8859-1,LC_CTYPE=en_US.ISO8859-1,LC_MESSAGES=C,
LC_MONETARY=en_US.ISO8859-1,LC_NUMERIC=en_US.ISO8859-1,
LC_TIME=en_US.ISO8859-1,LOGNAME=jdoe,MACHTYPE=sparc,
MAIL=/var/mail/jdoe,OSTYPE=solaris,PATH=/usr/sbin:/usr/bin,PS1=#,
PWD=/var/audit,REMOTEHOST=192.168.13.5,SHELL=/usr/bin/csh,SHLVL=1,
TERM=dtterm,TZ=US/Pacific,USER=jdoe,VENDOR=sun</screen><note><para>The <literal>exec_env</literal> token is output only when the <literal>arge</literal> audit policy option is active.</para>
</note>
</sect2><sect2 id="aparecord-14"><title><literal>exit</literal> Token  (Obsolete)</title><indexterm><primary><literal>exit</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>exit</literal> token records the exit status of a program.
The <literal>exit</literal> token contains the following fields:</para><listitem><para>A token ID that identifies this token as an <literal>exit</literal> token</para>
</listitem><listitem><para>A program exit status as passed to the <function>exit</function> system
call</para>
</listitem><listitem><para>A return value that describes the exit status or that provides
a system error number</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>exit</literal> token
as follows:</para><screen>exit,Error 0,0</screen>
</sect2><sect2 id="aparecord-16"><title><literal>file</literal> Token</title><indexterm><primary><literal>file</literal> audit token</primary><secondary>format</secondary>
</indexterm><para>The <literal>file</literal> token is a special token that is generated
by the <command>auditd</command> daemon. The token marks the beginning of
a new audit file and the end of an old audit file as the old file is deactivated.
The <command>auditd</command> daemon builds a special audit record that contains
this token to &ldquo;link&rdquo; together successive audit files into one
audit trail.</para><itemizedlist><para>The <literal>file</literal> token has four fields:</para><listitem><para>A token ID that identifies this token as a <literal>file</literal> token</para>
</listitem><listitem><para>A timestamp that identifies the date and the time that the
file was created or was closed</para>
</listitem><listitem><para>The file name length</para>
</listitem><listitem><para>A field that holds the file null-terminated name</para>
</listitem>
</itemizedlist><para>The <command>praudit -x</command> command shows the fields of the <literal>file</literal> token:</para><screen>file,2003-10-13 11:21:35.506 -07:00,
	/var/audit/localhost/files/20031013175058.20031013182135.example1</screen>
</sect2><sect2 id="aparecord-18"><title><literal>group</literal> Token (Obsolete)</title><para>This token has been replaced by the the <literal>groups</literal> token.
See <olink targetptr="aparecord-25" remap="internal">groups Token</olink>.</para>
</sect2><sect2 id="aparecord-25"><title><literal>groups</literal> Token</title><indexterm><primary><literal>group</literal> audit token</primary><secondary>replaced by <literal>groups</literal> token</secondary>
</indexterm><itemizedlist><para>The <literal>groups</literal> token replaces the <literal>group</literal> token.
The <literal>groups</literal> token records the group entries from the process's
credential. The <literal>groups</literal> token has two fixed fields:</para><listitem><para>A token ID field that identifies this token as a <literal>groups</literal> token</para>
</listitem><listitem><para>A count that represents the number of groups that are contained
in this audit record</para>
</listitem>
</itemizedlist><para>The remainder of this token is composed of <replaceable>count</replaceable> group
entries. The <command>praudit</command> command displays the <literal>groups</literal> token
as follows:</para><screen>groups,staff,admin</screen><note><para><indexterm><primary><literal>groups</literal> audit token</primary></indexterm><indexterm><primary><literal>group</literal> audit policy</primary><secondary>and <literal>groups</literal> token</secondary></indexterm>The <literal>groups</literal> token is output only when the <literal>group</literal> audit
policy option is active.</para>
</note>
</sect2><sect2 id="aparecord-20"><title><literal>header</literal> Token</title><indexterm><primary><literal>header</literal> audit token</primary><secondary>order in audit record</secondary>
</indexterm><indexterm><primary><literal>header</literal> audit token</primary><secondary>format</secondary>
</indexterm><para>The <literal>header</literal> token is special in that it marks the
beginning of an audit record. The <literal>header</literal> token combines
with the <literal>trailer</literal> token to bracket all the other tokens
in the record.</para><itemizedlist><para>The <literal>header</literal> token has eight fields:</para><listitem><para>A token ID field that identifies this token as a <literal>header</literal> token</para>
</listitem><listitem><para>A byte count of the total length of the audit record, including
both the <literal>header</literal> and the <literal>trailer</literal> tokens</para>
</listitem><listitem><para>A version number that identifies the version of the audit
record structure</para>
</listitem><listitem><para>The audit event ID that identifies the audit event that the
record represents</para>
</listitem><listitem><para>The ID modifier that identifies special characteristics of
the audit event</para>
</listitem><listitem><para>The address type, either IPv4 or IPv6</para>
</listitem><listitem><para>The machine's IP address</para>
</listitem><listitem><para>The time and date that the record was created</para>
</listitem>
</itemizedlist><para>On 64-bit systems, the <literal>header</literal> token is displayed
with a 64-bit timestamp, in place of the 32-bit timestamp.</para><para>The <command>praudit</command> command displays the <literal>header</literal> token
for a <function>ioctl</function> system call as follows:</para><screen>header,176,2,ioctl(2),fe,example1,2003-09-08 11:23:31.050 -07:00</screen><para><indexterm><primary><literal>header</literal> audit token</primary><secondary>event-modifier field flags</secondary></indexterm><indexterm><primary>event modifier field flags (<literal>header</literal> token)</primary></indexterm>The ID modifier field has the following flags defined:</para><screen>0x4000			PAD_NOTATTR						nonattributable event
0x8000			PAD_FAILURE						failed audit event</screen>
</sect2><sect2 id="aparecord-22"><title><literal>in_addr</literal> Token</title><indexterm><primary><literal>in_addr</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>Internet-related tokens</primary><secondary><literal>in_addr</literal> token</secondary>
</indexterm><itemizedlist><para>The <literal>in_addr</literal> token contains an Internet Protocol address.
Since the Solaris 8 release, the Internet address can be displayed in
IPv4 format or IPv6 format. The IPv4 address uses 4 bytes. The IPv6 address
uses 1 byte to describe the address type, and 16 bytes to describe the address.
The <literal>in_addr</literal> token has three fields:</para><listitem><para>A token ID that identifies this token as an <literal>in_addr</literal> token</para>
</listitem><listitem><para>The IP address type, either IPv4 or IPv6</para>
</listitem><listitem><para>An IP address</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>in_addr</literal> token,
without the second field, as follows:</para><screen>ip address,192.168.113.7</screen>
</sect2><sect2 id="aparecord-24"><title><literal>ip</literal> Token (Obsolete)</title><indexterm><primary>Internet-related tokens</primary><secondary><literal>ip</literal> token</secondary>
</indexterm><indexterm><primary><literal>ip</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>ip</literal> token contains a copy of an Internet Protocol
header. The <literal>ip</literal> token has two fields:</para><listitem><para>A token ID that identifies this token as an <literal>ip</literal> token</para>
</listitem><listitem><para>A copy of the IP header, that is, all 20 bytes</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>ip</literal> token
as follows:</para><screen>ip address,0.0.0.0</screen><para>The IP header structure is defined in the <filename>/usr/include/netinet/ip.h</filename> file.</para>
</sect2><sect2 id="aparecord-26"><title><literal>ipc</literal> Token</title><indexterm><primary>System V IPC</primary><secondary><literal>ipc</literal> audit token</secondary>
</indexterm><indexterm><primary><literal>ipc</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>ipc type field values (<literal>ipc</literal> token)</primary>
</indexterm><indexterm><primary><literal>ipc</literal> audit token</primary>
</indexterm><itemizedlist><para>The <literal>ipc</literal> token contains the System V IPC message handle,
semaphore handle, or shared-memory handle that is used by the caller to identify
a particular IPC object. The <literal>ipc</literal> token has three fields:</para><listitem><para>A token ID that identifies this token as an <literal>ipc</literal> token</para>
</listitem><listitem><para>A type field that specifies the type of IPC object</para>
</listitem><listitem><para>The handle that identifies the IPC object</para>
</listitem>
</itemizedlist><note><para>The IPC object identifiers violate the context-free nature of
the Solaris audit tokens. No global &ldquo;name&rdquo; uniquely identifies
IPC objects. Instead, IPC objects are identified by their handles. The handles
are valid only during the time that the IPC objects are active. However, the
identification of IPC objects should not be a problem. The System V IPC mechanisms
are seldom used, and the mechanisms all share the same audit class.</para>
</note><para>The following table shows the possible values for the IPC object type
field. The values are defined in the <filename>/usr/include/bsm/audit.h</filename> file. </para><table frame="topbot" id="aparecord-17"><title>Values for the IPC Object Type
Field</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="2*"/><colspec colnum="2" colname="column2" colwidth="2*"/><colspec colnum="3" colname="column3" colwidth="3*"/><thead><row rowsep="1"><entry><para>Name</para>
</entry><entry><para>Value</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>AU_IPC_MSG</literal></para>
</entry><entry><para>1</para>
</entry><entry><para>IPC message object</para>
</entry>
</row><row><entry><para><literal>AU_IPC_SEM</literal></para>
</entry><entry><para>2</para>
</entry><entry><para>IPC semaphore object</para>
</entry>
</row><row><entry><para><literal>AU_IPC_SHM</literal></para>
</entry><entry><para>3</para>
</entry><entry><para>IPC shared-memory object</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The <command>praudit</command> command displays the <literal>ipc</literal> token
as follows:</para><screen>IPC,msg,3</screen>
</sect2><sect2 id="aparecord-23"><title><literal>ipc_perm</literal> Token</title><indexterm><primary><literal>ipc_perm</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>System V IPC</primary><secondary><literal>ipc_perm</literal> audit token</secondary>
</indexterm><itemizedlist><para>The <literal>ipc_perm</literal> token contains a copy of the System
V IPC access permissions. This token is added to audit records that are generated
by IPC shared-memory events, IPC semaphore events, and IPC message events.
The <literal>ipc_perm</literal> token has eight fields:</para><listitem><para>A token ID that identifies this token as an <literal>ipc_perm</literal> token</para>
</listitem><listitem><para>The user ID of the IPC owner</para>
</listitem><listitem><para>The group ID of the IPC owner</para>
</listitem><listitem><para>The user ID of the IPC creator</para>
</listitem><listitem><para>The group ID of the IPC creator</para>
</listitem><listitem><para>The access mode of the IPC</para>
</listitem><listitem><para>The sequence number of the IPC</para>
</listitem><listitem><para>The IPC key value</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>ipc_perm</literal> token
as follows:</para><screen>IPC perm,root,sys,root,sys,0,0,0x00000000</screen><para>The values are taken from the <literal>ipc_perm</literal> structure
that is associated with the IPC object.</para>
</sect2><sect2 id="aparecord-7"><title><literal>iport</literal> Token</title><indexterm><primary>Internet-related tokens</primary><secondary><literal>iport</literal> token</secondary>
</indexterm><indexterm><primary><literal>iport</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>TCP</primary><secondary>addresses</secondary>
</indexterm><indexterm><primary>UDP</primary><secondary>addresses</secondary>
</indexterm><itemizedlist><para>The <literal>iport</literal> token contains the TCP or UDP port address.
The <literal>iport</literal> token has two fields:</para><listitem><para>A token ID that identifies this token as an <literal>iport</literal> token</para>
</listitem><listitem><para>The TCP or UDP port address</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>iport</literal> token
as follows:</para><screen>ip port,0xf6d6</screen>
</sect2><sect2 id="aparecord-27"><title><literal>opaque</literal> Token
 (Obsolete)</title><indexterm><primary><literal>opaque</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>opaque</literal> token contains unformatted data as a sequence
of bytes. The <literal>opaque</literal> token has three fields:</para><listitem><para>A token ID that identifies this token as an <literal>opaque</literal> token</para>
</listitem><listitem><para>A byte count of the data</para>
</listitem><listitem><para>An array of byte data</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>opaque</literal> token
as follows:</para><screen>opaque,12,0x4f5041515545204441544100</screen>
</sect2><sect2 id="aparecord-29"><title><literal>path</literal> Token</title><indexterm><primary><literal>path</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>path</literal> token contains access path information for
an object. This token contains the following fields:</para><listitem><para>A token ID that identifies this token as an <literal>path</literal> token</para>
</listitem><listitem><para>The path length</para>
</listitem><listitem><para>The absolute path to the object that is based on the real
root of the system</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>path</literal> token,
without the second field, as follows:</para><screen>path,/etc/security/audit_user</screen><para>The <command>praudit -x</command> command displays the <literal>path</literal> token
as follows:</para><screen>&lt;path&gt;/etc/security/audit_user&lt;/path&gt;</screen><para>The following figure shows the format of a <literal>path</literal> token.</para><figure id="aparecord-fig-16"><title><literal>path</literal> Token Format</title><mediaobject><imageobject><imagedata entityref="path.epsi"/>
</imageobject><textobject><simpara>The preceding context describes the graphic.</simpara>
</textobject>
</mediaobject>
</figure>
</sect2><sect2 id="auditref-21"><title><literal>path_attr</literal> Token</title><indexterm><primary><literal>path_attr</literal> audit token</primary>
</indexterm><para>The <literal>path_attr</literal> token contains access path information
for an object. The access path specifies the sequence of attribute file objects
below the <literal>path</literal> token object. Systems calls such as <function>openat</function> access attribute files. For more information on attribute file
objects, see the <olink targetdoc="group-refman" targetptr="fsattr-5" remap="external"><citerefentry><refentrytitle>fsattr</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man
page.</para><itemizedlist><para>The <literal>path_attr</literal> token contains the following fields:</para><listitem><para>A token ID that identifies this token as a <literal>path_attr</literal> token</para>
</listitem><listitem><para>A count that represents the number of sections of attribute
file paths</para>
</listitem><listitem><para><replaceable>count</replaceable> null-terminated strings</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>path_attr</literal> token
as follows:</para><screen>path_attr,1,attr_file_name</screen>
</sect2><sect2 id="auditref-23"><title><literal>privilege</literal> Token</title><indexterm><primary><literal>privilege</literal> audit token</primary>
</indexterm><para>The <literal>privilege</literal> token records the use of privileges
on a process. The <literal>privilege</literal> token is not recorded for privileges
in the basic set. If a privilege has been removed from the basic set by administrative
action, then the use of that privilege is recorded. For more information on
privileges, see <olink targetptr="prbac-2" remap="internal">Privileges (Overview)</olink></para><itemizedlist><para>The <literal>privilege</literal> token contains the following fields:</para><listitem><para>A token ID that identifies this token as a <literal>privilege</literal> token</para>
</listitem><listitem><para>The length of the following field</para>
</listitem><listitem><para>The name of privilege set</para>
</listitem><listitem><para>The length of the following field</para>
</listitem><listitem><para>The list of privileges</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>privilege</literal> token
as follows:</para><screen>privilege,effective,</screen>
</sect2><sect2 id="aparecord-28"><title><literal>process</literal> Token</title><indexterm><primary><literal>process</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>process</literal> token contains information about a user
who is associated with a process, such as the recipient of a signal. The <literal>process</literal> token has nine fields:</para><listitem><para>A token ID that identifies this token as a <literal>process</literal> token</para>
</listitem><listitem><para>The audit ID</para>
</listitem><listitem><para>The effective user ID</para>
</listitem><listitem><para>The effective group ID</para>
</listitem><listitem><para>The real user ID</para>
</listitem><listitem><para>The real group ID</para>
</listitem><listitem><para>The process ID</para>
</listitem><listitem><para>The audit session ID</para>
</listitem><listitem><para>A terminal ID that consists of a device ID and a machine ID</para>
</listitem>
</itemizedlist><para>The audit ID, user ID, group ID, process ID, and session ID are long
instead of short.</para><note><para>The <literal>process</literal> token fields for the session ID,
the real user ID, or the real group ID might be unavailable. The value is
then set to <literal>-1</literal>.</para>
</note><para>Any token that contains a terminal ID has several variations. The <command>praudit</command> command hides these variations. So, the terminal ID is handled
the same way for any token that contains a terminal ID. The terminal ID is
either an IP address and port number, or a device ID. A device ID, such as
the serial port that is connected to a modem, can be zero. The terminal ID
is specified in one of several formats.</para><itemizedlist><para>The terminal ID for device numbers is specified as follows:</para><listitem><para><emphasis role="strong">32-bit applications &ndash;</emphasis> 4-byte
device number, 4 bytes unused</para>
</listitem><listitem><para><emphasis role="strong">64-bit applications &ndash;</emphasis> 8-byte
device number, 4 bytes unused</para>
</listitem>
</itemizedlist><itemizedlist><para>In releases prior to the Solaris 8 release, the terminal ID for
port numbers is specified as follows:</para><listitem><para><emphasis role="strong">32-bit applications &ndash;</emphasis> 4-byte
port number, 4-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">64-bit applications &ndash;</emphasis> 8-byte
port number, 4-byte IP address</para>
</listitem>
</itemizedlist><itemizedlist><para>Since the Solaris 8 release, the terminal ID for port numbers is
specified as follows:</para><listitem><para><emphasis role="strong">32-bit with IPv4 &ndash;</emphasis> 4-byte
port number, 4-byte IP type, 4-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">32-bit with IPv6 &ndash;</emphasis> 4-byte
port number, 4-byte IP type, 16-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">64-bit with IPv4 &ndash;</emphasis> 8-byte
port number, 4-byte IP type, 4-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">64-bit with IPv6 &ndash;</emphasis> 8-byte
port number, 4-byte IP type, 16-byte IP address</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>process</literal> token
as follows:</para><screen>process,root,root,sys,root,sys,0,0,0,0.0.0.0</screen><para>The following figure shows the format of a <literal>process</literal> token.</para><figure id="aparecord-fig-17"><title><literal>process</literal> Token Format</title><mediaobject><imageobject><imagedata entityref="process.epsi" width="100"/>
</imageobject><textobject><simpara>The preceding context describes the graphic.</simpara>
</textobject>
</mediaobject>
</figure>
</sect2><sect2 id="aparecord-30"><title><literal>return</literal> Token</title><indexterm><primary><literal>return</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary>system calls</primary><secondary><literal>return</literal> audit token</secondary>
</indexterm><itemizedlist><para>The <literal>return</literal> token contains the return status of the
system call (<literal>u_error</literal>) and the process return value (<literal>u_rval1</literal>). This token has three fields:</para><listitem><para>A token ID that identifies this token as a <literal>return</literal> token</para>
</listitem><listitem><para>The error status of the system call</para>
</listitem><listitem><para>The return value of the system call</para>
</listitem>
</itemizedlist><para>The <literal>return</literal> token is always returned as part of kernel-generated
audit records for system calls. In application auditing, this token indicates
exit status and other return values.</para><para>The <command>praudit</command> command displays the <literal>return</literal> token
for a system call as follows:</para><screen>return,failure: Operation now in progress,-1</screen><para>The <command>praudit -x</command> command displays the <literal>return</literal> token
as follows:</para><screen>&lt;return errval="failure: Operation now in progress" retval="-1/"&gt;</screen>
</sect2><sect2 id="aparecord-31"><title><literal>sequence</literal> Token</title><indexterm><primary>debugging sequence number</primary>
</indexterm><indexterm><primary><literal>sequence</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>sequence</literal> token contains a sequence number. This
token is useful for debugging. The <literal>sequence</literal> token has two
fields:</para><listitem><para>A token ID that identifies this token as a <literal>sequence</literal> token</para>
</listitem><listitem><para>A 32-bit unsigned long field that contains the sequence number</para>
</listitem>
</itemizedlist><para>The sequence number is incremented every time an audit record is added
to the audit trail. The <command>praudit</command> command displays the <literal>sequence</literal> token as follows:</para><screen>sequence,1292</screen><para><indexterm><primary><literal>sequence</literal> audit token</primary><secondary>and <literal>seq</literal> audit policy</secondary></indexterm><indexterm><primary><literal>seq</literal> audit policy</primary><secondary>and <literal>sequence</literal> token</secondary></indexterm>The <command>praudit -x</command> command
displays the <literal>sequence</literal> token as follows:</para><screen>&lt;sequence seq-num="1292"/&gt;</screen><note><para>The <literal>sequence</literal> token is output only when the <literal>seq</literal> audit policy option is active.</para>
</note>
</sect2><sect2 id="aparecord-32"><title><literal>socket</literal> Token</title><indexterm><primary>Internet-related tokens</primary><secondary><literal>socket</literal> token</secondary>
</indexterm><indexterm><primary><literal>socket</literal> audit token</primary>
</indexterm><itemizedlist><para>The <literal>socket</literal> token contains information that describes
an Internet socket. In some instances, the token has four fields:</para><listitem><para>A token ID that identifies this token as a <literal>socket</literal> token</para>
</listitem><listitem><para>A socket type field that indicates the type of socket referenced,
either TCP, UDP, or UNIX</para>
</listitem><listitem><para>The local port</para>
</listitem><listitem><para>The local IP address</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays this instance of the <literal>socket</literal> token as follows:</para><screen>socket,0x0002,0x83b1,localhost</screen><itemizedlist><para>In most instances, the token has eight fields:</para><listitem><para>A token ID that identifies this token as a <literal>socket</literal> token</para>
</listitem><listitem><para>The socket domain</para>
</listitem><listitem><para>A socket type field that indicates the type of socket referenced,
either TCP, UDP, or UNIX</para>
</listitem><listitem><para>The local port</para>
</listitem><listitem><para>The address type, either IPv4 or IPv6</para>
</listitem><listitem><para>The local IP address</para>
</listitem><listitem><para>The remote port</para>
</listitem><listitem><para>The remote IP address</para>
</listitem>
</itemizedlist><para>Since the Solaris 8 release, the Internet address can be displayed
in IPv4 format or IPv6 format. The IPv4 address uses 4 bytes. The IPv6 address
uses 1 byte to describe the address type, and 16 bytes to describe the address.</para><para>The <command>praudit</command> command displays the <literal>socket</literal> token
as follows:</para><screen>socket,0x0002,0x0002,0x83cf,example1,0x2383,server1.Subdomain.Domain.COM</screen><para>The <command>praudit -x</command> command describes the <literal>socket</literal> token
fields. The lines are wrapped for display purposes.</para><screen>&lt;socket sock_domain="0x0002" sock_type="0x0002" lport="0x83cf" 
laddr="example1" fport="0x2383" faddr="server1.Subdomain.Domain.COM"/&gt;</screen>
</sect2><sect2 id="aparecord-33"><title><literal>subject</literal> Token</title><indexterm><primary><literal>subject</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>subject</literal> token describes a user who performs or
attempts to perform an operation. The format is the same as the <literal>process</literal> token.
The <literal>subject</literal> token has nine fields:</para><listitem><para>A token ID that identifies this token as a <literal>subject</literal> token</para>
</listitem><listitem><para>The audit ID</para>
</listitem><listitem><para>The effective user ID</para>
</listitem><listitem><para>The effective group ID</para>
</listitem><listitem><para>The real user ID</para>
</listitem><listitem><para>The real group ID</para>
</listitem><listitem><para>The process ID</para>
</listitem><listitem><para>The audit session ID</para>
</listitem><listitem><para>A terminal ID that consists of a device ID and a machine ID</para>
</listitem>
</itemizedlist><para>The audit ID, user ID, group ID, process ID, and session ID are long
instead of short.</para><note><para>The <literal>subject</literal> token fields for the session ID,
the real user ID, or the real group ID might be unavailable. The value is
then set to <literal>-1</literal>.</para>
</note><para>Any token that contains a terminal ID has several variations. The <command>praudit</command> command hides these variations. So, the terminal ID is handled
the same way for any token that contains a terminal ID. The terminal ID is
either an IP address and port number, or a device ID. A device ID, such as
the serial port that is connected to a modem, can be zero. The terminal ID
is specified in one of several formats.</para><itemizedlist><para>The terminal ID for device numbers is specified as follows:</para><listitem><para><emphasis role="strong">32-bit applications &ndash;</emphasis> 4-byte
device number, 4 bytes unused</para>
</listitem><listitem><para><emphasis role="strong">64-bit applications &ndash;</emphasis> 8-byte
device number, 4 bytes unused</para>
</listitem>
</itemizedlist><itemizedlist><para>In releases prior to the Solaris 8 release, the terminal ID for
port numbers is specified as follows:</para><listitem><para><emphasis role="strong">32-bit applications &ndash;</emphasis> 4-byte
port number, 4-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">64-bit applications &ndash;</emphasis> 8-byte
port number, 4-byte IP address</para>
</listitem>
</itemizedlist><itemizedlist><para>Since the Solaris 8 release, the terminal ID for port numbers is
specified as follows:</para><listitem><para><emphasis role="strong">32-bit with IPv4 &ndash;</emphasis> 4-byte
port number, 4-byte IP type, 4-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">32-bit with IPv6 &ndash;</emphasis> 4-byte
port number, 4-byte IP type, 16-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">64-bit with IPv4 &ndash;</emphasis> 8-byte
port number, 4-byte IP type, 4-byte IP address</para>
</listitem><listitem><para><emphasis role="strong">64-bit with IPv6 &ndash;</emphasis> 8-byte
port number, 4-byte IP type, 16-byte IP address</para>
</listitem>
</itemizedlist><para>The <literal>subject</literal> token is always returned as part of kernel-generated
audit records for system calls. The <command>praudit</command> command displays
the <literal>subject</literal> token as follows:</para><screen>subject,jdoe,root,staff,root,staff,424,223,0 0 example1</screen><para>The following figure shows the format of the <literal>subject</literal> token.</para><figure id="aparecord-fig-25"><title><literal>subject</literal> Token Format</title><mediaobject><imageobject><imagedata entityref="process.epsi" width="100"/>
</imageobject><textobject><simpara>The preceding context describes the graphic.</simpara>
</textobject>
</mediaobject>
</figure>
</sect2><sect2 id="aparecord-34"><title><literal>text</literal> Token</title><indexterm><primary><literal>text</literal> audit token</primary><secondary>format</secondary>
</indexterm><itemizedlist><para>The <literal>text</literal> token contains a text string. This token
has three fields:</para><listitem><para>A token ID that identifies this token as a <literal>text</literal> token</para>
</listitem><listitem><para>The length of the text string</para>
</listitem><listitem><para>The text string itself</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>text</literal> token
as follows:</para><screen>text,logout jdoe</screen>
</sect2><sect2 id="aparecord-35"><title><literal>trailer</literal> Token</title><indexterm><primary><literal>trailer</literal> audit token</primary><secondary>format</secondary>
</indexterm><indexterm><primary><literal>trailer</literal> audit token</primary><secondary>order in audit record</secondary>
</indexterm><para>The two tokens, <literal>header</literal> and <literal>trailer</literal>,
are special in that they distinguish the end points of an audit record and
bracket all the other tokens. A <literal>header</literal> token begins an
audit record. A <literal>trailer</literal> token ends an audit record. The <literal>trailer</literal> token is an optional token. The <literal>trailer</literal> token
is added as the last token of each record only when the <literal>trail</literal> audit
policy option has been set.</para><para><indexterm><primary><command>auditreduce</command> command</primary><secondary>trailer tokens, and</secondary></indexterm>When an audit record
is generated with trailers turned on, the <command>auditreduce</command> command
can verify that the trailer correctly points back to the record header. The <literal>trailer</literal> token supports backward seeks of the audit trail.</para><itemizedlist><para>The <literal>trailer</literal> token has three fields:</para><listitem><para>A token ID that identifies this token as a <literal>trailer</literal> token</para>
</listitem><listitem><para>A pad number to aid in marking the end of the record</para>
</listitem><listitem><para>The total number of characters in the audit record, including
both the <literal>header</literal> and <literal>trailer</literal> tokens</para>
</listitem>
</itemizedlist><para><indexterm><primary><literal>trailer</literal> audit token</primary><secondary><command>praudit</command> display</secondary></indexterm>The <command>praudit</command> command displays the <literal>trailer</literal> token, without
the second field, as follows:</para><screen>trailer,136</screen>
</sect2><sect2 id="auditref-27"><title><literal>uauth</literal> Token</title><indexterm><primary><literal>uauth</literal> audit token</primary>
</indexterm><para>The <literal>uauth</literal> token records the use of authorization
with a command or action.</para><itemizedlist><para>The <literal>uauth</literal> token contains the following fields:</para><listitem><para>A token ID that identifies this token as a <literal>uauth</literal> token</para>
</listitem><listitem><para>The length of the text in the following field</para>
</listitem><listitem><para>A list of authorizations</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>uauth</literal> token
as follows:</para><screen>use of authorization,solaris.admin.printer.delete</screen>
</sect2><sect2 id="auditref-15"><title><literal>zonename</literal> Token</title><indexterm><primary><literal>zonename</literal> audit token</primary>
</indexterm><para>The <literal>zonename</literal> token records the zone in which the
audit event occurred. The string &ldquo;global&rdquo; indicates audit events
that occur in the global zone.</para><itemizedlist><para>The <literal>zonename</literal> token contains the following fields:</para><listitem><para>A token ID that identifies this token as a <literal>zonename</literal> token</para>
</listitem><listitem><para>The length of the text in the following field</para>
</listitem><listitem><para>The name of the zone</para>
</listitem>
</itemizedlist><para>The <command>praudit</command> command displays the <literal>zonename</literal> token
as follows:</para><screen>zonename,graphzone</screen>
</sect2>
</sect1>
</chapter><?Pub *0000149139 0?>