<?Pub UDT _bookmark _target?><?Pub EntList bsol dash hellip gt lt minus?><?Pub CX solbook(book(title()bookinfo()part()part(title()partintro()chapter()?><chapter id="bart-1"><?Pub Tag atict:info tracking="off" ref="0"?><?Pub Tag atict:user
user="sharonr" fullname="Sharon Veach"?><title>Using the Basic Audit Reporting
Tool (Tasks)</title><indexterm><primary>new features</primary><secondary>BART</secondary>
</indexterm><highlights><para>This chapter describes how to create a manifest of the files on a system
and how to use that manifest to check the integrity of the system. The Basic
Audit Reporting Tool (BART) enables you to comprehensively validate systems
by performing file-level checks of a system over time.</para><itemizedlist><para>The following is a list of the information in this chapter:</para><listitem><para><olink targetptr="bart-1zyx" remap="internal">Using BART (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="bart-2" remap="internal">Basic Audit Reporting Tool (Overview)</olink></para>
</listitem><listitem><para><olink targetptr="bart-4" remap="internal">Using BART (Tasks)</olink></para>
</listitem><listitem><para><olink targetptr="bart-13" remap="internal">BART Manifest, Rules File, and
Reporting (Reference)</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="bart-2"><title>Basic Audit Reporting Tool (Overview)</title><indexterm><primary>Basic Audit Reporting Tool</primary><see>BART</see>
</indexterm><indexterm><primary>BART</primary><secondary>overview</secondary>
</indexterm><para>BART is a file tracking tool that operates entirely at the file system
level. Using BART gives you the ability to quickly, easily, and reliably gather
information about the components of the software stack that is installed on
deployed systems. Using BART can greatly reduce the costs of administering
a network of systems by simplifying time-consuming administrative tasks.</para><para><indexterm><primary>control manifests (BART)</primary></indexterm><indexterm><primary>manifests</primary><secondary>control</secondary></indexterm><indexterm><primary>reports</primary><secondary>BART</secondary></indexterm>BART enables
you to determine what file-level changes have occurred on a system, relative
to a known baseline. You use BART to create a baseline or <emphasis>control</emphasis> manifest
from a fully installed and configured system. You can then compare this baseline
with a snapshot of the system at a later time, generating a report that lists
file-level changes that have occurred on the system since it was installed.</para><para><indexterm><primary><command>bart</command> command</primary></indexterm>The <command>bart</command> command is a standard UNIX command. You can redirect the output
of the <command>bart</command> command to a file for later processing.</para><sect2 id="bart-2a"><title>BART Features</title><para>BART has been designed with an emphasis on a simple syntax that is both
powerful and flexible. The tool enables you to generate manifests of a given
system over time. Then, when the system's files need to be validated, you
can generate a report by comparing the old and new manifests. Another way
to use BART is to generate manifests of several similar systems and run system-to-system
comparisons. The main difference between BART and existing auditing tools
is that BART is flexible, both in terms of what information is tracked and
what information is reported.</para><itemizedlist><para>Additional benefits and uses of BART include the following:</para><listitem><para>Provides an efficient and easy method for cataloging a system
that is running the Solaris software at the file level.</para>
</listitem><listitem><para>Enables you to define which files to monitor and gives you
the ability to modify profiles when necessary. This flexibility allows you
to monitor local customizations and enables you to reconfigure software easily
and efficiently.</para>
</listitem><listitem><para>Ensures that systems are running reliable software.</para>
</listitem><listitem><para>Allows you to monitor file-level changes of a system over
time, which can help you locate corrupted or unusual files.</para>
</listitem><listitem><para>Helps you troubleshoot system performance issues.</para>
</listitem>
</itemizedlist>
</sect2><sect2 id="bart-3"><title>BART Components</title><indexterm><primary>components</primary><secondary>BART</secondary>
</indexterm><indexterm><primary>BART</primary><secondary>components</secondary>
</indexterm><itemizedlist><para>BART has two main components and one optional component:</para><listitem><para>BART Manifest</para>
</listitem><listitem><para>BART Report</para>
</listitem><listitem><para>BART Rules File</para>
</listitem>
</itemizedlist><sect3 id="eypoq"><title>BART Manifest</title><indexterm><primary>new features</primary><secondary>commands</secondary><tertiary><command>bart create</command></tertiary>
</indexterm><indexterm><primary><command>bart create</command> command</primary>
</indexterm><indexterm><primary>manifests</primary><seealso><command>bart create</command></seealso>
</indexterm><para>You use the <command>bart create</command> command to take a file-level
snapshot of a system at a particular time. The output is a catalog of files
and file attributes called a <emphasis>manifest</emphasis>. The manifest lists
information about all the files or specific files on a system. It contains
information about attributes of files, which can include some uniquely identifying
information, such as an MD5 checksum. For more information about the MD5 checksum,
see the <olink targetdoc="refman" targetptr="md5-3ext" remap="external"><citerefentry><refentrytitle>md5</refentrytitle><manvolnum>3EXT</manvolnum></citerefentry></olink> man
page. A manifest can be stored and transferred between client and server systems.</para><note><para>BART does <emphasis>not</emphasis> cross file system boundaries,
with the exception of file systems of the same type. This constraint makes
the output of the <command>bart create</command> command more predictable.
For example, without arguments, the <command>bart create</command> command
catalogs all UFS file systems under the root (<filename>/</filename>) directory.
However, no NFS or TMPFS file systems or mounted CD-ROMs would be cataloged.
When creating a manifest, do not attempt to audit file systems on a network.
Note that using BART to monitor networked file systems can consume large resources
to generate manifests that will have little value.</para>
</note><para>For more information about BART manifests, see <olink targetptr="bart-14" remap="internal">BART
Manifest File Format</olink>.</para>
</sect3><sect3 id="bart-3b"><title>BART Report</title><indexterm><primary>reporting tool</primary><see><command>bart compare</command></see>
</indexterm><para>The report tool has three inputs: the two manifests to be compared and
an optional user-provided rules file that indicates which discrepancies are
to be flagged.</para><para><indexterm><primary>new features</primary><secondary>commands</secondary><tertiary><command>bart compare</command></tertiary></indexterm><indexterm><primary><command>bart compare</command> command</primary></indexterm><indexterm><primary>test manifests</primary></indexterm><indexterm><primary>manifests</primary><secondary>test</secondary></indexterm>You use the <command>bart compare</command> command
to compare two manifests, a <emphasis>control manifest</emphasis> and a <emphasis>test manifest</emphasis>. These manifests must be prepared with the same file
systems, options, and rules file that you use with the <command>bart create</command> command.</para><para>The output of the <command>bart compare</command> command is a report
that lists per-file discrepancies between the two manifests. A <emphasis>discrepancy</emphasis> is a change to any attribute for a given file that is cataloged
for both manifests. Additions or deletions of file entries between the two
manifests are also considered discrepancies.</para><itemizedlist><para>There are two levels of control when reporting discrepancies:</para><listitem><para>When generating a manifest</para>
</listitem><listitem><para>When producing reports</para>
</listitem>
</itemizedlist><para>These levels of control are intentional, since generating a manifest
is more costly than reporting discrepancies between two manifests. Once you
have created manifests, you have the ability to compare manifests from different
perspectives by running the <command>bart compare</command> command with different
rules files.</para><para>For more information about BART reports, see <olink targetptr="bart-25xyz" remap="internal">BART Reporting</olink>.</para>
</sect3><sect3 id="bart-3c"><title>BART Rules File</title><indexterm><primary>rules file (BART)</primary>
</indexterm><para>The <emphasis>rules file</emphasis> is a text file that you can optionally
use as input to the <command>bart</command> command. This file uses inclusion
and exclusion rules. A rules file is used to create custom manifests and reports.
A rules file enables you to express in a concise syntax which sets of files
you want to catalog, as well as which attributes to monitor for any given
set of files. When you compare manifests, the rules file aids in flagging
discrepancies between the manifests. Using a rules file is an effective way
to gather specific information about files on a system.</para><itemizedlist><para>You create a rules file by using a text editor. With a rules file, you
can perform the following tasks:</para><listitem><para>Use the <command>bart create</command> command to create a
manifest that lists information about all or specific files on a system.</para>
</listitem><listitem><para>Use the <command>bart compare</command> command to generate
a report that monitors specific attributes of a file system.</para>
</listitem>
</itemizedlist><note><para>You can create several rules files for different purposes. However,
if you create a manifest by using a rules file, you must use the same rules
file when you compare the manifests. If you do not use the same rules file
when comparing manifests that were created with a rules file, the output of
the <command>bart compare</command> command will list many invalid discrepancies.</para><para>A rules file can also contain syntax errors and other ambiguous
information as a result of user error. If a rules file does contain misinformation,
these errors will also be reported.</para>
</note><para>Using a rules file to monitor specific files and file attributes on
a system requires planning. Before you create a rules file, decide which files
and file attributes on the system you want to monitor. Depending on what you
are trying to accomplish, you might use a rules file to create manifests,
compare manifests, or for purposes.</para><para>For more information about the BART rules file, see <olink targetptr="bart-18" remap="internal">BART Rules File Format</olink> and the <olink targetdoc="group-refman" targetptr="bart-rules-4" remap="external"><citerefentry><refentrytitle>bart_rules</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect3>
</sect2>
</sect1><sect1 id="bart-1zyx"><title>Using BART (Task Map)</title><indexterm><primary>task maps</primary><secondary>Using BART task map</secondary>
</indexterm><indexterm><primary>BART</primary><secondary>task map</secondary>
</indexterm><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="110*"/><colspec colname="col2" colwidth="167*"/><colspec colname="colspec1" colwidth="119*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Create a manifest.</para>
</entry><entry><para>Obtain a manifest that lists information about every file that is installed
on a system.</para>
</entry><entry><para><olink targetptr="bart-5" remap="internal">How to Create a Manifest</olink></para>
</entry>
</row><row><entry><para>Create a custom manifest.</para>
</entry><entry><para>Obtain a manifest that lists information about specific files that are
installed on a system in one of the following ways:</para><itemizedlist><listitem><para>By specifying a subtree</para>
</listitem><listitem><para>By specifying a file name</para>
</listitem><listitem><para>By using  a rules file</para>
</listitem>
</itemizedlist>
</entry><entry><para></para><para></para><para></para><para></para><para><olink targetptr="bart-5bcd" remap="internal">How to Customize a Manifest</olink></para><para></para><para></para>
</entry>
</row><row><entry><para>Compare manifests for the same system over time. Or, compare manifests
for different systems with a control system manifest.</para>
</entry><entry><para>Obtain a report that compares changes to a system over time. Or, obtain
a report that compares one or several systems to control system.</para>
</entry><entry><para><olink targetptr="bart-9" remap="internal">How to Compare Manifests for the Same System
Over Time</olink></para><para><olink targetptr="bart-10" remap="internal">How to Compare Manifests From a Different
System With the Manifest of a Control System</olink></para>
</entry>
</row><row><entry><para>(Optional) Customize a BART report.</para>
</entry><entry><para>Obtain a custom BART report in one of the following ways:</para><itemizedlist><listitem><para>By specifying attributes.</para>
</listitem><listitem><para>By using a rules file.</para>
</listitem>
</itemizedlist>
</entry><entry><para></para><para></para><para></para><para><olink targetptr="bart-11" remap="internal">How to Customize a BART Report by Specifying
File Attributes</olink></para><para><olink targetptr="bart-12" remap="internal">How to Customize a BART Report by Using a
Rules File</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="bart-4"><title>Using BART (Tasks)</title><para><indexterm><primary>using</primary><secondary>BART</secondary></indexterm>You
can run the <command>bart</command> command as a regular user, superuser,
or a user who has assumed the Primary Administrator role.  If you run the <command>bart</command> command as a regular user, you will only be able to catalog
and monitor files that you have permission to access, for example, information
about files in your home directory. The advantage of  becoming superuser when
you run the <command>bart</command> command is that the manifests you create
will contain information about hidden and private files that you might want
to monitor. If you need to catalog and monitor information about files that
have restricted permissions, for example, the <filename>/etc/passwd</filename> or <filename>/etc/shadow</filename> file, run the <command>bart</command> command as superuser
or assume an equivalent role. For more information about using role-based
access control, see <olink targetptr="rbactask-15" remap="internal">Configuring RBAC (Task
Map)</olink>.</para><sect2 id="bart-aa"><title>BART Security Considerations</title><indexterm><primary>security</primary><secondary>BART</secondary>
</indexterm><indexterm><primary>BART</primary><secondary>security considerations</secondary>
</indexterm><para>Running the <command>bart</command> command as superuser makes the output
readable by anyone. This output might contain file names that are intended
to be private. If you become superuser when you run the <command>bart</command> command,
take appropriate measures to protect the output. For example, use options
that generate output files with restrictive permissions.</para><note><para>The procedures and examples in this chapter show the <command>bart</command> command
run by superuser. Unless otherwise specified, running the <command>bart</command> command
as superuser is optional.</para>
</note>
</sect2><task id="bart-5"><title>How to Create a Manifest</title><tasksummary><para>You can create a manifest of a system immediately after an initial Solaris
software installation. This type of manifest will provide you with a baseline
for comparing changes to the same system over time. Or, you can use this manifest
to compare with the manifests for different systems. For example, if you take
a snapshot of each system on your network, and then compare each test manifest
with the control manifest, you can quickly determine what you need to do to
synchronize the test system with the baseline configuration.<indexterm><primary><command>bart create</command> command</primary></indexterm></para>
</tasksummary><procedure>&rolePAstep;<step><para><indexterm><primary sortas="r1"><option>R</option> option</primary><secondary><command>bart create</command></secondary></indexterm><indexterm><primary sortas="i2"><option>I</option> option</primary><secondary><command>bart create</command> command</secondary></indexterm><indexterm><primary><option>i</option> option</primary><secondary><command>bart create</command> command</secondary></indexterm><indexterm><primary><option>n</option> option</primary><secondary><command>bart create</command> command</secondary></indexterm>After installing the
Solaris software, create a control manifest and redirect the output to a file.</para><screen># bart create <replaceable>options &gt; control-manifest</replaceable></screen><variablelist><varlistentry><term><option>R</option></term><listitem><para>Specifies the root directory for the manifest. All paths specified
by the rules will be interpreted relative to this directory. All paths reported
in the manifest will be relative to this directory.</para>
</listitem>
</varlistentry><varlistentry><term><option>I</option></term><listitem><para>Accepts a list of individual files to be cataloged, either
on the command line or read from standard input.</para>
</listitem>
</varlistentry><varlistentry><term><option>r</option></term><listitem><para>Is the name of the rules file for this manifest. Note that <literal>&ndash;</literal>, when used with the <option>r</option> option, will be read
the rules file from standard input.</para>
</listitem>
</varlistentry><varlistentry><term><option>n</option></term><listitem><para>Turns off content signatures for all regular files in the
file list. This option can be used to improve performance. Or, you can use
this option if the contents of the file list are expected to change, as in
the case of system log files.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step><para>Examine the contents of the manifest.</para>
</step><step performance="required"><para>Save the manifest for future use.</para><para>Choose a meaningful name for the manifest. For example, use the system
name and date that the manifest was created.</para>
</step>
</procedure><example id="egysq"><title>Creating a Manifest That Lists Information About Every File on a System</title><para>If you run the <command>bart create</command> command without any options,
information about every file that is installed on the system will be cataloged.
Use this type of manifest as a baseline when you are installing many systems
from a central image. Or, use this type of manifest to run comparisons when
you want to ensure that the installations are identical.</para><para>For example:</para><screen># <userinput>bart create</userinput>
! Version 1.0
! Thursday, December 04, 2003 (16:17:39)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/ D 1024 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3fd9ea47 0 0
/.java D 512 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3f8dc04d 0 10
/.java/.userPrefs D 512 40700 user::rwx,group::---,mask:---
other:--- 3f8dc06b 010
/.java/.userPrefs/.user.lock.root F 0 100600 user::rw-
group::---,mask:---,other:--- 3f8dc06b 0 10 -
/.java/.userPrefs/.userRootModFile.root F 0 100600 user::rw-,
group::---,mask:---,other:--- 3f8dc0a1 0 10 -
/.smc.properties F 1389 100644 user::rw-,group::r--,mask:r--
other:r-- 3f8dca0c0 10
.
.
.
/var/sadm/pkg/SUNWdtmad/install/depend F 932 100644 user::rw-,
group::r--,mask:r--,other:r-- 3c23a19e 0 0 -
/var/sadm/pkg/SUNWdtmad/pkginfo F 594 100644 user::rw-
group::r--,mask:r--,other:r-- 3f81e416 0 0 -
/var/sadm/pkg/SUNWdtmad/save D 512 40755 user::rwx,group::r-x
mask:r-x,other:r-x 3f81e416 0 0
/var/sadm/pkg/SUNWdtmaz D 512 40755 user::rwx,group::r-x
mask:r-x,other:r-x 3f81e41b 0 0
/var/sadm/pkg/TSIpgxw/save D 512 40755 user::rwx
group::r-x,mask:r-x,other:r-x 3f81e892 0 0
.
.
.</screen><para>Each manifest consists of a header and entries. Each manifest file entry
is a single line, depending on the file type. For example, for each manifest
entry in the preceding output, type <literal>F</literal> specifies a file
and type <literal>D</literal> specifies a directory. Also listed is information
about size, content, user ID, group ID, and permissions. File entries in the
output are sorted by the encoded versions of the file names to correctly handle
special characters. All entries are sorted in ascending order by file name.
All nonstandard file names, such as those that contain embedded newline or
tab characters, have the nonstandard characters quoted before being sorted.</para><para>Lines that begin with <literal>!</literal> supply metadata about the
manifest. The manifest version line indicates the manifest specification version.
The date line shows the date on which the manifest was created, in date form.
See the <olink targetdoc="group-refman" targetptr="date-1" remap="external"><citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page. Some lines are ignored by the manifest comparison tool. Ignored lines
include blank lines, lines that consist only of white space, and comments
that begin with <literal>#</literal>. </para>
</example>
</task><task id="bart-5bcd"><title>How to Customize a Manifest</title><indexterm><primary>customizing</primary><secondary>manifests</secondary>
</indexterm><indexterm><primary>manifests</primary><secondary>customizing</secondary>
</indexterm><tasksummary><itemizedlist><para>You can customize a manifest in one of the following ways:</para><listitem><para>By specifying a subtree</para><para>Creating a manifest for
an individual subtree on a system is an efficient way to monitor changes to
specific files, rather than the entire contents of a large directory. You
can create a baseline manifest of a specific subtree on your system, then
periodically create test manifests of the same subtree. Use the <command>bart
compare</command> command to compare the control manifest with the test manifest.
By using this option, you are able to efficiently monitor important file systems
to determine whether any files have been compromised by an intruder.</para>
</listitem><listitem><para>By specifying a file name</para><para>Since creating a manifest
that catalogs the entire system is more time-consuming, takes up more space,
and is more costly, you might choose to use this option of the <command>bart</command> command
when you want to only list information about a specific file or files on a
system.</para>
</listitem><listitem><para>By using a rules file</para><para>You use a rules file to
create custom manifests that list information about specific files and specific
subtrees on a given system. You can also use a rules file to monitor specific
file attributes. Using a rules file to create and compare manifests gives
you the flexibility to specify multiple attributes for more than one file
or subtree. Whereas, from the command line, you can only specify a global
attribute definition that applies to all files for each manifest you create
or report you generate.</para>
</listitem>
</itemizedlist>
</tasksummary><procedure><step><para>Determine which files you want to catalog and monitor.</para>
</step>&rolePAstep;<step><para>After installing the Solaris software, create a custom manifest
by using one of the following options:</para><itemizedlist><listitem><para>By specifying a subtree:</para><screen># bart create -R <replaceable>root-directory</replaceable></screen>
</listitem><listitem><para>By specifying a file name or file names:</para><screen># bart create -I <replaceable>filename...</replaceable></screen><para>For example:</para><screen># <userinput>bart create -I /etc/system /etc/passwd /etc/shadow</userinput></screen>
</listitem><listitem><para>By using a rules file:</para><screen># bart create -r <replaceable>rules-file</replaceable></screen>
</listitem>
</itemizedlist>
</step><step><para>Examine the contents of the manifest.</para>
</step><step performance="required"><para>Save the manifest for future use.</para>
</step>
</procedure><example id="egysp"><title>Creating a Manifest by Specifying a Subtree</title><para>This example shows how to create a manifest that contains information
about the files in the <filename>/etc/ssh</filename> subtree only.</para><screen># <userinput>bart create -R /etc/ssh</userinput>
! Version 1.0
! Saturday, November 29, 2003 (14:05:36)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/ D 512 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3f81eab9 0 3
/ssh_config F 861 100644 user::rw-,group::r--,mask:r--,
other:r-- 3f81e504 0 3 422453ca0e2348cd9981820935600395
/ssh_host_dsa_key F 668 100600 user::rw-,group::---,mask:---,
other:--- 3f81eab9 0 0 5cc28cdc97e833069fd41ef89e4d9834
/ssh_host_dsa_key.pub F 602 100644 user::rw-,group::r--,mask:r--,
other:r-- 3f81eab9 0 0 16118c736995a4e4754f5ab4f28cf917
/ssh_host_rsa_key F 883 100600 user::rw-,group::---,mask:---,
other:--- 3f81eaa2 0 0 6ff17aa968ecb20321c448c89a8840a9
/ssh_host_rsa_key.pub F 222 100644 user::rw-,group::r--,mask:r--,
other:r-- 3f81eaa2 0 0 9ea27617efc76058cb97aa2caa6dd65a
.
.
.</screen>
</example><example id="egyso"><title>Customizing a Manifest by Specifying a File Name</title><para>This example shows how to create a manifest that lists only information
about the <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename> files
on a system. </para><screen># <userinput>bart create -I /etc/passwd /etc/shadow</userinput>
! Version 1.0
! Monday, December 15, 2003 (16:28:55)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/etc/passwd F 542 100444 user::r--,group::r--,mask:r--,
other:r-- 3fcfd45b 0 3 d6
84554f85d1de06219d80543174ad1a
/etc/shadow F 294 100400 user::r--,group::---,mask:---,
other:--- 3f8dc5a0 0 3 fd
c3931c1ae5ee40341f3567b7cf15e2</screen><para>By comparison, the following is the standard output of the <command>ls <option>al</option></command> command for the <filename>/etc/passwd</filename> and
the <filename>/etc/shadow</filename> files on the same system.</para><screen># ls -al /etc/passwd
-r--r--r--   1 root     sys          542 Dec  4 17:42 /etc/passwd</screen><screen># ls -al /etc/shadow
-r--------   1 root     sys          294 Oct 15 16:09 /etc/shadow</screen>
</example><example id="egyss"><title>Customizing a Manifest by Using a Rules File</title><para>This example shows how to create a manifest by using a rules file to
catalog only those files in the <filename>/etc</filename> directory. The same
rules file includes directives to be used by the <command>bart compare</command> command
for monitoring changes to the <literal>acl</literal> attribute of the <filename>/etc/system</filename> file.</para><itemizedlist><listitem><para>Use a text editor to create a rules file that catalogs only
those files in the <filename>/etc</filename> directory.</para><screen># List information about all the files in the /etc directory.

CHECK all
/etc

# Check only acl changes in the /etc/system file

IGNORE all
CHECK acl
/etc/system</screen><para>For more information about creating a rules file, see <olink targetptr="bart-3c" remap="internal">BART Rules File</olink>.</para>
</listitem><listitem><para>Create a control manifest by using the rules file you created.</para><screen># <userinput>bart create -r <replaceable>etc.rules-file</replaceable> &gt; <replaceable>etc.system.control-manifest</replaceable></userinput>
! Version 1.0
! Thursday, December 11, 2003 (21:51:32)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/etc/system F 1883 100644 user::rw-,group::r--,mask:r--,
other:r-- 3f81db61 0 3</screen>
</listitem><listitem><para>Create a test manifest whenever you want to monitor changes
to the system. Prepare the test manifest identically to the control manifest
by using the same <command>bart</command> options and the same rules file. </para>
</listitem><listitem><para>Compare manifests by using the same rules file.</para>
</listitem>
</itemizedlist>
</example>
</task><task id="bart-9"><title>How to Compare Manifests for the Same System Over
Time</title><tasksummary><para>Use this procedure when you want to monitor file-level changes to the
same system over time. This type of manifest can assist you in locating corrupted
or unusual files, detecting security breaches, or in troubleshooting performance
issues on a system.</para>
</tasksummary><procedure>&rolePAstep;<step><para>After installing the Solaris software, create a control manifest
of the files that you want to monitor on the system.<indexterm><primary sortas="r1"><option>R</option> option</primary><secondary><command>bart create</command></secondary></indexterm> <indexterm><primary><option>r</option> option</primary><secondary><command>bart create</command></secondary></indexterm><indexterm><primary><option>i</option> option</primary><secondary><command>bart create</command> command</secondary></indexterm> <indexterm><primary><option>p</option> option</primary><secondary><command>bart create</command></secondary></indexterm></para><screen># bart create -R /etc &gt; <replaceable>control-manifest</replaceable></screen>
</step><step><para>Create a test manifest that is prepared identically to the control
manifest whenever you want monitor changes to the system.</para><screen># bart create -R /etc &gt; <replaceable>test-manifest</replaceable></screen>
</step><step><para>Compare the control manifest with the test manifest.</para><screen># bart compare <replaceable>options</replaceable> <replaceable>control-manifest  test-manifest &gt; bart-report</replaceable></screen><variablelist><varlistentry><term><option>r</option></term><listitem><para>Is the name of the rules file for this comparison. Using the <option>r</option> option with the <literal>&ndash;</literal> means that the directives
will be read from standard input.</para>
</listitem>
</varlistentry><varlistentry><term><option>i</option></term><listitem><para>Allows the user to set global <literal>IGNORE</literal> directives
from the command line.</para>
</listitem>
</varlistentry><varlistentry><term><option>p</option></term><listitem><para>Is the programmatic mode that generates standard non-localized
output for programmatic parsing.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>control-manifest</replaceable></term><listitem><para>Is the output from the <command>bart create</command> command
for the control system.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>test-manifest</replaceable></term><listitem><para>Is the output from the <command>bart create</command> command
of the test system.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step><para>Examine the BART report for oddities.</para>
</step>
</procedure><example id="egysr"><title>Comparing Manifests for the Same System Over Time</title><para>This example shows how to monitor changes that have occurred in the <filename>/etc</filename> directory between two points in time. This type of comparison
enables you to quickly determine whether important files on the system have
been compromised.</para><itemizedlist><listitem><para>Create a control manifest.</para><screen># <userinput>bart create -R /etc &gt; system1.control.121203</userinput>
! Version 1.0
! Friday, December 12, 2003 (08:34:51)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/ D 4096 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3fd9dfb4 0 3
/.cpr_config F 2236 100644 user::rw-,group::r--,mask:r--,other:r--
3fd9991f 0 0
67cfa2c830b4ce3e112f38c5e33c56a2
/.group.lock F 0 100600 user::rw-,group::---,mask:---,other:--- 3f81f14d
0 1 d41
d8cd98f00b204e9800998ecf8427e
/.java D 512 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3f81dcb5 0 2
/.java/.systemPrefs D 512 40755 user::rwx,group::r-x,mask:r-x,
other:r-x 3f81dcb7
.
.
.</screen>
</listitem><listitem><para>Create a test manifest when you want to monitor changes to
the <filename>/etc</filename> directory.</para><screen># <userinput>bart create -R /etc &gt; system1.test.121503</userinput>
Version 1.0
! Monday, December 15, 2003 (08:35:28)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/ D 4096 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3fd9dfb4 0 3
/.cpr_config F 2236 100644 user::rw-,group::r--,mask:r--,other:r--
3fd9991f 0 0
67cfa2c830b4ce3e112f38c5e33c56a2
/.group.lock F 0 100600 user::rw-,group::---,mask:---,other:---
3f81f14d 0 1 d41d8cd98f00b204e9800998ecf8427e
/.java D 512 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3f81dcb5 0 2
/.java/.systemPrefs D 512 40755 user::rwx,group::r-x,mask:r-x,
other:r-x 3f81dcb70 2
/.java/.systemPrefs/.system.lock F 0 100644 user::rw-,group::r--
,mask:r--,other:
r-- 3f81dcb5 0 2 d41d8cd98f00b204e9800998ecf8427e
/.java/.systemPrefs/.systemRootModFile F 0 100644 user::rw-,
group::r--,mask:r--,
other:r-- 3f81dd0b 0 2 d41d8cd98f00b204e9800998ecf8427e
.
.
.</screen>
</listitem><listitem><para>Compare the control manifest with the test manifest.</para><screen># <userinput>bart compare system1.control.121203 system1.test.121503</userinput>
/vfstab:
  mode  control:100644  test:100777
  acl  control:user::rw-,group::r--,mask:r--,other:r--  test:user::rwx,
group::rwx,mask:rwx,other:rwx</screen>
</listitem>
</itemizedlist><para>The preceding output indicates permissions on the <filename>vfstab</filename> file
have changed since the control manifest was created. This report can be used
to investigate whether ownership, date, content, or any other file attributes
have changed. Having this type of information readily available can assist
you in tracking down who might have tampered with the file and when the change
might have occurred.</para>
</example>
</task><task id="bart-10"><title>How to Compare Manifests From a Different System
With the Manifest of a Control System</title><tasksummary><para>You can run system to system comparisons, thereby enabling you to quickly
determine whether there are any file-level differences between a baseline
system and the other systems. For example, if you have installed a particular
version of the Solaris software on a baseline system, and you want to know
whether other systems have identical packages installed, you can create manifests
for those systems and then compare the test manifests with the control manifest.
This type of comparison will list any discrepancies in the file contents for
each test system that you compare with the control system.</para>
</tasksummary><procedure>&rolePAstep;<step><para>After installing the Solaris software, create a control manifest.</para><screen># bart create <replaceable>options</replaceable> &gt; <replaceable>control-manifest</replaceable></screen>
</step><step><para>Save the control manifest.</para>
</step><step><para>On the test system, use the same <literal>bart</literal> options
to create a manifest, and redirect the output to a file.</para><screen># bart create <replaceable>options</replaceable> &gt; <replaceable>test1-manifest</replaceable></screen><para>Choose a distinct and meaningful name for the test manifest.</para>
</step><step><para>Save the test manifest to a central location on the system until
you are ready to compare manifests.</para>
</step><step><para>When you want to compare manifests, copy the control manifest
to the location of the test manifest. Or, copy the test manifest to the control
system.</para><para>For example:</para><para># <userinput>cp <replaceable>control-manifest
/net/test-server/bart/manifests</replaceable></userinput></para><para>If the
test system is not an NFS-mounted system, use <literal>FTP</literal> or some
other reliable means to copy the control manifest to the test system.</para>
</step><step><para>Compare the control manifest with the test manifest and redirect
the output to a file.</para><screen># <userinput>bart compare <replaceable>control-manifest test1-manifest &gt; test1.report</replaceable></userinput></screen>
</step><step><para>Examine the BART report for oddities.</para>
</step><step><para>Repeat Step 4 through Step 9 for each test manifest that you want
to compare with the control manifest.</para><para>Use the same <command>bart</command> options
for each test system.</para>
</step>
</procedure><example id="egyst"><title>Comparing Manifests From Different Systems With the Manifest of a Control
System</title><para>This example describes how to monitor changes to the contents of the <filename>/usr/bin</filename> directory by comparing a control manifest with a test
manifest from a different system.</para><itemizedlist><listitem><para>Create a control manifest.</para><screen># <userinput>bart create -R /usr/bin &gt; control-manifest.121203</userinput>
!Version 1.0
! Friday, December 12, 2003 (09:19:00)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/ D 13312 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3fd9e925 0 2
/.s F 14200 104711 user::rwx,group::--x,mask:--x,other:--x
3f8dbfd6 0 1 8ec7e52d8a35ba3b054a6394cbf71cf6
/ControlPanel L 28 120777 - 3f81dc71 0 1 jre/bin/ControlPanel
/HtmlConverter L 25 120777 - 3f81dcdc 0 1 bin/HtmlConverter
/acctcom F 28300 100555 user::r-x,group::r-x,mask:r-x,other:r-x
3f6b5750 0 2 d6e99b19c847ab4ec084d9088c7c7608
/activation-client F 9172 100755 user::rwx,group::r-x,mask:r-x,
other:r-x 3f5cb907 0 1 b3836ad1a656324a6e1bd01edcba28f0
/adb F 9712 100555 user::r-x,group::r-x,mask:r-x,other:r-x
3f6b5736 0 2 5e026413175f65fb239ee628a8870eda
/addbib F 11080 100555 user::r-x,group::r-x,mask:r-x,other:r-x
3f6b5803 0 2 a350836c36049febf185f78350f27510
.
.
.</screen>
</listitem><listitem><para>Create a test manifest for each system that you want to compare
with the control system.</para><screen># <userinput>bart create -R /usr/bin &gt; system2-manifest.121503</userinput>
! Version 1.0
! Friday, December 15, 2003 (13:30:58)
# Format:
#fname D size mode acl dirmtime uid gid
#fname P size mode acl mtime uid gid
#fname S size mode acl mtime uid gid
#fname F size mode acl mtime uid gid contents
#fname L size mode acl lnmtime uid gid dest
#fname B size mode acl mtime uid gid devnode
#fname C size mode acl mtime uid gid devnode
/ D 13312 40755 user::rwx,group::r-x,mask:r-x,other:r-x 3fd9ea9c 0 2
/.s F 14200 104711 user::rwx,group::--x,mask:--x,other:--x
3f8dbfd6 0 1 8ec7e52d8a35ba3b054a6394cbf71cf6
/ControlPanel L 28 120777 - 3f81dc71 0 1 jre/bin/ControlPanel
/HtmlConverter L 25 120777 - 3f81dcdc 0 1 bin/HtmlConverter
/acctcom F 28300 100555 user::r-x,group::r-x,mask:r-x,other:
r-x 3f6b5750 0 2 d6e99b19c847ab4ec084d9088c7c7608
.
.
.</screen>
</listitem><listitem><para>When you want to compare manifests, copy the manifests to
the same location.</para><screen># <userinput>cp control-manifest /net/system2.central/bart/manifests</userinput></screen>
</listitem><listitem><para>Compare the control manifest with the test manifest.</para><screen># <userinput>bart compare control-manifest  system2.test &gt; system2.report</userinput>
/su:
  gid  control:3  test:1
/ypcat:
  mtime  control:3fd72511  test:3fd9eb23</screen>
</listitem>
</itemizedlist><para>The previous output indicates that the group ID of the <filename>su</filename> file
in the <filename>/usr/bin</filename> directory is not the same as that of
the control system. This information can be helpful in determining whether
a different version of the software was installed on the test system or if
possibly someone has tampered with the file.</para>
</example>
</task><task id="bart-11"><title>How to Customize a BART Report by Specifying File
Attributes</title><tasksummary><para>This procedure is optional and explains how to customize a BART report
by specifying file attributes from the command line. If you create a baseline
manifest that lists information about all the files or specific on your system,
you can run the <command>bart compare</command> command, specifying different
attributes, whenever you need to monitor changes to a particular directory,
subdirectory, file or files. You can run different types of comparisons for
the same manifests by specifying different file attributes from the command
line.</para>
</tasksummary><procedure><step><para>Determine which file attributes you want to monitor.</para>
</step>&rolePAstep;<step><para>After installing the Solaris software, create a control manifest.</para>
</step><step><para>Create a test manifest when you want to monitor changes.</para><para>Prepare the test manifest identically to the control manifest.</para>
</step><step><para>Compare the manifests.</para><para>For example:</para><screen># <userinput>bart compare -i dirmtime,lnmtime,mtime <replaceable>control-manifest.121503</replaceable></userinput> \
<userinput><replaceable>test-manifest.010504</replaceable> &gt; <replaceable>bart.report.010504</replaceable></userinput></screen><para>Note that a comma separates each attribute you specify in the command-line
syntax.</para>
</step><step><para>Examine the BART report for oddities.</para>
</step>
</procedure>
</task><task id="bart-12"><title>How to Customize a BART Report by Using a Rules
File</title><indexterm><primary>customizing a report (BART)</primary>
</indexterm><tasksummary><para>This procedure is also optional and explains how to customize a BART
report by using a rules file as input to the <command>bart compare</command> command.
By using a rules file, you can customize a BART report, which allows you the
flexibility of specifying multiple attributes for more than one file or subtree.
You can run different comparisons for the same manifests by using different
rules files.</para>
</tasksummary><procedure>&rolePAstep;<step><para>Determine which files and file attributes you want to monitor.</para>
</step><step><para>Use a text editor to create a rules file with the appropriate
directives.</para>
</step><step><para>After installing the Solaris software, create a control manifest
by using the rules file you created.</para><screen># bart create -r <replaceable>rules-file</replaceable> &gt; <replaceable>control-manifest</replaceable></screen>
</step><step><para>Create a test manifest that is prepared identically to the control
manifest.</para><screen># bart create -r <replaceable>rules-file</replaceable> &gt; <replaceable>test-manifest</replaceable></screen>
</step><step><para>Compare the control manifest with the test manifest by using the
same rules file.</para><screen># bart compare -r <replaceable>rules-file control-manifest test-manifest &gt; bart.report</replaceable></screen>
</step><step><para>Examine the BART report for oddities.</para>
</step>
</procedure><example id="egysu"><title>Customizing a BART Report by Using a Rules File</title><para>The following rules file includes directives for both the <command>bart
create</command> and the <command>bart compare</command> commands. The rules
file directs the <command>bart create</command> command to list information
about the contents of the <filename>/usr/bin</filename> directory. In addition,
the rules file directs the <command>bart compare</command> command to track
only size and content changes in the same directory.</para><screen># Check size and content changes in the /usr/bin directory.
# This rules file only checks size and content changes.
# See rules file example.

IGNORE all
CHECK size contents
/usr/bin</screen><itemizedlist><listitem><para>Create a control manifest by using the rules file you created.</para><screen># <userinput>bart create -r bartrules.txt &gt; usr_bin.control-manifest.121003</userinput></screen>
</listitem><listitem><para>Create a test manifest whenever you want to monitor changes
to the <filename>/usr/bin</filename> directory.</para><screen># <userinput>bart create -r bartrules.txt &gt; usr_bin.test-manifest.121103</userinput></screen>
</listitem><listitem><para>Compare the manifests by using the same rules file.</para><screen># <userinput>bart compare -r bartrules.txt usr_bin.control-manifest \</userinput>
<userinput>usr_bin.test-manifest</userinput></screen>
</listitem><listitem><para>Examine the output of the <command>bart compare</command> command.</para><screen> /usr/bin/gunzip:  add
/usr/bin/ypcat:
  delete</screen>
</listitem>
</itemizedlist><para>In the preceding output, the <command>bart compare</command> command
reported a discrepancy in the <filename>/usr/bin</filename> directory. This
output indicates that <filename>/usr/bin/ypcat</filename> file was deleted,
and the <filename>/usr/bin/gunzip</filename> file was added.</para>
</example>
</task>
</sect1><sect1 id="bart-13"><title>BART Manifest, Rules File, and Reporting (Reference)</title><itemizedlist><para>This section includes the following reference information:</para><listitem><para><olink targetptr="bart-14" remap="internal">BART Manifest File Format</olink></para>
</listitem><listitem><para><olink targetptr="bart-18" remap="internal">BART Rules File Format</olink></para>
</listitem><listitem><para><olink targetptr="bart-25xyz" remap="internal">BART Reporting</olink></para>
</listitem>
</itemizedlist><sect2 id="bart-14"><title>BART Manifest File Format</title><indexterm><primary>manifests</primary><secondary>file format</secondary>
</indexterm><indexterm><primary>files</primary><secondary>manifests (BART)</secondary>
</indexterm><indexterm><primary>files</primary><secondary>BART manifests</secondary>
</indexterm><para>Each manifest file entry is a single line, depending on the file type.
Each entry begins with <emphasis>fname</emphasis>, which is the name of the
file. To prevent parsing problems that are caused by special characters embedded
in file names, the file names are encoded. For more information, see <olink targetptr="bart-18" remap="internal">BART Rules File Format</olink>.</para><para>Subsequent fields represent the following file attributes:</para><variablelist><varlistentry><term><emphasis>type</emphasis></term><listitem><itemizedlist><para>Type of file with the following possible values:</para><listitem><para>B for a block device node</para>
</listitem><listitem><para>C for a character device node</para>
</listitem><listitem><para>D for a directory </para>
</listitem><listitem><para>F for a file</para>
</listitem><listitem><para>L for a symbolic link</para>
</listitem><listitem><para>P for a pipe</para>
</listitem><listitem><para>S for a socket</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term><emphasis>size</emphasis></term><listitem><para>File size in bytes.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>mode</emphasis></term><listitem><para>Octal number that represents the permissions of the file.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>acl</emphasis></term><listitem><para>ACL attributes for the file. For a file with ACL attributes,
this contains the output from <function>acltotext</function>.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>uid</emphasis></term><listitem><para>Numerical user ID of the owner of this entry.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>gid</emphasis></term><listitem><para>Numerical group ID of the owner of this entry.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>dirmtime</emphasis></term><listitem><para>Last modification time, in seconds, since 00:00:00 UTC, January
1, 1970, for directories.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>lnmtime</emphasis></term><listitem><para>Last modification time, in seconds, since 00:00:00 UTC, January
1, 1970, for links.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>mtime</emphasis></term><listitem><para>Last modification time, in seconds, since 00:00:00 UTC January
1, 1970, for files.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>contents</replaceable></term><listitem><para>Checksum value of the file. This attribute is only specified
for regular files. If you turn off context checking, or if checksums cannot
be computed, the value of this field is <literal>&ndash;</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>dest</replaceable></term><listitem><para>Destination of a symbolic link.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>devnode</replaceable></term><listitem><para>Value of the device node. This attribute is for character
device files and block device files only.</para>
</listitem>
</varlistentry>
</variablelist><para>For more information about BART manifests, see the <olink targetdoc="group-refman" targetptr="bart-manifest-4" remap="external"><citerefentry><refentrytitle>bart_manifest</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="bart-18"><title>BART Rules File Format</title><indexterm><primary>rules file format (BART)</primary>
</indexterm><para>The input files to the <command>bart</command> command are text files.
These files consist of lines that specify which files are to be included in
the manifest and which file attributes are to be included the report. The
same input file can be used across both pieces of BART functionality. Lines
that begin with <literal>#</literal>, blank lines, and lines that contain
white space are ignored by the tool.</para><itemizedlist><para>The input files have three types of directives:</para><listitem><para>Subtree directive, with optional pattern matching modifiers</para>
</listitem><listitem><para><literal>CHECK</literal> directive</para>
</listitem><listitem><para><literal>IGNORE</literal> directive</para>
</listitem>
</itemizedlist><example id="egysv"><title>Rules File Format</title><screen>&lt;Global CHECK/IGNORE Directives&gt;
&lt;subtree1&gt; [pattern1..]
&lt;IGNORE/CHECK Directives for subtree1&gt;

&lt;subtree2&gt; [pattern2..]
&lt;subtree3&gt; [pattern3..]
&lt;subtree4&gt; [pattern4..]
&lt;IGNORE/CHECK Directives for subtree2, subtree3, subtree4&gt;</screen>
</example><note><para>All directives are read in order, with later directives possibly
overriding earlier directives.</para>
</note><para>There is one subtree directive per line. The directive <emphasis>must</emphasis> begin
with an absolute pathname, followed by zero or more pattern matching statements.</para><sect3 id="bart-22bbb"><title>Rules File Attributes</title><indexterm><primary>rules file attributes</primary><see>keywords</see>
</indexterm><para>The <command>bart</command> command uses <literal>CHECK</literal> and <literal>IGNORE</literal> statements to define which attributes to track or ignore.
Each attribute has an associated keyword.</para><itemizedlist><para><indexterm><primary>attributes</primary><secondary>keyword in BART</secondary></indexterm><indexterm><primary>keywords</primary><secondary>attribute in BART</secondary></indexterm>The attribute <emphasis>keywords</emphasis> are
as follows:</para><listitem><para><literal>acl</literal></para>
</listitem><listitem><para><literal>all</literal></para>
</listitem><listitem><para><literal>contents</literal></para>
</listitem><listitem><para><literal>dest</literal></para>
</listitem><listitem><para><literal>devnode</literal></para>
</listitem><listitem><para><literal>dirmtime</literal></para>
</listitem><listitem><para><literal>gid</literal></para>
</listitem><listitem><para><literal>lnmtime</literal></para>
</listitem><listitem><para><literal>mode</literal></para>
</listitem><listitem><para><literal>mtime</literal></para>
</listitem><listitem><para><literal>size</literal></para>
</listitem><listitem><para><literal>type</literal></para>
</listitem><listitem><para><literal>uid</literal></para>
</listitem>
</itemizedlist><para>The <literal>all</literal> keyword refers to all file attributes.</para>
</sect3><sect3 id="bart-18ddd"><title>Quoting Syntax</title><indexterm><primary>quoting syntax in BART</primary>
</indexterm><indexterm><primary>rules file specification language</primary><see>quoting syntax</see>
</indexterm><para>The rules file specification language that BART uses is the standard
UNIX quoting syntax for representing nonstandard file names. Embedded tab,
space, newline, or special characters are encoded in their octal forms to
enable the tool to read file names. This nonuniform quoting syntax prevents
certain file names, such as those containing an embedded carriage return,
from being processed correctly in a command pipeline. The rules specification
language allows the expression of complex file name filtering criteria that
would be difficult and inefficient to describe by using shell syntax alone.</para><para>For more information about the BART rules file or the quoting syntax
used by BART, see the <olink targetdoc="group-refman" targetptr="bart-rules-4" remap="external"><citerefentry><refentrytitle>bart_rules</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page.</para>
</sect3>
</sect2><sect2 id="bart-25xyz"><title>BART Reporting</title><para>In default mode, the <command>bart compare</command> command, as shown
in the following example, will check all the files installed on the system,
with the exception of modified directory timestamps (<literal>dirmtime</literal>):</para><screen>CHECK all
IGNORE	dirmtime</screen><para>If you supply a rules file, then the global directives of <literal>CHECK
all</literal> and <literal>IGNORE dirmtime</literal>, in that order, are automatically
prepended to the rules file.</para><sect3 id="bart-16"><title>BART Output</title><indexterm><primary>log files</primary><secondary>BART</secondary><tertiary>programmatic output</tertiary>
</indexterm><indexterm><primary>log files</primary><secondary>BART</secondary><tertiary>verbose output</tertiary>
</indexterm><para>The following exit values are returned:</para><variablelist><varlistentry><term>0</term><listitem><para>Success</para>
</listitem>
</varlistentry><varlistentry><term>1</term><listitem><para>Nonfatal error when processing files, such as permission problems</para>
</listitem>
</varlistentry><varlistentry><term>&gt;1</term><listitem><para>Fatal error, such as an invalid command-line option</para>
</listitem>
</varlistentry>
</variablelist><itemizedlist><para>The reporting mechanism provides two types of output: verbose and programmatic:<indexterm><primary>BART</primary><secondary>verbose output</secondary></indexterm></para><listitem><para>Verbose output is the default output and is localized and
presented on multiple lines. Verbose output is internationalized and is human-readable.
When the <command>bart compare</command> command compares two system manifests,
a list of file differences is generated.</para><para>For example:</para><screen><replaceable>filename attribute control:xxxx test:yyyy</replaceable></screen><variablelist><varlistentry><term><replaceable>filename</replaceable></term><listitem><para>Name of the file that differs between the control manifest
and the test manifest.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>attribute</replaceable></term><listitem><para>Name of the file attribute that differs between the manifests
that are compared. <replaceable>xxxx</replaceable> is the attribute value
from the control manifest, and <replaceable>yyyy</replaceable> is the attribute
value from the test manifest. When discrepancies for multiple attributes occur
in the same file, each difference is noted on a separate line.</para>
</listitem>
</varlistentry>
</variablelist><para>Following is an example of the default output for the <command>bart
compare</command> command. The attribute differences are for the <filename>/etc/passwd</filename> file. The output indicates that the <literal>size</literal>, <literal>mtime</literal>, and <literal>contents</literal> attributes have changed.</para><screen>/etc/passwd:
size	control:74	test:81
mtime control:3c165879	test:3c165979
contents	control:daca28ae0de97afd7a6b91fde8d57afa
test:84b2b32c4165887355317207b48a6ec7</screen>
</listitem><listitem><para><indexterm><primary>BART</primary><secondary>programmatic output</secondary></indexterm>Programmatic output is generated if you use
the <option>p</option> option when you run the <command>bart compare</command> command.
This output is generated in a form that is suitable for programmatic manipulation.
Programmatic output can be easily parsed by other programs and is designed
to be used as input for other tools.</para><para>For example:</para><screen><replaceable>filename</replaceable> <replaceable>attribute</replaceable> <replaceable>control-val</replaceable> <replaceable>test-val</replaceable> [<replaceable>attribute</replaceable> <replaceable>control-val</replaceable> <replaceable>test-val</replaceable>]*</screen><variablelist><varlistentry><term><replaceable>filename</replaceable></term><listitem><para>Same as the <replaceable>filename</replaceable> attribute
in the default format</para>
</listitem>
</varlistentry><varlistentry><term><emphasis>attribute</emphasis> <replaceable>control-val</replaceable> <replaceable>test-val</replaceable></term><listitem><para>A description of the file attributes that differ between the
control and test manifests for each file</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</itemizedlist><para>For a list of attributes that are supported by the <command>bart</command> command,
see <olink targetptr="bart-22bbb" remap="internal">Rules File Attributes</olink>.</para><para>For more information about BART, see the <olink targetdoc="group-refman" targetptr="bart-1m" remap="external"><citerefentry><refentrytitle>bart</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3>
</sect2>
</sect1>
</chapter><?Pub *0000060025 0?>