業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

OpenSUSE16.0 : Tripwire , Logwatch インストール

1. Tripwire

1.1 インストール、設定

① リポジトリー追加

➁インストール

➂ ローカルキーパスフレーズの作成

④サイトキーパスフレーズの作成

⑤ Tripwire の設定

⑥Tripwire設定ファイル(暗号署名版)作成

Tripwire設定ファイル(テキスト版)削除

※Tripwire設定ファイル(テキスト版)を復元する場合
# twadmin -m f -c /etc/tripwire/tw.cfg > /etc/tripwire/twcfg.txt

⑦ ポリシーファイルテキスト版作成

⑧ポリシーファイル設定

twpolmake.plの内容

⑨ポリシーファイル最適化

⑩最適化済ポリシーファイルを元に、ポリシーファイル(暗号署名版)作成

⑪ データベースを作成、動作確認

⑫テスト用ファイルを作成

⑬Tripwire の動作確認

成功すると下記のように表示される

Parsing policy file: /etc/tripwire/tw.pol
*** Processing Unix File System ***
Performing integrity check…
The object: "/boot/grub2/i386-pc" is on a different file system…ignoring.
The object: "/boot/grub2/x86_64-efi" is on a different file system…ignoring.
Wrote report file: /var/lib/tripwire/report/Lepard-20251020-164221.twr

Open Source Tripwire(R) 2.4.3.7 Integrity Check Report

Report generated by: root
Report created on: Mon Oct 20 16:42:21 2025
Database last updated on: Never

===============================================================================

Report Summary:

Host name: Lepard
Host IP address: Unknown IP
Host ID: None
Policy file used: /etc/tripwire/tw.pol
Configuration file used: /etc/tripwire/tw.cfg
Database file used: /var/lib/tripwire/Lepard.twd
Command line used: tripwire --check

=========================================================================

Rule Summary:


Section: Unix File System

Rule Name Severity Level Added Removed Modified
--------- -------------- ----- ------- --------

  • Monitor Filesystems 0 0 0 5
    OS Binaries and Libraries 0 0 0 0
    Tripwire Binaries 0 0 0 0
    User Binaries and Libraries 0 0 0 0
    Tripwire Data Files 0 0 0 0
    Global Configuration Files 0 0 0 0
    (/etc)
    OS Boot Files and Mount Points 0 0 0 0
    (/boot)
  • Root Directory and Files 0 1 0 0
    (/root)

Total objects scanned: 154125
Total violations found: 6

=========================================================================

Object Summary:


# Section: Unix File System


Rule Name: Monitor Filesystems (/var)

Severity Level: 0

Modified:
"/var/log/journal/406942affffa4233817de9dd68899f18/system.journal"
"/var/log/mail"
"/var/log/mail.info"
"/var/log/messages"
"/var/log/vmware-vmsvc-root.log"


Rule Name: Root Directory and Files (/root)

Severity Level: 0

Added:
"/root/test.txt"

=========================================================================

Error Report:

No Errors


*** End of report ***

Open Source Tripwire 2.4 Portions copyright 2000-2018 Tripwire, Inc. Tripwire is a registered
trademark of Tripwire, Inc. This software comes with ABSOLUTELY NO WARRANTY;
for details use --version. This is free software which may be redistributed
or modified only under certain conditions; see COPYING for details.
All rights reserved.
Integrity check complete.

テスト用ファイルを削除

1.2 Tripwire を定期実行させる

①Tripwire メール通知用自動実行スクリプト作成

「tripwire.sh」の内容
パスフレーズ設定のLOCALPASS、SITEPASS それぞれの「xxxxxxxx」に設定したローカルパスフレーズ、サイトパスフレーズを入力

②Tripwire が定期的に実行されるようcron に追加

下記コマンドを実行し、指定のメールアドレスに通知が届くことを確認する

2. Logwatch

① Logwatch インストール

② 設定ファイルの編集
サンプルファイルをインストールディレクトリーにコピーする

③ Logwatch のレポートを出力

④ 設定したアドレスにレポートが届くかテストを行う

次のコマンドを実行して下記のような表示があった場合は、該当行のPerlを書き換えます

Possible precedence problem between ! and string eq at /usr/lib/perl5/vendor_perl/5.42.0/Date/Manip/Date.pm line 2695.
Possible precedence problem between ! and string eq at /usr/lib/perl5/vendor_perl/5.42.0/Date/Manip/Delta.pm line 1117.

次のように書き換える

これで指定したメールアドレスにレポートが届きます

タイトルとURLをコピーしました