CentOS 5 に Tripwire をインストールする




CentOS 5 に Tripwire をインストールする方法は次の通り。

Tripwire はファイルの変更や追加などを監視することで、
システムの完全性をチェックするツール。

まずは、フリーの Tripwire のソースをダウンロードする。

http://sourceforge.net/projects/tripwire/

今回ダウンロードしたのは tripwire-2.4.1.2-src.tar.bz2 です。

以下の手順を参考にダウンロードしたファイルを解凍・展開します。

redhat で bz2 形式のファイルを扱う
redhat で tar コマンドを使う

展開したディレクトリを置く場所はどこでも構わないので、
今回は /root で作業します。

tripwire-2.4.1.2-src に移動してコンパイルから開始します。

まずは、configure

# cd /root/tripwire-2.4.1.2-src
# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
(省略)
config.status: creating src/tripwire/Makefile
config.status: creating config.h
config.status: executing depfiles commands
#

続いて make

# make
make  all-recursive
make[1]: ディレクトリ `/root/tripwire-2.4.1.2-src' に入ります
Making all in man
make[2]: ディレクトリ `/root/tripwire-2.4.1.2-src/man' に入ります
Making all in man4
make[3]: ディレクトリ `/root/tripwire-2.4.1.2-src/man/man4' に入ります
make[3]: `all' に対して行うべき事はありません.
make[3]: ディレクトリ `/root/tripwire-2.4.1.2-src/man/man4' から出ます
Making all in man5
make[3]: ディレクトリ `/root/tripwire-2.4.1.2-src/man/man5' に入ります
(省略)
make[3]: ディレクトリ `/root/tripwire-2.4.1.2-src/src' から出ます
make[2]: ディレクトリ `/root/tripwire-2.4.1.2-src/src' から出ます
make[2]: ディレクトリ `/root/tripwire-2.4.1.2-src' に入ります
make[2]: `all-am' に対して行うべき事はありません.
make[2]: ディレクトリ `/root/tripwire-2.4.1.2-src' から出ます
make[1]: ディレクトリ `/root/tripwire-2.4.1.2-src' から出ます
#

続いて、make install でインストールする。

途中、accept や y やパスフレーズの入力が求めれる。

# make install
Making install in man
make[1]: ディレクトリ `/root/tripwire-2.4.1.2-src/man' に入ります
Making install in man4
(省略)
make[2]: ディレクトリ `/root/tripwire-2.4.1.2-src' に入ります
make[2]: `install-exec-am' に対して行うべき事はありません.
make  install-data-hook
make[3]: ディレクトリ `/root/tripwire-2.4.1.2-src' に入ります
prefix="/usr/local" sysconfdir="/usr/local/etc" \
        path_to_vi="/bin/vi" path_to_sendmail="/usr/sbin/sendmail" \
        ./install/install.sh

Installer program for:
Tripwire(R) 2.4 Open Source

Copyright (C) 1998-2000 Tripwire (R) Security Systems, Inc.  Tripwire (R)
is a registered trademark of the Purdue Research Foundation and is
licensed exclusively to Tripwire (R) Security Systems, Inc.


LICENSE AGREEMENT for Tripwire(R) 2.4 Open Source

Please read the following license agreement.  You must accept the
agreement to continue installing Tripwire.

Press ENTER to view the License Agreement.


		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
(省略)
This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.


Please type "accept" to indicate your acceptance of this
license agreement. [do not accept] accept
Using configuration file ./install/install.cfg

Checking for programs specified in install configuration file....

/usr/sbin/sendmail -oi -t exists.  Continuing installation.

/bin/vi exists.  Continuing installation.


----------------------------------------------
Verifying existence of binaries...

./bin/siggen found
./bin/tripwire found
./bin/twprint found
./bin/twadmin found

This program will copy Tripwire files to the following directories:

        TWBIN: /usr/local/sbin
        TWMAN: /usr/local/man
     TWPOLICY: /usr/local/etc
     TWREPORT: /usr/local/lib/tripwire/report
         TWDB: /usr/local/lib/tripwire
 TWSITEKEYDIR: /usr/local/etc
TWLOCALKEYDIR: /usr/local/etc

CLOBBER is false.

Continue with installation? [y/n] y

----------------------------------------------
Creating directories...

/usr/local/sbin: already exists
/usr/local/etc: already exists
/usr/local/lib/tripwire/report: already exists
/usr/local/lib/tripwire: already exists
/usr/local/etc: already exists
/usr/local/etc: already exists
/usr/local/man: already exists
/usr/local/doc/tripwire: already exists

----------------------------------------------
Copying files...

/usr/local/doc/tripwire/COPYING: file already exists
/usr/local/doc/tripwire/TRADEMARK: file already exists
/usr/local/doc/tripwire/policyguide.txt: file already exists
/usr/local/etc/twpol-Linux.txt: copied

----------------------------------------------
The Tripwire site and local passphrases are used to
sign a variety of files, such as the configuration,
policy, and database files.

Passphrases should be at least 8 characters in length
and contain both letters and numbers.

See the Tripwire manual for more information.

----------------------------------------------
Creating key files...

(When selecting a passphrase, keep in mind that good passphrases typically
have upper and lower case letters, digits and punctuation marks, and are
at least 8 characters in length.)

Enter the site keyfile passphrase:任意の英数字を入力
Verify the site keyfile passphrase:上で入力した英数字を再入力
Generating key (this may take several minutes)...Key generation complete.

(When selecting a passphrase, keep in mind that good passphrases typically
have upper and lower case letters, digits and punctuation marks, and are
at least 8 characters in length.)

Enter the local keyfile passphrase:任意の英数字を入力
Verify the local keyfile passphrase:上で入力した英数字を再入力
Generating key (this may take several minutes)...Key generation complete.

----------------------------------------------
Generating Tripwire configuration file...

----------------------------------------------
Creating signed configuration file...
Please enter your site passphrase: 
Wrote configuration file: /usr/local/etc/tw.cfg

A clear-text version of the Tripwire configuration file
/usr/local/etc/twcfg.txt
has been preserved for your inspection.  It is recommended
that you delete this file manually after you have examined it.


----------------------------------------------
Customizing default policy file...

----------------------------------------------
Creating signed policy file...
Please enter your site passphrase: 
Wrote policy file: /usr/local/etc/tw.pol

A clear-text version of the Tripwire policy file
/usr/local/etc/twpol.txt
has been preserved for your inspection.  This implements
a minimal policy, intended only to test essential
Tripwire functionality.  You should edit the policy file
to describe your system, and then use twadmin to generate
a new signed copy of the Tripwire policy.


----------------------------------------------
The installation succeeded.

Please refer to 
for release information and to the printed user documentation
for further instructions on using Tripwire 2.4 Open Source.

make[3]: ディレクトリ `/root/tripwire-2.4.1.2-src' から出ます
make[2]: ディレクトリ `/root/tripwire-2.4.1.2-src' から出ます
make[1]: ディレクトリ `/root/tripwire-2.4.1.2-src' から出ます
#

インストールはこれで終了。

tripwire の使い方についてはこちら。

CentOS 5 で Tripwire を使ってみる