bart - basic audit reporting tool
/usr/bin/bart create [ -n] [-R root_directory] [-r rules_file | -]
/usr/bin/bart create [-n] [-R root_directory] -I [file_name]...
/usr/bin/bart compare [-i attribute ] [-p] [-r rules_file | -] control-manifest test-manifest
bart(1M) is a tool that performs a file-level check of the software contents of a system.
You can also specify the files to track and the types of discrepancies to flag by means of a rules file, bart_rules. See bart_rules(4).
The bart utility performs two basic functions:
bart create
You can specify that the list of files be cataloged in three ways. Use bart create with no options, specify the files by name on the command line, or create a rules file with directives that specify which the files to monitor. See bart_rules(4).
By default, the manifest generator catalogs all attributes of all files in the root (/) file system. File systems mounted on the root file system are cataloged only if they are of the same type as the root file system.
For example, /, /usr, and /opt are separate UFS file systems. /usr and /opt are mounted on /. Therefore, all three file systems are cataloged. However, /tmp, also mounted on /, is not cataloged because it is a TMPFS file system. Mounted CD-ROMs are not cataloged since they are HSFS file systems.
bart compare
A discrepancy is a change to any attribute for a given file cataloged by both manifests. A new file or a deleted file in a manifest is reported as a discrepancy.
The reporting mechanism provides two types of output: verbose and programmatic. Verbose output is localized and presented on multiple lines, while programmatic output is more easily parsable by other programs. See OUTPUT.
By default, the report tool generates verbose output where all discrepancies are reported except for modified directory timestamps (dirmtime attribute).
To ensure consistent and accurate comparison results, control-manifest and test-manifest must be built with the same rules file.
Use the rules file to ignore specified files or subtrees when you generate a manifest or compare two manifests. Users can compare manifests from different perspectives by re-running the bart compare command with different rules files.
The following options are supported:
-i attribute ...
This option produces the same behavior as supplying the file attributes to a global IGNORE keyword in the rules file. See bart_rules(4).
-I [file_name...]
-n
-p
-r rules_file
-R root_directory
Note -
bart allows quoting of operands. This is particularly important for white-space appearing in subtree and subtree modifier specifications.
The following operands are supported:
control-manifest
test-manifest
The bart create and bart compare commands write output to standard output, and write error messages to standard error.
The bart create command generates a system manifest. See bart_manifest(4).
When the bart compare command compares two system manifests, it generates a list of file differences. By default, the comparison output is localized. However, if the -p option is specified, the output is generated in a form that is suitable for programmatic manipulation.
filename attribute control:xxxx test:yyyy
filename
attribute
The following attributes are supported:
acl
all
contents
dest
devnode
dirmtime
gid
lnmtime
mode
mtime
size
type
uid
The following default output shows the attribute differences for the /etc/passwd file. The output indicates that the size, mtime, and contents attributes have changed.
/etc/passwd: size control:74 test:81 mtime control:3c165879 test:3c165979 contents control:daca28ae0de97afd7a6b91fde8d57afa test:84b2b32c4165887355317207b48a6ec7
filename attribute control-val test-val [attribute control-val test-val]*
filename
attribute control-val test-val
Each line of the programmatic output describes all attribute differences for a single file.
The following programmatic output shows the attribute differences for the /etc/passwd file. The output indicates that the size, mtime, and contents attributes have changed.
/etc/passwd size 74 81 mtime 3c165879 3c165979 contents daca28ae0de97afd7a6b91fde8d57afa 84b2b32c4165887355317207b48a6ec7
The manifest generator returns the following exit values:
0
1
>1
The report tool returns the following exit values:
0
1
>1
Example 1 Creating a Default Manifest Without Computing Checksums
The following command line creates a default manifest, which consists of all files in the / file system. The -n option prevents computation of checksums, which causes the manifest to be generated more quickly.
bart create -n
Example 2 Creating a Manifest for a Specified Subtree
The following command line creates a manifest that contains all files in the /home/nickiso subtree.
bart create -R /home/nickiso
Example 3 Creating a Manifest by Using Standard Input
The following command line uses output from the find(1) command to generate the list of files to be cataloged. The find output is used as input to the bart create command that specifies the -I option.
find /home/nickiso -print | bart create -I
Example 4 Creating a Manifest by Using a Rules File
The following command line uses a rules file, rules, to specify the files to be cataloged.
bart create -r rules
Example 5 Comparing Two Manifests and Generating Programmatic Output
The following command line compares two manifests and produces output suitable for parsing by a program.
bart compare -p manifest1 manifest2
Example 6 Comparing Two Manifests and Specifying Attributes to Ignore
The following command line compares two manifests. The dirmtime, lnmtime, and mtime attributes are not compared.
bart compare -i dirmtime,lnmtime,mtime manifest1 manifest2
Example 7 Comparing Two Manifests by Using a Rules File
The following command line uses a rules file, rules, to compare two manifests.
bart compare -r rules manifest1 manifest2
See attributes(5) for descriptions of the following attributes:
|
cksum(1), digest(1), find(1), bart_manifest(4), bart_rules(4), attributes(5)
The file attributes of certain system libraries can be temporarily altered by the system as it boots. To avoid triggering false warnings, you should compare manifests only if they were both created with the system in the same state; that is, if both were created in single-user or both in multi-user.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |