Entrap: A File Integrity Checker
Ed Schaefer and John Spurgeon
Verifying the integrity of files is an important systems administration task.
Well-known systems administration authority Æleen Frisch says that "minimally,
you should periodically check the ownership and permissions of important system
files and directories." One method for verifying files is to take a snapshot
of the system in a pristine state and compare it against subsequent snapshots.
You can use a product such as Tripwire (http://www.tripwire.com), or
create your own such as our Entrap utility. Entrap is a suite of Korn shell
scripts that compares two snapshots of a system and reports the differences.
When two snapshots are compared, Entrap reports information about files that
have been added, deleted, and modified.
An Entrap snapshot includes the file characteristics displayed by the command
ls -ild, as well as optional file signatures, such as md5. Filtering
rules may be set up to instruct Entrap to ignore specific files and/or attributes
when comparing two snapshots.
In this column, we'll explain Entrap's configuration file. We'll discuss the
commands used to take a snapshot, filter snapshots, and compare two snapshots.
We'll review the directory structure, present an Entrap example, and include
a high-level description of the Entrap scripts. We conclude with what's in the
tarball and possible Entrap enhancements.
Configuration File
Entrap uses a configuration file to describe the directory trees to be processed.
Each line of the configuration file contains an ordered pair. The first element
of the pair is a pathname, and the second is a pathname alias. For example,
the default configuration file, /opt/entrap/etc/conf/entrap, looks like this:
/ root
/usr usr
/var var
/opt opt
/export/home home
You can override the default, and specify an alternate configuration file with
the -c option:
-c config_file
Snapshot Command
The snapshot command creates a snapshot:
entrap snapshot [-o] snapshot_name
A snapshot is composed of a directory containing one or more files.
|