■ [osiris]osiris3.0.4のインストール記録(WSMから本人投稿を再掲載 2004年2月)
osirisはDarwinに標準で対応しているため、samhainよりも実際の面倒は少ないです。Mac特有のリソースファイルなどにも対応しているということなので、OSXにはsamhainよりも適切かもしれません。また、samhainとは異なり、基本がClient/Serverタイプなので1台で利用する場合にもosiris、osirisd、osirismdの3つが必要になります(make allコマンドで全部準備されます)が、複数台の管理を前提に作られているようで、この仕様は使ってみると本当に便利でした。

こちらは最新版が3.0.4になりますが、全く問題なくコンパイルできます。HPのドキュメントとコンパイル時に表示される情報では、コンパイル時の情報を参照する方がおすすめです。ちなみにsystem typeはOSX10.3.2ではpowerpc-apple-darwin7.2.0でした。

■ [osiris]コンパイルから管理コンソールのインストール
osiris-3.0.4-current.tar.gzをダウンロードして展開します。

[code]$tar -zxvf osiris-3.0.4-current.tar.gz[/code]

展開したディレクトリに移動しコンパイル準備します。

[code]$cd osiris-3.0.4-current
$./configure[/code]

ここで、makeについて注意が表示されます。実際に利用するのは以下の2つでいいでしょう。

[code]$make all (1台のマシンに全部インストールする場合or管理マシンの場合)
$make package (管理対象クライアントにインストールするパッケージ作成[/code])

まずは、管理用マシンでmakeしてインストールしてみます。

[code]$make all
$sudo make install[/code]

これでインストールを始めると、途中「make[3]: Nothing to be done for `install-exec-am’」のようなエラーみたいなlogが大量に出ますが、気にする必要はありません。

それが終わると最初の設定を要求されます。これらの設定は多くが対話型で進むので、非常にわかりやすいと思います。

[code]No Osiris user or group exists, determined uid/gid is: 502
Continue with installation? (y/n)[/code]
osirisのユーザをシステムに新規作成します。続けてよければyとします。

[code]Install management console? (y/n)[/code]
マネジメントコンソールをインストールします。こちらもyとします。

[code]Installation directory for binaries: [/usr/sbin/][/code]

/usr/sbin/にosirisがインストールされます。リターンキーでOKです。

これでosirisがインストールされます。続けて、

[code]Start management console now? (y/n)[/code]

マネジメントコンソールをスタートするか聞かれます。yにします。

SSL接続用のRSA Keyが作成されます。

[code]Start scan agent now? (y/n)[/code]

スキャンエージェントをスタートするか聞かれます。yにしておきます。

これで管理用マシンのインストールが完了です。

■ [osiris]クライアントのパッケージ作成とインストール
次に管理対象のosirisクライアント用のパッケージを作成します。先ほどのディレクトリosiris-3.0.4-currentで、以下のようにします。

[code]$make clean
$sudo make package[/code]

これが完了するとosiris-3.0.4-current/src/installに以下のファイルが作成されます。

[code]osiris-3.0.4-current.Darwin.tar.gz[/code]

これを管理したいマシンにコピーして、以下のようにインストールを行います。

[code]$tar -zxvf osiris-3.0.4-current.Darwin.tar.gz
$cd osiris-3.0.4-current
$sudo ./install.sh[/code]

これでインストールが始まります。終了間際に

[code]Start scan agent now? (y/n)[/code]

スキャンエージェントをスタートするか聞かれますのでyにしておきます。
これでクライアント側の準備も完了です。

■ [osiris]管理コンソールの設定
ここから設定に入ります。管理マシンでosiris関係デーモンが起動しているか確認します。

[code]$ ps aux | grep osiris

osiris 14611 0.0 0.2 29116 876 p1 S 6:01PM 0:00.01 /usr/sbin/osirismd
osiris 14612 0.0 0.2 29116 1116 p1 S 6:01PM 0:00.05 /usr/sbin/osirismd
root 14614 0.0 0.1 27812 784 p1 S 6:03PM 0:00.01 /usr/sbin/osirisd
osiris 14615 0.0 0.2 27816 1280 p1 S 6:03PM 0:00.04 /usr/sbin/osirisd
user 15481 0.0 0.3 28912 1824 p1 S+ 6:19PM 0:00.06 osiris
user 15488 0.0 0.1 18172 344 std S+ 6:22PM 0:00.01 grep osiris[/code]

管理用マシンでosirisコマンドを起動します。

[code]$ osiris[/code]

すると以下のような起動画面が出ます。(osorisはコマンドラインで操作します)

[code]Osiris command line management utility – version 3.0.4-current
unable to load root cert for management host:
(/Users/username/.osiris/osiris_root.pem)
fetching root certificate from management host (localhost).
The authenticity of host ‘localhost’ can’t be established.

[ server certificate ]
subject = /C=US/CN=Osiris Managment Daemon/OU=Osiris IDS
issuer = /C=US/CN=Osiris Managment Daemon/OU=Osiris IDS
key size: 2048 bit
MD5 fingerprint: AE:67:D1:27:F3:55:96:08:98:38:CA:04:86:A8:06:40

Verify the fingerprint specified above.

Are you sure you want to continue connecting (yes/no)?[/code]

接続しますか?と聞かれるので、yを入力します。

[code]authenticating to (localhost)
User:[/code]

接続するとユーザ名を入力しろと言われるので「admin」と入力します。

[code]User: admin
Password:[/code]

パスワードを聞かれますが、設定していないので、ここでは単純にリターンキー

を押します。すると以下の画面になります。

[code]connected to management daemon, code version (3.0.4-current).
hello.

osiris-3.0.4-current:[/code]

このプロンプトの後でまず最初にやるべきことはパスワード設定です。

[code]osiris-3.0.4-current:passwd admin[/code]

と入力することでパスワード設定ができます。

[code]osiris-3.0.4-current:passwd admin
password:[/code]

となるので、パスワードを入力してください。

再度確認で入力を求められるので、同じパスワードを入力して設定完了です。
設定したパスワードは次回接続から有効です。
パスワードの設定が終わると再度以下の表示になります。

[code]osiris-3.0.4-current:[/code]

ここでプロンプトに?と入力するとhelpが表示されます。

[code][ Managment Commands ]
mhost host new-user edit-filters
edit-mhost edit-host edit-user print-filters
print-mhost-config list-hosts list-users
test-notify new-host delete-user

[ Host commands ]
status list-configs start-scan list-db
watch-host import-config stop-scan base-db
disable-host push-config set-base-db
host-details edit-config list-logs print-db
print-host-config print-config print-log print-db-errors
rm-host rm-config print-db-header
drop-config rm-db
verify-config
new-config

[ Misc commands ]
help version quit ssl
For help with a specific command, try: help [/code]

まずは管理用マシン自体の設定をします。
edit-mhostと入力してリターンキーを押すと後は対話的に進みます。

[code]osiris-3.0.4-current: edit-mhost

[ edit management host (localhost) ]
> syslog facility [DAEMON]:  ←リターンキー
> syslog level [NOTICE]:  ←リターンキー
> log intensity [LOW]:  ←リターンキー
> control port [2266]:  ←標準でよければリターンキー
> http host name (uses system name by default) []: myhost  ←管理マシンのホスト名
> http control port [2267]:  ←標準でよければリターンキー
> notification email []: user@mydomain.com  ←通知を受けたいメールアドレス
> notification smtp host [127.0.0.1]: 192.168.0.10 ←メールサーバのIPアドレス
> notification smtp port [25]:  ←リターンキー
> authorized hosts:

127.0.0.1

Modify authorization list (y/n)? [n]  ←管理ホストからだけ操作できればいいならリターンキー

[ management config (localhost) ]
syslog_facility = DAEMON
syslog_level = NOTICE
log_intensity = LOW
control_port = 2266
http_port = 2267
http_host = myhost
notify_email = user@mydomain.com
notify_smtp_host = 192.168.0.10
notify_smtp_port = 25
hosts_directory =
allow = 127.0.0.1

Is this correct (y/n)? y ←よければリターンキー

management host config sucessfully saved.[/code]

これで管理用マシンの設定は完了です。

■ [osiris]チェックする対象マシンの設定
管理用のマシン設定ができたところで、チェック対象のクライアントの設定に入ります。まず、管理対象クライアントをnew-hostコマンドで登録します。管理用マシンそのものももちろん対象にできます。ここからも対話的に設定できます。

[code]osiris-3.0.4-current: new-host

[ new host ]
> name this host []: myclient01 ←クライアントのホスト名
> hostname/IP address []: 192.168.0.101 ←クライアントのIPアドレス(管理用マシン自身を対象にするなら127.0.0.1でOK)
> description []: PBG4 ←クライアントの説明(任意記述)
> enable scan logging for this host? (yes/no) [no]: y ←logをとる場合にy
> archive scan databases for this host? (yes/no) [no]:  ←スキャン毎の結果を保存したい場合にy
> enable admin email notification for this host? (yes/no) [yes]:  ←メールでの通知が必要ならy
> send scan notification, even when no changes detected (yes/no) [no]:  ←変化なしでも通知が必要ならy
> notification email (default uses mhost address) []:  ←通知アドレスが管理用マシンの登録と同じでOKならリターンキー
> configure scan scheduling information? (yes/no) [no]: yes  ←スキャンスケジュールを調整するならy(標準は1日毎)

[ scheduling information for myhost ]
Scheduling information consists of a start time and a frequency value.
The frequency is a specified number of minutes between each scan, starting
from the start time. The default is the current time. Specify the start
time in the following format: mm/dd/yyyy HH:MM
enter the start date and time

using ‘MM/DD/YYYY hh:mm’ format: [Fri Feb 13 18:40:12 2004]  ←タイムスタンプフォーマット変更
enter scan frequency in minutes: [daily (1440)] 180 ←1分単位で指定できます
> activate this host? (yes/no) [no]: yes ←スキャンを有効にするならy

host => myclient01
hostname/IP address => 192.168.0.101
description => PBG4
host type => generic
log enabled => yes
archive scans => no
notifications enabled => yes
notifications always => no
notify email => (managment config)
scans starting on => Fri Feb 13 18:40:12 2004
scan frequency => every 180 minutes
enabled => yes

Is this correct (y/n)? y ←設定内容がOKならy
the new host (myhost) was sucessfully created.
initialize this host? (yes/no): y  ←すぐに始めるならy(対象クライアントにosirisdが起動している必要あり)

Initializing a host will push over a config, start
a scan, and set the created database to be the
trusted database.

Are you sure you want to initialize this host (yes/no): y ←すぐに始めるならy(対象クライアントにosirisdが起動している必要あり)

OS Name: Darwin ←対象クライアントから自動判別
OS Version: 7.2.0

use the default config for this OS? (yes/no): y ←該当OS用の標準設定でよければy
The config: default.darwin has been pushed.

perform an initial scan and database for this host? (yes/no): y ←すぐに始めるならy
scanning process was started on host: myclient01

osiris-3.0.4-current:[/code]

これでクライアントの設定が完了です。

設定と同時に初期のデータベース登録と、最初のスキャンを始めているので上記の設定であれば、3時間毎に該当クライアントをスキャンして異常があれば、user@mydomain.comにメールで通知されることになります。

対象ホストが複数ある場合には上記の手順を必要なだけ繰り返すことで、管理対象を増やすことができます。

■ [osiris]通知メールの詳細
osirisが送信してくるメールを紹介しておきます。設定した項目がどこに反映されているかもわかりやすいと思うので確認してみてください。これはOSXServerにユーザを一人追加した際に送られてきたものです。

ここに書かれたURLをクリックするとosirisの管理用マシンにブラウザでアクセスします。そして同じアラート内容が表示されますが、そのページの一番下に「accept」というボタンがあります。このボタンを押すとこの変更を確認したということで、データベースが更新されます。確認するまでosirisのスキャンが走る度に同じアラートを送り続けるようです(未確認)。

また、このURLにアクセスするブラウザのIPアドレスはedit-mhostでauthorized hostsに登録する必要があるようです。*も使えるとありますが、うちでは機能しませんでした。:-(

[code]From: osirismd@myhost
Subject: scan log – [1 changes][host: myclient01]
Date: 2004年2月11日 23:34:27:JST
To: user@mydomain.com

If these changes are approved, visit the URL below to set the latest scan database to be the trusted database. Or, login to the management console and set the trusted database to (2). If these notifications persist, you may need to modify the scan config for this host or set some comparison filters.

compare time: Wed Feb 11 23:34:24 2004
host: myclient01
scan config: default.darwin
log file: 5
base db: 1
compare db: 2

[myclient01][new][user:testuser]

Change Statistics:

———————————-

checksums: 0
SUID files: 0
root-owned files: 0
file permissions: 0
new: 1
missing: 0
total differences: 1[/code]

※再掲載に当たって一部修正しています。

, ,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...
Trackback

no comment untill now

Sorry, comments closed.