2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH BART 1M "Oct 26, 2005"
8 bart \- basic audit reporting tool
12 \fB/usr/bin/bart\fR create [ \fB-n\fR] [\fB-R\fR \fIroot_directory\fR]
13 [\fB-r\fR \fIrules_file\fR | -]
18 \fB/usr/bin/bart\fR create [\fB-n\fR] [\fB-R\fR \fIroot_directory\fR] \fB-I\fR
24 \fB/usr/bin/bart\fR compare [\fB-i\fR \fIattribute\fR ] [\fB-p\fR]
25 [\fB-r\fR \fIrules_file\fR | -] \fIcontrol-manifest\fR \fItest-manifest\fR
31 \fBbart\fR(1M) is a tool that performs a file-level check of the software
35 You can also specify the files to track and the types of discrepancies to flag
36 by means of a rules file, \fBbart_rules\fR. See \fBbart_rules\fR(4).
39 The \fBbart\fR utility performs two basic functions:
43 \fB\fBbart create\fR\fR
46 The manifest generator tool takes a file-level \fBsnapshot\fR of a system. The
47 output is a catalog of file attributes referred to as a \fBmanifest\fR. See
48 \fBbart_manifest\fR(4).
50 You can specify that the list of files be cataloged in three ways. Use \fBbart
51 create\fR with no options, specify the files by name on the command line, or
52 create a rules file with directives that specify which the files to monitor.
53 See \fBbart_rules\fR(4).
55 By default, the manifest generator catalogs all attributes of all files in the
56 root (\fB/\fR) file system. File systems mounted on the root file system are
57 cataloged only if they are of the same type as the root file system.
59 For example, \fB/\fR, \fB/usr\fR, and \fB/opt\fR are separate UFS file systems.
60 \fB/usr\fR and \fB/opt\fR are mounted on \fB/\fR. Therefore, all three file
61 systems are cataloged. However, \fB/tmp\fR, also mounted on \fB/\fR, is not
62 cataloged because it is a TMPFS file system. Mounted CD-ROMs are not cataloged
63 since they are HSFS file systems.
69 \fB\fBbart compare\fR\fR
72 The report tool compares two manifests. The output is a list of per-file
73 attribute discrepancies. These discrepancies are the differences between two
74 manifests: a control manifest and a test manifest.
76 A discrepancy is a change to any attribute for a given file cataloged by both
77 manifests. A new file or a deleted file in a manifest is reported as a
80 The reporting mechanism provides two types of output: verbose and programmatic.
81 Verbose output is localized and presented on multiple lines, while programmatic
82 output is more easily parsable by other programs. See \fBOUTPUT\fR.
84 By default, the report tool generates verbose output where all discrepancies
85 are reported except for modified directory timestamps (\fBdirmtime\fR
88 To ensure consistent and accurate comparison results, \fIcontrol-manifest\fR
89 and \fItest-manifest\fR must be built with the same rules file.
94 Use the rules file to ignore specified files or subtrees when you generate a
95 manifest or compare two manifests. Users can compare manifests from different
96 perspectives by re-running the \fBbart compare\fR command with different rules
101 The following options are supported:
105 \fB\fB-i\fR \fIattribute\fR ...\fR
108 Specify the file attributes to be ignored globally. Specify attributes as a
109 comma separated list.
111 This option produces the same behavior as supplying the file attributes to a
112 global \fBIGNORE\fR keyword in the rules file. See \fBbart_rules\fR(4).
118 \fB\fB-I\fR [\fIfile_name\fR...]\fR
121 Specify the input list of files. The file list can be specified at the command
122 line or read from standard input.
131 Prevent computation of content signatures for all regular files in the file
141 Display manifest comparison output in ``programmatic mode,'' which is suitable
142 for programmatic parsing. The output is not localized.
148 \fB\fB-r\fR \fIrules_file\fR\fR
151 Use \fIrules_file\fR to specify which files and directories to catalog, and to
152 define which file attribute discrepancies to flag. If \fIrules_file\fR is
153 \fB-\fR, then the rules are read from standard input. See \fBbart_rules\fR(4)
154 for the definition of the syntax.
160 \fB\fB-R\fR \fIroot_directory\fR\fR
163 Specify the root directory for the manifest. All paths specified by the rules,
164 and all paths reported in the manifest, are relative to \fIroot_directory\fR.
169 The root file system of any non-global zones must not be referenced with the
170 \fB-R\fR option. Doing so might damage the global zone's file system, might
171 compromise the security of the global zone, and might damage the non-global
172 zone's file system. See \fBzones\fR(5).
179 bart allows quoting of operands. This is particularly important for white-space
180 appearing in subtree and subtree modifier specifications.
183 The following operands are supported:
187 \fB\fIcontrol-manifest\fR\fR
190 Specify the manifest created by \fBbart create\fR on the control system.
196 \fB\fItest-manifest\fR\fR
199 Specify the manifest created by \fBbart create\fR on the test system.
205 The \fBbart create\fR and \fBbart compare\fR commands write output to standard
206 output, and write error messages to standard error.
209 The \fBbart create\fR command generates a system manifest. See
210 \fBbart_manifest\fR(4).
213 When the \fBbart compare\fR command compares two system manifests, it generates
214 a list of file differences. By default, the comparison output is localized.
215 However, if the \fB-p\fR option is specified, the output is generated in a form
216 that is suitable for programmatic manipulation.
222 \fIattribute\fR control:\fIxxxx\fR test:\fIyyyy\fR
233 Name of the file that differs between \fIcontrol-manifest\fR and
234 \fItest-manifest\fR. For file names that contain embedded whitespace or newline
235 characters, see \fBbart_manifest\fR(4).
241 \fB\fIattribute\fR\fR
244 The name of the file attribute that differs between the manifests that are
245 compared. \fIxxxx\fR is the attribute value from \fIcontrol-manifest\fR, and
246 \fIyyyy\fR is the attribute value from \fItest-manifest\fR. When discrepancies
247 for multiple attributes occur for the same file, each difference is noted on a
250 The following attributes are supported:
257 ACL attributes for the file. For a file with ACL attributes, this field
258 contains the output from \fBacltotext()\fR.
276 Checksum value of the file. This attribute is only specified for regular files.
277 If you turn off context checking or if checksums cannot be computed, the value
278 of this field is \fB-\fR.
287 Destination of a symbolic link.
296 Value of the device node. This attribute is for character device files and
297 block device files only.
306 Modification time in seconds since 00:00:00 UTC, January 1, 1970 for
316 Numerical group ID of the owner of this entry.
325 Creation time for links.
334 Octal number that represents the permissions of the file.
343 Modification time in seconds since 00:00:00 UTC, January 1, 1970 for files.
370 Numerical user ID of the owner of this entry.
377 The following default output shows the attribute differences for the
378 \fB/etc/passwd\fR file. The output indicates that the \fBsize\fR, \fBmtime\fR,
379 and \fBcontents\fR attributes have changed.
384 size control:74 test:81
385 mtime control:3c165879 test:3c165979
386 contents control:daca28ae0de97afd7a6b91fde8d57afa
387 test:84b2b32c4165887355317207b48a6ec7
392 .SS "Programmatic Format"
396 \fIfilename\fR \fIattribute\fR \fIcontrol-val\fR \fItest-val\fR [\fIattribute\fR \fIcontrol-val\fR \fItest-val\fR]*
408 Same as \fIfilename\fR in the default format.
414 \fB\fIattribute\fR \fIcontrol-val\fR \fItest-val\fR\fR
418 A description of the file attributes that differ between the control and test
419 manifests for each file. Each entry includes the attribute value from each
420 manifest. See \fBbart_manifest\fR(4) for the definition of the attributes.
425 Each line of the programmatic output describes all attribute differences for a
429 The following programmatic output shows the attribute differences for the
430 \fB/etc/passwd\fR file. The output indicates that the \fBsize\fR, \fBmtime\fR,
431 and \fBcontents\fR attributes have changed.
435 /etc/passwd size 74 81 mtime 3c165879 3c165979
436 contents daca28ae0de97afd7a6b91fde8d57afa 84b2b32c4165887355317207b48a6ec7
442 .SS "Manifest Generator"
445 The manifest generator returns the following exit values:
461 Non-fatal error when processing files; for example, permission problems
470 Fatal error; for example, invalid command-line options
476 The report tool returns the following exit values:
483 No discrepancies reported
501 Fatal error executing comparison
506 \fBExample 1 \fRCreating a Default Manifest Without Computing Checksums
509 The following command line creates a default manifest, which consists of all
510 files in the \fB/\fR file system. The \fB-n\fR option prevents computation of
511 checksums, which causes the manifest to be generated more quickly.
522 \fBExample 2 \fRCreating a Manifest for a Specified Subtree
525 The following command line creates a manifest that contains all files in the
526 \fB/home/nickiso\fR subtree.
531 bart create -R /home/nickiso
537 \fBExample 3 \fRCreating a Manifest by Using Standard Input
540 The following command line uses output from the \fBfind\fR(1) command to
541 generate the list of files to be cataloged. The \fBfind\fR output is used as
542 input to the \fBbart create\fR command that specifies the \fB-I\fR option.
547 find /home/nickiso -print | bart create -I
553 \fBExample 4 \fRCreating a Manifest by Using a Rules File
556 The following command line uses a rules file, \fBrules\fR, to specify the files
568 \fBExample 5 \fRComparing Two Manifests and Generating Programmatic Output
571 The following command line compares two manifests and produces output suitable
572 for parsing by a program.
577 bart compare -p manifest1 manifest2
583 \fBExample 6 \fRComparing Two Manifests and Specifying Attributes to Ignore
586 The following command line compares two manifests. The \fBdirmtime\fR,
587 \fBlnmtime\fR, and \fBmtime\fR attributes are not compared.
592 bart compare -i dirmtime,lnmtime,mtime manifest1 manifest2
598 \fBExample 7 \fRComparing Two Manifests by Using a Rules File
601 The following command line uses a rules file, \fBrules\fR, to compare two
607 bart compare -r rules manifest1 manifest2
615 See \fBattributes\fR(5) for descriptions of the following attributes:
623 ATTRIBUTE TYPE ATTRIBUTE VALUE
625 Interface Stability Evolving
631 \fBcksum\fR(1), \fBdigest\fR(1), \fBfind\fR(1), \fBbart_manifest\fR(4),
632 \fBbart_rules\fR(4), \fBattributes\fR(5)
636 The file attributes of certain system libraries can be temporarily altered by
637 the system as it boots. To avoid triggering false warnings, you should compare
638 manifests only if they were both created with the system in the same state;
639 that is, if both were created in single-user or both in multi-user.