Prelude-IDS センサーの追加 - prelude-lml (ログ監視)

更新履歴

  • 2006/06/05 prelude-lml 0.9.4 → 0.9.5 バージョンアップ
  • 2006/04/24 初版

概要

  • syslog,apache等のログを監視するためのセンサー
  • 以下のログが監視可能
    • apc-emu,arbor,arpwatch,checkpoint,cisco-pix,cisco-router,cisco-vpn,clamav,dell-om,f5-bigip,grsecurity,honeyd,httpd,ipchains,ipfw,ipso,linksys-wap11,modsecurity,ms-sql,nagios,navce,netapp-ontap,netfilter,netscreen,ntsyslog,openhostapd,pam,pcanywhere,pcre,portsentry,postfix,proftpd,qpopper,selinux,sendmail,shadow-utils,single,squid,ssh,sudo,tripwire,vigor,vpopmail,webmin,wu-ftp,zywall,zyxel
  • 本手順では、Prelude-IDSのマネージャと同一のサーバ上にインストールする
  • 主な使い方としては、以下のようなことが考えられる。
    • prelude-managerを導入したサーバを syslogサーバ にして複数のサーバのsyslogを監視する
    • apache等のアプリケーションログを監視する

バージョン

  • prelude-lml 0.9.5   ログ監視センサー

インストール環境

  • CentOS4.3 (X + Gnome + 開発環境)

前提条件

  • Prelude Manager が正常に動作していること

参考URL

インストール手順

prelude-lml インストール

  • Log analyzer センサー(ログファイル監視センサー)をインストールする。
# cd /usr/local/src
# wget http://www.prelude-ids.org/download/releases/prelude-lml-latest.tar.gz
# tar xvzf prelude-lml-latest.tar.gz
# cd prelude-lml-0.9.5
# ./configure

~ 省略 ~

*** Dumping configuration ***
    - Enable FAM support                : yes
    - Enable unsupported rulesets:      : yes

# make
# make install
  • インストール完了後、prelude-lml の設定を行う。
  • 基本的には サンプルの記述をコメントアウトするのみ。
# vi /usr/local/etc/prelude-lml/prelude-lml.conf

/usr/local/etc/prelude-lml/prelude-lml.conf

##############################################
# Configuration for the Prelude LML Sensor   #
##############################################

include = /usr/local/etc/prelude/default/idmef-client.conf


# Address where the Prelude Manager Server is listening on.
# if value is "127.0.0.1", the connection will occur throught
# an UNIX socket.
#
# This entry is disabled. The default is to use the entry 
# located in the Prelude system wide clients.conf. You may 
# overwrite the default address for this sensor by uncommenting 
# this entry.
#
# server-addr = 127.0.0.1


#
# Files to monitor
#
# You should define the log message prefix-regex and time-format within a
# [format] section. If not specified, the default syslog format will be used.
#
# The prefix-regex should contain PCRE named subpatterns to pick out the
# information available in your syslog's prefix.
#
# The available field names are:
#   - hostname
#   - program
#   - pid
#   - timestamp
#
# Please see pcrepattern(3) manpage for help writing the prefix-regex
# In order to set the time-format, please have a look at the strptime(3) manpage.
#
# Example configuration for syslog output:
#
# Each [format] section might have several file entry.
# Each [format] section might have several udp-server entry.
#
# The same file entry / udp-server entry might be duplicated accross
# differents formats.


[format=syslog]
time-format = "%b %d %H:%M:%S" 
prefix-regex = "^(?P<timestamp>.{15}) (?P<hostname>\S+) (?:(?P<process>\S+?)(?:\[(?P<pid>[0-9]+)\])?: )?"
file = /var/log/messages
file = /var/log/secure
# udp-server = 0.0.0.0


#
# Example configuration for metalog output:
#
#[format=metalog]
#prefix-regex = "^(?P<timestamp>.{15}) \[(?P<program>\S+)\] "
#time-format = "%b %d %H:%M:%S" 
#file = /var/log/everything/current
# udp-server = 0.0.0.0


#
# Example configuration for apache output:
#
#[format=apache]
#time-format = "%d/%b/%Y:%H:%M:%S"
#prefix-regex = "^(?P<hostname>\S+) - - \[(?P<timestamp>.{20}) \+.{4}\] "
#file = /var/log/apache2/access_log


#
# Specifies the maximum difference, in seconds, between
# the interval of two logfiles' rotation. If this difference 
# is reached, a high severity alert will be emited
#
#max-rotation-size-offset = 1024
#max-rotation-time-offset = 300


#
# Maximum number of warning a given source should emit in case it can not
# parse log entry with the provided prefix_regex and time_format. 
#
# -1 == unlimited number of warning
#  0 == no warning at all 
#  X == print at most X warnings.
#
# warning-limit = -1


####################################
# Here start plugins configuration #
####################################

[Pcre]

ruleset=/usr/local/etc/prelude-lml/ruleset/pcre.rules


# [Debug]
#
# This plugin issue an alert for each packet.
# Carefull to the loging activity it generate.
# 
# Triger Report to the console.
# stderr

prelude-lml センサー登録

  • Log analyzer センサーを manager にレジストレーション(登録)する。
  • レジストレーションサーバ用ターミナル(term01)と登録用ターミナル(term02)を切り替えて作業を行う。
    • 画面左のプロンプトに注目
  • 最初に、レジストレーションサーバを起動する。(term01)
  • レジストレーションサーバを起動すると、登録用のパスワードが表示される。
  • そのパスワードを使用して、センサー側で作業を行う。
[term01]# 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: 3867103799399940.
  - Using /usr/local/var/spool/prelude/prelude-manager...

- Starting registration server.
  - generated one-shot password is "auowxshu". ※登録のためのパスワード

    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...
  • 次に、Log analyzer センサーをマネージャに登録する。(term02)
  • 登録に際には、マネージャを起動した際に表示された登録用パスワードが必要となる。
[term02]# prelude-adduser register prelude-lml "idmef:w admin:r" localhost --uid prelude --gid prelude

- 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 prelude-lml.
  - Creating /usr/local/etc/prelude/profile/prelude-lml...
  - Allocated ident for prelude-lml: 1721540001784225.
    - 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/prelude-lml...

- Registering analyzer idmef:w admin:r to localhost: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 (localhost:5553)...
  - Anonymous authentication to registration-server successful.
  - Sending certificate request.
  - Receiving signed certificate.
  • マネージャ側で登録するか確認画面が表示されているので “y” を入力する。(term01)
 レジストレーションサーバを起動しているターミナルに移動すると
 登録確認画面になっているので「y」を入力する

  - Connection from 127.0.0.1:32952.
  - Anonymous authentication one-shot password check successful.
  - Waiting for client certificate request.
  - Analyzer with ID="1721540001784225" ask for registration with permission="idmef:w admin:r".
    Approve registration [y/n]: y ※y を入力
    Registering analyzer "1721540001784225" with permission "idmef:w admin:r".
  - Generating signed certificate for client.
  - Sending server certificate to client.
  - 127.0.0.1:32952 successfully registered.
  • Log analyzer センサー側で登録が完了しているか確認する。(term02)

- Receiving CA certificate.

- prelude-lml registration to localhost successful.

prelude-lml センサー起動

  • Log analyzer センサーを 起動する。
# prelude-lml &
  • Prewikkaにログインして、[Agents] を選択すると、”prelude-lml” が追加されている。

センサー一覧

  • アラート一覧画面は以下のようになる。

アラート一覧

 
ids/prelude_sensor_prelude-lml.txt · 最終更新: 2007/10/16 12:02
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki NINJA TOOLS