Tripwire

  • 投稿者:
  • 投稿カテゴリー:Tripwire

Tripwireとは

改ざん検知ソフトウェア
正常な状態でのシステムのスナップショット(ベースラインデータベース)をデータベースに保存し
現在の状態でのシステムのスナップショットと比較することで改ざんを検知します

ポリシーを記述したテキストファイル(以降、ポリシーファイル(平文)と呼ぶ)の内容を元に
twadmin コマンドを利用して作成する

インストール

root@hostname:/home/shimizu# aptitude install tripwire
以下の新規パッケージがインストールされます:
  tripwire
...

2016-01-03_183355

2016-01-03_183423

2016-01-03_183447

2016-01-03_183506

Generating site key (this may take several minutes)…
2016-01-03_183550

2016-01-03_183617

Generating local key (this may take several minutes)…
2016-01-03_183700

2016-01-03_183724

利用してみる

本来であればポリシーファイルを作成して
それに応じてアラートとしたり、メール送ったりできるようだが、、深追いはしない( ・`ω・´)

### DB初期化(スナップショットを取得) ###
root@hostname:/home/shimizu# tripwire --init
Please enter your local passphrase:
Parsing policy file: /etc/tripwire/tw.pol
Generating the database...
...

The object: "/proc/sys/fs/binfmt_misc" is on a different file system...ignoring.
Wrote database file: /var/lib/tripwire/hostname.twd
The database was successfully generated.

### スナップショットの比較をする ###
root@hostname:/etc/tripwire# tripwire --check

...
-------------------------------------------------------------------------------
  Section: Unix File System
-------------------------------------------------------------------------------

  Rule Name                       Severity Level    Added    Removed  Modified
  ---------                       --------------    -----    -------  --------
  Other binaries                  66                0        0        0
  Tripwire Binaries               100               0        0        0
  Other libraries                 66                0        0        0
  Root file-system executables    100               0        0        0
* Tripwire Data Files             100               1        0        0
  System boot changes             100               0        0        0
  Root file-system libraries      100               0        0        0
  (/lib)
  Critical system boot files      100               0        0        0
* Other configuration files       66                2        0        1
  (/etc)
  Boot Scripts                    100               0        0        0
  Security Control                66                0        0        0
* Root config files               100               0        0        5
* Devices & Kernel information    100               1098     1098     0
  Invariant Directories           66                0        0        0

Total objects scanned:  47683
Total violations found:  2205

===============================================================================
Object Summary:
===============================================================================

-------------------------------------------------------------------------------
# Section: Unix File System
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Rule Name: Tripwire Data Files (/var/lib/tripwire/hostname.twd)
Severity Level: 100
-------------------------------------------------------------------------------

Added:
"/var/lib/tripwire/hostname.twd"

-------------------------------------------------------------------------------
Rule Name: Other configuration files (/etc)
Severity Level: 66
-------------------------------------------------------------------------------

Added:
"/etc/tripwire/report.txt"
"/etc/tripwire/delete"

Modified:
"/etc/tripwire"

...

参考URL

Linux: Tripwireの運用サイクルの基本 – ポリシー設定から改竄チェック~DB更新
tripwire/Debianへのインストール