IPTables log analyzer

この記事は2年以上前に書いたものです。
そのため情報が古い可能性があります。ご了承ください。m(_ _)m

でログを吐くようにしているけど、多すぎるので解析するの大変。
で、IPTables log analyzerを入れてみました。
% tar zxvfp iptables_logger_v0.4.tar.gz
% cd iptables
% view doc/faq.html ← インストール方法が書いてある
% mysql -u root -p
mysql> create database iptables;
Query OK, 1 row affected (0.00 sec)
— 管理者ユーザ作成
mysql> grant create,select,insert on iptables.* to iptables_admin@localhost identified by ‘iptables_admin_password';
Query OK, 0 rows affected (0.01 sec)
— 一般ユーザ作成
mysql> grant select on iptables.* to iptables_user@localhost identified by ‘iptables_user_password';
Query OK, 0 rows affected (0.00 sec)
— 一般ユーザの参照権追加
mysql> grant create temporary tables on iptables.* to iptables_user@localhost identified by ‘iptables_user_password';
Query OK, 0 rows affected (0.00 sec)
mysql> quit
% cat sql/db.sql | mysql -u iptables_admin -p iptables
% su
# iptablesの叩き方はfaqに書いてあったまま。
# iptables -t nat -A PREROUTING -p tcp –dport 0:1024 -j LOG –log-tcp-options –log-ip-options –log-prefix ‘[IPTABLES DROP] : ‘
# iptables -t nat -A PREROUTING -p udp –dport 0:1024 -j LOG –log-tcp-options –log-ip-options –log-prefix ‘[IPTABLES DROP] : ‘
# cp -pr web /var/www/iptables
# の設定ファイル変更
# vi /var/www/iptables/config.php
32 # Password of the MySQL database
33 $db_password=”iptables_user_password”;
:
:
38 # URL Path to your installation
39 $url_base=”/iptables/”;
:
:
41 #debug mode
42 $debug=0;
# ログ収集デーモン(?)の設定を変更
# vi scripts/feed_db.pl
37 my $db_password = ‘iptables_admin_password';
38 my $log_file = ‘/var/log/messages';
# cp -p scripts/feed_db.pl /usr/local/bin/
# scripts/iptablelogがvine用でなかったため、パッチを作成して当てる。
# cat iptablelog.patch
diff -Naur scripts/iptablelog.org scripts/iptablelog
— scripts/iptablelog.org 2006-08-08 23:24:06.000000000 +0900
+++ scripts/iptablelog 2006-08-08 23:22:13.000000000 +0900
@@ -12,6 +12,10 @@
LONGNAME=”iptables logfile analyzer”
NAME=”iptablelog”
DAEMON='/usr/local/bin/feed_db.pl'
+pid=/var/run/$NAME.pid
+
+. /etc/rc.d/init.d/functions
+. /etc/sysconfig/
set -e
@@ -19,12 +23,12 @@
case $1 in
start)
echo -n “Starting $LONGNAME: “;
– start-stop-daemon –start –quiet –pidfile /var/run/$NAME.pid –exec $DAEMON — –background
– echo $NAME;
+ $DAEMON –background
+ echo
;;
stop)
echo -n “Stopping $LONGNAME: ”
– start-stop-daemon –stop –quiet –pidfile /var/run/$NAME.pid || true
+ kill `cat $pid`
rm -f /var/run/$NAME.pid
echo $NAME
;;
# 再起動
# /etc/init.d/iptablelog start
↓スクリーンショット
iptables_logana.png
微妙に失敗してる気が。。。

カテゴリー: サーバ管理 タグ: , , , パーマリンク

IPTables log analyzer への1件のコメント

  1. I’ve read this post and if I could I wish to suggest you few interesting things or tips. Select Thomas Sabo Charms for ones Lover and House http://www.h87.net/plus/view.php?aid=20094

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です