LoginSignup
18
18

More than 5 years have passed since last update.

ファイル改ざん検知ツール AFICK

Last updated at Posted at 2016-08-10

AFICK

http://afick.sourceforge.net/
AFICK (Another File Integrity ChecKer) はファイルの改竄検知ツール。
最新版は 2017/12/08 リリースの AFICK 3.6.0 になる。

HIDS

AFICK 以外の主な HIDS は以下の通り。

  • AFICK 3.6.0 (2017/12/08) - SourceForge に rpm パッケージがある。
  • AIDE 0.16 (2016/07/25) - CentOS の Base リポジトリにある。
  • OSSEC 3.0.0 (2018/07/17) - inotify 対応。Atomic リポジトリにある。
  • Samhain 4.3.1 (2018/09/25) - inotify 対応。
  • Tripwire 2.4.3.7 (2018/03/31)- EPEL リポジトリにある。

機能 1

  • すべての一般的なOS(Windows、UNIX...)で変更なしでポータブル可能
  • 簡単インストール : コンパイルや他の多くのツールのインストールは不要
  • 速い
  • 新規/削除/更新 ファイルの表示
  • 壊れたリンクの表示
  • 任意のユーザーが使用できる
  • any number of base and config
  • config file with exceptions and jokers
  • AIDE に近い設定ファイル構文

インストール

yum install http://jaist.dl.sourceforge.net/project/afick/afick/3.6.0/afick-3.6.0-1.noarch.rpm

SourceForge に rpm パッケージがある。
https://sourceforge.net/projects/afick/files/afick/

初期化

afick --init

afick -i でも同様。

出力例
# Afick (3.5.2) init at 2016/08/10 23:28:12 with options (/etc/afick.conf):
# archive:=/var/lib/afick/archive
# database:=/var/lib/afick/afick
# exclude_suffix:=log LOG html htm HTM txt TXT xml hlp pod chm tmp old bak fon ttf TTF bmp BMP jpg JPG gif png ico wav WAV mp3 avi
# history:=/var/lib/afick/history
# max_checksum_size:=10000000
# running_files:=1
# timing:=1
# dbm:=Storable

# Hash database created successfully. 16374 files entered.
# #################################################################
# MD5 hash of /var/lib/afick/afick => 7QALXqafNFMODST7C6mJTw
# user time : 8.89; system time : 2.35; real time : 21

更新

afick --update

afick -u でも同様。

出力例
# Afick (3.5.2) update at 2016/08/10 23:31:20 with options (/etc/afick.conf):
# archive:=/var/lib/afick/archive
# database:=/var/lib/afick/afick
# exclude_suffix:=log LOG html htm HTM txt TXT xml hlp pod chm tmp old bak fon ttf TTF bmp BMP jpg JPG gif png ico wav WAV mp3 avi
# history:=/var/lib/afick/history
# max_checksum_size:=10000000
# running_files:=1
# timing:=1
# dbm:=Storable
# last run on 2016/08/10 23:28:12 with afick version 3.5.2
# summary changes
changed file : /boot/initramfs-3.10.0-327.el7.x86_64kdump.img

# detailed changes
changed file : /boot/initramfs-3.10.0-327.el7.x86_64kdump.img
    blocs            : 32640    32600

# Hash database updated successfully : 16374 files scanned, 1 changed (new : 0; delete : 0; changed : 1; dangling : 6; exclude_suffix : 72; exclude_prefix : 0; exclude_re : 0; degraded : 5)
# #################################################################
# MD5 hash of /var/lib/afick/afick => IVrNbnzvBMp0QuArphdctg
# user time : 7.79; system time : 1.76; real time : 16

実行

afick --compare
出力例
# Afick (3.5.2) compare at 2016/08/10 23:39:29 with options (/etc/afick.conf):
# archive:=/var/lib/afick/archive
# database:=/var/lib/afick/afick
# exclude_suffix:=log LOG html htm HTM txt TXT xml hlp pod chm tmp old bak fon ttf TTF bmp BMP jpg JPG gif png ico wav WAV mp3 avi
# history:=/var/lib/afick/history
# max_checksum_size:=10000000
# running_files:=1
# timing:=1
# dbm:=Storable
# last run on 2016/08/10 23:31:20 with afick version 3.5.2
# summary changes
deleted file : /root/afick-3.5.2-1.noarch.rpm

# detailed changes
deleted file : /root/afick-3.5.2-1.noarch.rpm
    parent_date      : Wed Aug 10 23:29:23 2016

# Hash database : 16373 files scanned, 1 changed (new : 0; delete : 1; changed : 0; dangling : 6; exclude_suffix : 72; exclude_prefix : 0; exclude_re : 0; degraded : 5)
# #################################################################
# MD5 hash of /var/lib/afick/afick => IVrNbnzvBMp0QuArphdctg
# user time : 7.33; system time : 1.54; real time : 14

afick -k でも同様。

設定ファイル

/etc/afick.conf
database:=/var/lib/afick/afick
history := /var/lib/afick/history
archive := /var/lib/afick/archive
report_url := stdout
report_syslog := no
verbose := no
debug := 0
warn_dead_symlinks := no
follow_symlinks := no
allow_overload := yes
report_context := no
report_full_newdel := no
report_summary := yes
warn_missing_file := no
running_files := yes
timing := yes
ignore_case := no
max_checksum_size := 10000000
allow_relativepath := 0
exclude_suffix := log LOG html htm HTM txt TXT xml
exclude_suffix := hlp pod chm
exclude_suffix := tmp old bak
exclude_suffix := fon ttf TTF
exclude_suffix := bmp BMP jpg JPG gif png ico
exclude_suffix := wav WAV mp3 avi
@@define MAILTO root@localhost
@@define LINES 1000
@@define REPORT 1
@@define VERBOSE 0
@@define NICE 18
@@define BATCH 1
@@define ARCHIVE_RETENTION 0
@@define NAGIOS 0
@@define NAGIOS_SERVER my.nagios.server.org
@@define NAGIOS_CHECK_NAME Another File Integrity Checker
@@define NAGIOS_CRITICAL_CHANGES 2
DIR = p+i+n+u+g
ETC = p+d+u+g+s+md5
Logs = p+n+u+g
MyRule = p+d+n+u+g+s+b+md5
= /  DIR
/bin    MyRule
/boot   MyRule
/dev p+n
! /dev/bsg
! /dev/pts
! /dev/shm
/etc    ETC
/etc/mtab ETC - md5 - s
/etc/adjtime ETC - md5
/etc/aliases.db ETC - md5
/etc/motd ETC
/lib    MyRule
/lib64  MyRule
/lib/modules MyRule
/root MyRule
! /root/.viminfo
/sbin   MyRule
/usr/bin    MyRule
/usr/sbin   MyRule
/usr/lib    MyRule
/usr/lib64  MyRule
/usr/local/bin  MyRule
/usr/local/sbin MyRule
/usr/local/lib  MyRule
/var/log Logs
= /var/log/afick Logs
/var/www MyRule

セキュリティ関連記事

18
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
18