AIDE というファイル改竄を監視するためのツールを見つけたのでメモ。
昔、よく使われていたTripwire の OSS 版ような感じですね。
動作としてはファイルのチェックサムを DB として持っておき、これを定期的にチェックすることによりファイルの改竄するという比較的簡単な仕組みで動作します。
AIDE - Advanced Intrusion Detection Environment
It creates a database from the regular expression rules that it finds from the config file(s). Once this database is initialized it can be used to verify the integrity of the files. It has several message digest algorithms (see below) that are used to check the integrity of the file. All of the usual file attributes can also be checked for inconsistencies. It can read databases from older or newer versions. See the manual pages within the distribution for further info.
† インストールは簡単
インストール自体は dnf コマンドを使えば一撃で済みます。
† 日々の運用
あとはaide --init
でデータベースを初期化し、mv -f /var/lib/aide/aide.db{.new,}.gz
でデータベースを本番化しておきます。あとは定期的に
を実行してやれば改竄の検知ができます。ファイルをアップデートした場合には、誤検知を防ぐためにデータベースのアップデート(aide -u; mv -f /var/lib/aide/aide.db{.new,}.gz
)忘れずに行っておきましょう。
どちらかというと Static なウェブサーバなど、ファイルの更新頻度が低いサーバ向けのソリューションです。
このエントリへのTrackbackにはこのURLが必要です→https://blog.cles.jp/item/13095
コメントは承認後の表示となります。
OpenIDでログインすると、即時に公開されます。
OpenID を使ってログインすることができます。