# yum install gnutls-devel # rpm -qa |grep gnutls gnutls-1.0.20-3.2.2 gnutls-devel-1.0.20-3.2.2 # # rpm -qa |grep "^python-" python-urlgrabber-2.9.6-2 python-elementtree-1.2.6-4 python-sqlite-1.1.6-1 python-2.3.4-14.2 python-devel-2.3.4-14.2 python-ldap-2.0.1-2 # # yum install pcre-devel # rpm -qa |grep pcre pcre-4.5-3.2.RHEL4 pcre-devel-4.5-3.2.RHEL4 # # vi /etc/ld.so.conf.d/local-i386.conf ※新規作成(ファイル名は適当)
/etc/ld.so.conf.d/local-i386.conf
以下を追加 /usr/local/lib
# cd /usr/local/src
# wget http://www.prelude-ids.org/download/releases/libprelude-latest.tar.gz
# tar xvzf libprelude-latest.tar.gz
# cd libprelude-0.9.9
# ./configure
~ 省略 ~
*** Dumping configuration ***
- Generate documentation : no
- Perl binding : yes
- Python binding : yes
# make
# make install
# ldconfig
#
# libprelude-config --version
0.9.9
#
# yum install pcre-devel # # groupadd snort # useradd -g snort -d /dev/null -s /sbin/nologin snort # # cd /usr/local/src/ # wget http://www.snort.org/dl/current/snort-2.4.5.tar.gz # tar xvzf snort-2.4.5.tar.gz # cd snort-2.4.5 # ./configure --prefix=/usr/local/snort \ --enable-prelude \ # make # make install # # mkdir /etc/snort # cd /etc/snort # wget http://www.snort.org/pub-bin/oinkmaster.cgi/<Oinkコード>/snortrules-snapshot-2.4.tar.gz # tar xvzf snortrules-snapshot-2.4.tar.gz # vi /etc/snort/snort.conf
/etc/snort/snort.conf
アウトプットの設定で以下を追加する。 その他の設定については環境に応じて適宜設定すること output alert_prelude: profile=snort
# mkdir /var/log/snort # chown -R snort:snort /etc/snort/ # chown -R snort:snort /var/log/snort/ # # vi /etc/init.d/snort
/etc/init.d/snort
#!/bin/sh
#
# chkconfig: 2345 95 95
# description: snort
#
# processname: /usr/local/snort/bin/snort
# config: /etc/snort/snort.conf
# pidfile: /var/run/snort_eth0.pid
#
. /etc/rc.d/init.d/functions
SERVICE="snort"
SERVER="/usr/local/snort/bin/snort"
ARGS="-u snort -g snort -deD -k none -c /etc/snort/snort.conf -i eth0 -l /var/log/snort -m 022"
case "$1" in
start)
echo -n "Starting $SERVICE"
daemon $SERVER $ARGS
echo
touch /var/lock/subsys/$SERVICE
;;
stop)
echo -n "Stopping $SERVICE"
killproc $SERVICE
echo
rm -f /var/lock/subsys/$SERVICE
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $SERVICE {start|stop|restart}"
exit 1
esac
exit 0
# chmod +x /etc/init.d/snort # chkconfig --add snort # chkconfig --list |grep snort snort 0:off 1:off 2:on 3:on 4:on 5:on 6:off #
[manager]# prelude-adduser registration-server prelude-manager ※レジストレーションサーバの起動
- Using default TLS settings from /usr/local/etc/prelude/default/tls.conf:
- Generated key size: 1024 bits.
- Authority certificate lifetime: unlimited.
- Generated certificate lifetime: unlimited.
- Using analyzer prelude-manager.
- Using /usr/local/etc/prelude/profile/prelude-manager...
- Using already allocated ident for prelude-manager: 1420789215634754.
- Using /usr/local/var/spool/prelude/prelude-manager...
- Starting registration server.
- generated one-shot password is "3zf0e9cm". ※登録のためのパスワード
This password will be requested by "prelude-adduser" in order to connect.
Please remove the first and last quote from this password before using it.
- Generating 1024 bits Diffie-Hellman key for anonymous authentication...
- Waiting for peers install request on 0.0.0.0:5553...
[sensor]# prelude-adduser register snort "idmef:w admin:r" <マネージャIPアドレス> --uid snort --gid snort
- Using default TLS settings from /usr/local/etc/prelude/default/tls.conf:
- Generated key size: 1024 bits.
- Authority certificate lifetime: unlimited.
- Generated certificate lifetime: unlimited.
- Creating analyzer snort.
- Creating /usr/local/etc/prelude/profile/snort...
- Allocated ident for snort: 1388340738087019.
- Generating RSA private key... This might take a very long time.
[Increasing system activity will speed-up the process.]
- Generating 1024 bits RSA private key... Done.
- Creating /usr/local/var/spool/prelude/snort...
- Registering analyzer idmef:w admin:r to <マネージャIPアドレス>:5553.
You now need to start "prelude-adduser" on the server host where
you need to register to:
use: "prelude-adduser registration-server <analyzer profile>"
example: "prelude-adduser registration-server prelude-manager"
This is used in order to register the 'sending' analyzer to the 'receiving'
analyzer. <analyzer profile> should be set to the profile name of the
'receiving' analyzer, the one where 'sending' analyzer will register to.
Please remember that "prelude-adduser" should be used to register
every server used by this analyzer.
Enter the one-shot password provided by the "prelude-adduser" program:
- enter registration one-shot password: レジストレーションサーバで表示されたパスワードを入力
- confirm registration one-shot password: レジストレーションサーバで表示されたパスワードを入力
- connecting to registration server (<マネージャIPアドレス>:5553)...
- Anonymous authentication to registration-server successful.
- Sending certificate request.
- Receiving signed certificate.
レジストレーションサーバを起動しているターミナルに移動すると
登録確認画面になっているので「y」を入力する
- Connection from <センサーIPアドレス>:32788.
- Anonymous authentication one-shot password check successful.
- Waiting for client certificate request.
- Analyzer with ID="1388340738087019" ask for registration with permission="idmef:w admin:r".
Approve registration [y/n]: y ※y を入力
Registering analyzer "1388340738087019" with permission "idmef:w admin:r".
- Generating signed certificate for client.
- Sending server certificate to client.
- <センサーIPアドレス>:32788 successfully registered.
- Receiving CA certificate. - snort registration to <マネージャIPアドレス> successful.
# vi /usr/local/etc/prelude-manager/prelude-manager.conf
/usr/local/etc/prelude-manager/prelude-manager.conf
25行目を修正
15 # Address where the prelude-manager server is listening on.
16 # if value is unix, or unix:/path/to/unix/socket, an UNIX domain
17 # socket will be used.
18 #
19 # Multiple listen address are supported.
20 #
21 # listen = address:port
22 # listen = unix:/tmp/prelude-manager.socket
23 # listen = unix
24 #
25 listen = 0.0.0.0
26
# vi /usr/local/etc/prelude/default/client.conf
/usr/local/etc/prelude/default/client.conf
19行目を修正
10 # Try to connect on a Manager listening on 127.0.0.1.
11 #
12 # server-addr = x.x.x.x:port || y.y.y.y && z.z.z.z
13 #
14 # This mean the emission should occur on x.x.x.x:port or, if it fail,
15 # on y.y.y.y and z.z.z.z (if one of the two host in the AND fail,
16 # the emission will be considered as failed involving saving the
17 # message locally).
18
19 server-addr = <prelude-manager IPアドレス>