[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:34822] snortについて



山崎と申します。いつもこちらでお世話になっております。


Debianのsnortパッケージの動作についてご存知の方がおられま
したら情報をご提供いただけないかと思いまして投げさせていただいておりま
す。m(_ _)m


私はwoodyを利用していて、先日snortのパッケージを導入しました。具体的にイ
ンストールしたのは次のパッケージです。

・snort
・snort-common
・snort-rules-default
・snort-doc

インストール時にsnortの設定に関するdebconfの質問がありましたが、後で
dpkg-reconfigure snort
を実行して再設定するつもりでしたので、全てそのまま<Enter>を押して進めま
した(debconfのメモをとり忘れていてスミマセン)。

インストール後問題なくsnortは動作していたので、設定をやり直すため
dpkg-reconfigure snort
を実行したところ、次のようなdebconfが表示されました。

----------------------------------------------------------------------
○Question 1.
Snort can be started at boot time, when connecting to the net (good for
dialup hosts which use the ppp0 or ippp0 device) or only if you manually
start it via "/usr/sbin/snort".

When should snort be started?


○Question 2.
On which interface snort should listen? (only one!)


○Question 3.
You have to use CIDR form, i.e. 192.168.1.0/24 for a block of 256 IPs or
192.168.1.42/32 for just one.

Please enter the address range that snort will listen on.


○Question 4.
Disabling the promiscuous mode means that snort will only see packets
addressed to it's own interface. Enabling allows it to check every
packet that passes the ethernet even if it's a connection between two
other computers

Should I disable the promiscous mode?


○Question 5.
If you change snort's rules testing order to Pass|Alert|Log, they will
be applied in Pass->Alert->Log order, instead of standard
Alert->Pass->Log. This will prevent people from having to make huge BPF
command line arguments to filter their alert rules.
Should snort's rules testing order be changed to Pass|Alert|Log?


○Question 6.
If you want to specify custom options to 'snort', please specify them
here:


○Question 7.
Who should receive the daily statistic mails?


○Qustion 8.
An alert needs to appear more than this times to go to the stats.
----------------------------------------------------------------------

明らかにインストール時の設定よりも項目が多かったのですが、適切と思われる
設定をして終了いたしました。
ところが、設定通りになっているのかを確認するために
/etc/snort/snort.conf
を確認してみたのですが、debconfで行った設定は反映されていませんでした。
よく見ると
/etc/snort/snort.debian.conf
というファイルがあったのでこちらも確認してみたのですが、中身は空っぽでし
た。以前localeのインストール時にlocale-genされないといったことがありまし
たので、試しにもう一度
dpkg-reconfigure snort
を実行して設定してみたのですが、設定ファイルは何の変化もないようでした。
ここまでの現象で、ひょっとしたらDebianのsnortは設定ファイルを使用せずコ
マンドに引数を指定しているのかと考えまして、起動スクリプト確認することに
しました。以下がインストールされた起動スクリプトです。

----------------------------------------------------------------------
#!/bin/sh -e

test $DEBIAN_SCRIPT_DEBUG && set -v -x

test -f /usr/sbin/snort || exit 0

DAEMON=/usr/sbin/snort
CONFIG=/etc/snort/snort.debian.conf

test -f $CONFIG && . $CONFIG

test -z "$DEBIAN_SNORT_HOME_NET" && DEBIAN_SNORT_HOME_NET="192.168.0.0/16"

# to find the lib files
cd /etc/snort

case "$1" in
  start)
        test "$DEBIAN_SNORT_STARTUP" = "dialup" && exit 0
        test "$DEBIAN_SNORT_STARTUP" = "manual" && \
                echo $0 | grep -q 'S[0-9]' && exit 0
        echo -n "Starting Network Intrusion Detection System: snort"
        set +e
        /sbin/start-stop-daemon --start --quiet --exec $DAEMON -- \
                -D \
                -S "HOME_NET=[$DEBIAN_SNORT_HOME_NET]" \
                -h "$DEBIAN_SNORT_HOME_NET" \
                -c /etc/snort/snort.conf \
                -l /var/log/snort \
                -b \
                -d  \
                -u snort \
                -g snort \
                $DEBIAN_SNORT_OPTIONS >/dev/null
        case "$?" in
          0) echo "." ;;
          1) echo "...already running." ;;
          2) echo "...failed." ;;
        esac
        set -e
        ;;
  stop)
        echo -n "Stopping Network Intrusion Detection System: snort"
        /sbin/start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
>/dev/nul
l
        # If it isn't willing we shoot it!
        if ls /var/run/snort_*pid >/dev/null 2>&1 ; then
          sleep 3
          ps cax \
                | grep '/usr/sbin/snort' \
                | awk '{ print $1 }' \
                | xargs --no-run-if-empty kill -9 >/dev/null
          rm -f /var/run/snort_*.pid
        fi
        echo "."
        ;;
  restart|force-restart|reload|force-reload)
        /etc/init.d/snort stop
        # stop will take care that the thing is really dead
        /etc/init.d/snort start
        ;;
  *)
        echo "Usage: /etc/init.d/snort start|stop|restart"
        exit 1
        ;;
esac
exit 0
----------------------------------------------------------------------

私はシェルスクリプトは勉強し始めたばかりで詳しくわからないのですが、
snort.debian.confのファイルの有無を確かめたりしているくらいのことは理解
できました。ですが、現在どのような設定でsnortが起動しているのかもわから
ずじまいです。

きちんと動作しているようなのでインストールの問題とかではないのですが、運
用するにあたって動作について知っておきたいと思っています。通常のsnortの
設定はsnort.confの修正で良いはずなのですが、Debianなりのやり方があるのか
な?と気になっています。

もしご存知の方がおられましたら、どうぞよろしくお願いいたします。m(_ _)m


--------------------------------------------------
山崎 満博
E-mail:yamazaki@xxxxxxxxxxxxxxxxxxx
--------------------------------------------------