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

OpenSUSE16.0 : Tripwire , Logwatch

1. Tripwire

1.1 Installation, Configuration

① Add Repository

➁Install

➂ Creating a Local Key Passphrase

④Creating a Site Key Passphrase

⑤ Configuration File Edit

⑥create a Tripwire configuration file (cryptographically signed version)

Delete Tripwire configuration file (text version)

※Restoring the Tripwire configuration file (text version)
# twadmin -m f -c /etc/tripwire/tw.cfg > /etc/tripwire/twcfg.txt

⑦ Policy File Text Version Creation

⑧Policy File Settings

Contents of twpolmake.pl

⑨Policy File Optimizations

⑩Create policy file (cryptographically signed version) based on optimized policy file

⑪Create database and check operation

⑫Create test files

⑬Check Tripwire operation

If successful, it will display as follows:

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.

Delete test files

1.2 Schedule Tripwire to run regularly

①Creating an Automated Script for Tripwire Email Notifications

# cd /srv/www/system
# vi tripwire.sh

Contents of "tripwire.sh"
Enter the local passphrase and site passphrase you set for each of LOCALPASS and SITEPASS in the "xxxxxxxx" fields.

②Add Tripwire to cron so it runs regularly

Execute the following command and verify that a notification is delivered to the specified email address.

2. Logwatch

① Logwatch Installation

② Edit configuration file
Copy the sample files to the installation directory.

③Output Logwatch reports

④ Test to see if the report arrives at the address you set. Check if you receive a log report email like the one above.

If the following command displays output similar to the example below, rewrite the Perl code on the corresponding line.

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.

Rewrite as follows:

The report will now be sent to the specified email address.