前庭でsnortのSIDメッセージマッピングファイルがありません。

前庭でsnortのSIDメッセージマッピングファイルがありません。

snort(現在のバージョン2.9.7.0-5)をインストールし、Barnyard2バージョン2.1.14(ビルド337)をコンパイルしました。最初の試み:

sudo ./barnyard2 -c ../etc/barnyard2.conf -o /var/log/snort/snort.alert

わかりましたUnable to open SID file '/etc/snort/sid-msg.map' (No such file or directory)。これは本当です。 /etc/snort/sid-msg.mapが実際に欠落しています。既存の/etc/snort/community-sid-msg.mapを試してみましたが、次のような結果が得られました。

ERROR: [ParseSidMapLine()]: Unknown sidmap file version [0]

何か抜けましたか?それとも正しく機能させるにはどうすればよいですか?

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:   xenial

答え1

/etc/snort/community-sid-msg.map を使用できるように見えますが、埋め込みコメントを削除した後にのみ可能です。たとえば、次のようになります。

cd ~
sudo grep -v -P "^#" /etc/snort/community-sid-msg.map > community-sid-msg-no-comments.map
# dir required by barnyard2 at runtime
sudo mkdir /var/log/barnyard2
# comment the line "config sid_file: /etc/snort/sid-msg.map" in your barnyard2/etc/barnyard2.conf
sudo ~/apps/opt/barnyard2/bin/barnyard2 -c ~/apps/opt/barnyard2/etc/barnyard2.conf -S community-sid-msg-no-comments.map -o -q /var/log/snort/snort.log

しかし、ジョブ出力は完全に完了していません。この行はサンプル出力です。

04/05-23:18:39.268639  [**] [1:485:4] Snort Alert [1:485:4] [**] [Classification: Misc activity] [Priority: 3] {ICMP} 46.223.181.179 -> 188.26.13.70

同等でより良い方法は次のとおりです。

04/05-23:18:39.268639  [**] [1:485:4] ICMP Destination Unreachable Communication Administratively Prohibited [**] [Classification: Misc activity] [Priority: 3] {ICMP} 46.223.181.179 -> 188.26.13.70

2行目(より良い行)は、次のように生成されたsidファイルを使用して作成されました。

python ~/compile/py-idstools/idstools/scripts/gensidmsgmap.py /etc/snort/rules/ > sid-msg-v1.map

gensidmsgmap.py を以下から取得します。https://github.com/jasonish/py-idstools/tree/master/idstools/scripts

関連情報