You can customize a manifest in one of the following ways:
By specifying a subtree
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 bart compare 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.
By specifying a file name
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 bart command when you want to only list information about a specific file or files on a system.
By using a rules file
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.
Determine which files you want to catalog and monitor.
Assume the Primary Administrator role, or become superuser.
The Primary Administrator role includes the Primary Administrator profile. To create the role and assign the role to a user, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.
After installing the Solaris software, create a custom manifest by using one of the following options:
By specifying a subtree:
# bart create -R root-directory |
By specifying a file name or file names:
# bart create -I filename... |
For example:
# bart create -I /etc/system /etc/passwd /etc/shadow |
By using a rules file:
# bart create -r rules-file |
Examine the contents of the manifest.
Save the manifest for future use.
This example shows how to create a manifest that contains information about the files in the /etc/ssh subtree only.
# bart create -R /etc/ssh ! 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 . . . |
This example shows how to create a manifest that lists only information about the /etc/passwd and /etc/shadow files on a system.
# bart create -I /etc/passwd /etc/shadow ! 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 |
By comparison, the following is the standard output of the ls -al command for the /etc/passwd and the /etc/shadow files on the same system.
# ls -al /etc/passwd -r--r--r-- 1 root sys 542 Dec 4 17:42 /etc/passwd |
# ls -al /etc/shadow -r-------- 1 root sys 294 Oct 15 16:09 /etc/shadow |
This example shows how to create a manifest by using a rules file to catalog only those files in the /etc directory. The same rules file includes directives to be used by the bart compare command for monitoring changes to the acl attribute of the /etc/system file.
Use a text editor to create a rules file that catalogs only those files in the /etc directory.
# 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 |
For more information about creating a rules file, see BART Rules File.
Create a control manifest by using the rules file you created.
# bart create -r etc.rules-file > etc.system.control-manifest ! 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 |
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 bart options and the same rules file.
Compare manifests by using the same rules file.