Merge commit '62f63298eba531d48f87aa8c2089298cb7821962'
[unleashed.git] / share / man / man8 / bart.8
blob22eb829bf94e1985d945c853a4bfe155ce21255b
1 '\" te
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 8 "Oct 26, 2005"
7 .SH NAME
8 bart \- basic audit reporting tool
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/bin/bart\fR create [ \fB-n\fR] [\fB-R\fR \fIroot_directory\fR]
13      [\fB-r\fR \fIrules_file\fR | -]
14 .fi
16 .LP
17 .nf
18 \fB/usr/bin/bart\fR create [\fB-n\fR] [\fB-R\fR \fIroot_directory\fR] \fB-I\fR
19      [\fIfile_name\fR]...
20 .fi
22 .LP
23 .nf
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
26 .fi
28 .SH DESCRIPTION
29 .sp
30 .LP
31 \fBbart\fR(8) is a tool that performs a file-level check of the software
32 contents of a system.
33 .sp
34 .LP
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).
37 .sp
38 .LP
39 The \fBbart\fR utility performs two basic functions:
40 .sp
41 .ne 2
42 .na
43 \fB\fBbart create\fR\fR
44 .ad
45 .RS 16n
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).
49 .sp
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).
54 .sp
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.
58 .sp
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.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fBbart compare\fR\fR
70 .ad
71 .RS 16n
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.
75 .sp
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
78 discrepancy.
79 .sp
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.
83 .sp
84 By default, the report tool generates verbose output where all discrepancies
85 are reported except for modified directory timestamps (\fBdirmtime\fR
86 attribute).
87 .sp
88 To ensure consistent and accurate comparison results, \fIcontrol-manifest\fR
89 and \fItest-manifest\fR must be built with the same rules file.
90 .RE
92 .sp
93 .LP
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
97 files.
98 .SH OPTIONS
99 .sp
101 The following options are supported:
103 .ne 2
105 \fB\fB-i\fR \fIattribute\fR ...\fR
107 .RS 21n
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).
116 .ne 2
118 \fB\fB-I\fR [\fIfile_name\fR...]\fR
120 .RS 21n
121 Specify the input list of files. The file list can be specified at the command
122 line or read from standard input.
126 .ne 2
128 \fB\fB-n\fR\fR
130 .RS 21n
131 Prevent computation of content signatures for all regular files in the file
132 list.
136 .ne 2
138 \fB\fB-p\fR\fR
140 .RS 21n
141 Display manifest comparison output in ``programmatic mode,'' which is suitable
142 for programmatic parsing. The output is not localized.
146 .ne 2
148 \fB\fB-r\fR \fIrules_file\fR\fR
150 .RS 21n
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.
158 .ne 2
160 \fB\fB-R\fR \fIroot_directory\fR\fR
162 .RS 21n
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.
166 Note -
168 .RS 2
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).
176 .SH OPERANDS
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:
185 .ne 2
187 \fB\fIcontrol-manifest\fR\fR
189 .RS 20n
190 Specify the manifest created by \fBbart create\fR on the control system.
194 .ne 2
196 \fB\fItest-manifest\fR\fR
198 .RS 20n
199 Specify the manifest created by \fBbart create\fR on the test system.
202 .SH OUTPUT
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.
217 .SS "Default Format"
219 .in +2
221 \fIfilename\fR
222 \fIattribute\fR control:\fIxxxx\fR test:\fIyyyy\fR
224 .in -2
228 .ne 2
230 \fB\fIfilename\fR\fR
232 .RS 13n
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).
239 .ne 2
241 \fB\fIattribute\fR\fR
243 .RS 13n
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
248 separate line.
250 The following attributes are supported:
252 .ne 2
254 \fBacl\fR
256 .RS 12n
257 ACL attributes for the file. For a file with ACL attributes, this field
258 contains the output from \fBacltotext()\fR.
262 .ne 2
264 \fBall\fR
266 .RS 12n
267 All attributes.
271 .ne 2
273 \fBcontents\fR
275 .RS 12n
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.
282 .ne 2
284 \fBdest\fR
286 .RS 12n
287 Destination of a symbolic link.
291 .ne 2
293 \fBdevnode\fR
295 .RS 12n
296 Value of the device node. This attribute is for character device files and
297 block device files only.
301 .ne 2
303 \fBdirmtime\fR
305 .RS 12n
306 Modification time in seconds since 00:00:00 UTC, January 1, 1970 for
307 directories.
311 .ne 2
313 \fBgid\fR
315 .RS 12n
316 Numerical group ID of the owner of this entry.
320 .ne 2
322 \fBlnmtime\fR
324 .RS 12n
325 Creation time for links.
329 .ne 2
331 \fBmode\fR
333 .RS 12n
334 Octal number that represents the permissions of the file.
338 .ne 2
340 \fBmtime\fR
342 .RS 12n
343 Modification time in seconds since 00:00:00 UTC, January 1, 1970 for files.
347 .ne 2
349 \fBsize\fR
351 .RS 12n
352 File size in bytes.
356 .ne 2
358 \fBtype\fR
360 .RS 12n
361 Type of file.
365 .ne 2
367 \fBuid\fR
369 .RS 12n
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.
381 .in +2
383 /etc/passwd:
384   size  control:74  test:81
385   mtime  control:3c165879  test:3c165979
386   contents  control:daca28ae0de97afd7a6b91fde8d57afa
387 test:84b2b32c4165887355317207b48a6ec7
389 .in -2
392 .SS "Programmatic Format"
394 .in +2
396 \fIfilename\fR \fIattribute\fR \fIcontrol-val\fR \fItest-val\fR [\fIattribute\fR \fIcontrol-val\fR \fItest-val\fR]*
398 .in -2
402 .ne 2
404 \fB\fIfilename\fR\fR
406 .sp .6
407 .RS 4n
408 Same as \fIfilename\fR in the default format.
412 .ne 2
414 \fB\fIattribute\fR \fIcontrol-val\fR \fItest-val\fR\fR
416 .sp .6
417 .RS 4n
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
426 single file.
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.
433 .in +2
435 /etc/passwd size 74 81 mtime 3c165879 3c165979
436 contents daca28ae0de97afd7a6b91fde8d57afa 84b2b32c4165887355317207b48a6ec7
438 .in -2
441 .SH EXIT STATUS
442 .SS "Manifest Generator"
445 The manifest generator returns the following exit values:
447 .ne 2
449 \fB\fB0\fR\fR
451 .RS 6n
452 Success
456 .ne 2
458 \fB\fB1\fR\fR
460 .RS 6n
461 Non-fatal error when processing files; for example, permission problems
465 .ne 2
467 \fB\fB>1\fR\fR
469 .RS 6n
470 Fatal error; for example, invalid command-line options
473 .SS "Report Tool"
476 The report tool returns the following exit values:
478 .ne 2
480 \fB\fB0\fR\fR
482 .RS 6n
483 No discrepancies reported
487 .ne 2
489 \fB\fB1\fR\fR
491 .RS 6n
492 Discrepancies found
496 .ne 2
498 \fB\fB>1\fR\fR
500 .RS 6n
501 Fatal error executing comparison
504 .SH EXAMPLES
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.
514 .in +2
516 bart create -n
518 .in -2
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.
529 .in +2
531 bart create -R /home/nickiso
533 .in -2
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.
545 .in +2
547 find /home/nickiso -print | bart create -I
549 .in -2
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
557 to be cataloged.
560 .in +2
562 bart create -r rules
564 .in -2
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.
575 .in +2
577 bart compare -p manifest1 manifest2
579 .in -2
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.
590 .in +2
592 bart compare -i dirmtime,lnmtime,mtime manifest1 manifest2
594 .in -2
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
602 manifests.
605 .in +2
607 bart compare -r rules manifest1 manifest2
609 .in -2
612 .SH ATTRIBUTES
615 See \fBattributes\fR(5) for descriptions of the following attributes:
620 box;
621 c | c
622 l | l .
623 ATTRIBUTE TYPE  ATTRIBUTE VALUE
625 Interface Stability     Evolving
628 .SH SEE ALSO
631 \fBcksum\fR(1), \fBdigest\fR(1), \fBfind\fR(1), \fBbart_manifest\fR(4),
632 \fBbart_rules\fR(4), \fBattributes\fR(5)
633 .SH NOTES
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.