BLOGTIMES
2022/03/07

AIDE でファイルの改竄をチェックする

  intrusion 
このエントリーをはてなブックマークに追加

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 コマンドを使えば一撃で済みます。

dnf -y install aide

日々の運用

あとは aide --init でデータベースを初期化し、mv -f /var/lib/aide/aide.db{.new,}.gz でデータベースを本番化しておきます。あとは定期的に

aide --check

を実行してやれば改竄の検知ができます。ファイルをアップデートした場合には、誤検知を防ぐためにデータベースのアップデート(aide -u; mv -f /var/lib/aide/aide.db{.new,}.gz)忘れずに行っておきましょう。

どちらかというと Static なウェブサーバなど、ファイルの更新頻度が低いサーバ向けのソリューションです。


    トラックバックについて
    Trackback URL:
    お気軽にどうぞ。トラックバック前にポリシーをお読みください。[policy]
    このエントリへのTrackbackにはこのURLが必要です→https://blog.cles.jp/item/13095
    Trackbacks
    このエントリにトラックバックはありません
    Comments
    愛のあるツッコミをお気軽にどうぞ。[policy]
    古いエントリについてはコメント制御しているため、即時に反映されないことがあります。
    コメントはありません
    Comments Form

    コメントは承認後の表示となります。
    OpenIDでログインすると、即時に公開されます。

    OpenID を使ってログインすることができます。

    Identity URL: Yahoo! JAPAN IDでログイン