この記事は、Ubuntu14.04へのOSSECのインストールの第2部です。 チュートリアル。
最初の部分では、サーバーとしてOSSECをインストールし、Ubuntu14.04VPSにそのウェブユーザーインターフェースをインストールしました。
今日は、Analogi Web Dashboardをインストールし、別のUbuntu14.04VPSへのOSSECエージェントのインストールについて説明します。次に、インストールされているエージェント(クライアント)をOSSECサーバーに追加します。
それでは、始めましょう。
OSSECをサーバーとしてインストールしたLinuxVPSにログインします。
# ssh root@server_ip
パッケージインデックスを更新し、サーバーで利用可能なアップグレードがあるかどうかを確認します。
# apt-get update && apt-get upgrade
それが見えなくなったら、AnalogiWebダッシュボードをインストールしましょう。 Apacheのデフォルトのドキュメントルートである「/var/ www / html」を入力します:
# cd /var/www/html/
Analogi GITリポジトリのクローンを作成します:
# git clone https://github.com/ECSC/analogi.git
データベース構成ファイルをコピーし、このチュートリアルのパート1で作成したデータベースの値でデータベース設定を変更します。
# cp analogi/db_ossec.php.new analogi/db_ossec.php # nano analogi/db_ossec.php
値を変更すると、次のようになります。
define ('DB_USER_O', 'ossecuser');
define ('DB_PASSWORD_O', 'your_password');
define ('DB_HOST_O', '127.0.0.1');
define ('DB_NAME_O', 'ossec'); ファイルを保存して閉じます。
これで、お気に入りのWebブラウザからAnalogiダッシュボードにアクセスできます。 http:// your_IP_address/analogiを開きます
OSSECエージェントのインストール
次に、OSSECをエージェントとして他のUbuntuインスタンスにインストールする必要があります。ただし、最初に、このチュートリアルの最初の部分に示されているようにモジュールをインストールします。 Ubuntu 14.04インスタンスにLAMPスタックがすでにインストールされている場合は、次に進んで次のコマンドを実行します。
# apt-get install libmysqlclient-dev libapache2-mod-php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
OSSECを「/opt」ディレクトリにダウンロードし、アーカイブを解凍して、解凍したディレクトリに入ります。
# cd /opt # wget https://bintray.com/artifact/download/ossec/ossec-hids/ossec-hids-2.8.3.tar.gz # tar -xzf ossec-hids-2.8.3.tar.gz # cd ossec-hids-2.8.3
次に、OSSECインストールスクリプトを開始し、以下の出力に示す簡単な手順に従います。
# ./install.sh
1- What kind of installation do you want (server, agent, local, hybrid or help)? agent
- Agent(client) installation chosen.
2- Setting up the installation environment.
- Choose where to install the OSSEC HIDS [/var/ossec]:
- Installation will be made at /var/ossec .
3- Configuring the OSSEC HIDS.
3.1- What's the IP Address or hostname of the OSSEC HIDS server?: enter the IP address of the OSSEC server machine
- Adding Server IP xxx.xxx.xx.xxx
3.2- Do you want to run the integrity check daemon? (y/n) [y]:
- Running syscheck (integrity check daemon).
3.3- Do you want to run the rootkit detection engine? (y/n) [y]:
- Running rootcheck (rootkit detection).
3.4 - Do you want to enable active response? (y/n) [y]:
3.5- Setting the configuration to analyze the following logs:
-- /var/log/messages
-- /var/log/auth.log
-- /var/log/syslog
-- /var/log/mail.info
-- /var/log/dpkg.log
-- /var/log/apache2/error.log (apache log)
-- /var/log/apache2/access.log (apache log)
- If you want to monitor any other file, just change
the ossec.conf and add a new localfile entry.
Any questions about the configuration can be answered
by visiting us online at http://www.ossec.net .
- System is Debian (Ubuntu or derivative).
- Init script modified to start OSSEC HIDS during boot.
- Configuration finished properly.
- To start OSSEC HIDS:
/var/ossec/bin/ossec-control start
- To stop OSSEC HIDS:
/var/ossec/bin/ossec-control stop
- The configuration can be viewed or modified at /var/ossec/etc/ossec.conf
Thanks for using the OSSEC HIDS.
If you have any question, suggestion or if you find any bug,
contact us at [email protected] or using our public maillist at
[email protected]
( http://www.ossec.net/main/support/ ).
More information can be found at http://www.ossec.net
--- Press ENTER to finish (maybe more information below). ---
- You first need to add this agent to the server so they
can communicate with each other. When you have done so,
you can run the 'manage_agents' tool to import the
authentication key from the server.
/var/ossec/bin/manage_agents 上記のステートメントが示すように、ここでエージェントをOSSECサーバーに追加する必要があります。 OSSECサーバーコンソールに戻り、エージェントのキーを生成します。次のコマンドを使用します:
# /var/ossec/bin/manage_agents
次に、Aオプションを選択し、新しいエージェントの名前、IPアドレスおよびIDを入力します。下の出力に従ってください:
**************************************** * OSSEC HIDS v2.8.3 Agent manager. * * The following options are available: * **************************************** (A)dd an agent (A). (E)xtract key for an agent (E). (L)ist already added agents (L). (R)emove an agent (R). (Q)uit. Choose your action: A,E,L,R or Q: A - Adding a new agent (use '\q' to return to the main menu). Please provide the following: * A name for the new agent: ossec-client * The IP Address of the new agent: here you should enter the IP address of the OSSEC agent * An ID for the new agent[001]: Agent information: ID:001 Name:ossec-client IP Address:xxx.xx.xxx.xxx Confirm adding it?(y/n): y Agent added.
/ var / ossec / bin / manage_agentsを実行します もう一度コマンドを実行し、エージェントのキーを抽出します:
# /var/ossec/bin/manage_agents **************************************** * OSSEC HIDS v2.8.3 Agent manager. * * The following options are available: * **************************************** (A)dd an agent (A). (E)xtract key for an agent (E). (L)ist already added agents (L). (R)emove an agent (R). (Q)uit. Choose your action: A,E,L,R or Q: E Available agents: ID: 001, Name: ossec-client, IP: enter the IP address of the OSSEC agent Provide the ID of the agent to extract the key (or '\q' to quit): 001 Agent key information for '001' is: MDAxIG9==...... ** Press ENTER to return to the main menu.
キーをコピーして、OSSECエージェントコンソールに切り替えます。 / var / ossec / bin/manage_agentsコマンドを実行します。
# /var/ossec/bin/manage_agents **************************************** * OSSEC HIDS v2.8.3 Agent manager. * * The following options are available: * **************************************** (I)mport key from the server (I). (Q)uit. Choose your action: I or Q: I * Provide the Key generated by the server. * The best approach is to cut and paste it. *** OBS: Do not include spaces or new lines. Paste it here (or '\q' to quit): paste the key that you generated on your OSSEC server Agent information: ID:001 Name:ossec-client IP Address: IP address of the OSSEC agent Confirm adding it?(y/n): y Added.
OSSEC構成ファイルをチェックして、OSSECサーバーが正常に追加されたかどうかを確認できます。
# nano /var/ossec/etc/ossec.conf
OSSECサーバーのIPアドレスは、ファイルの先頭に追加されます:
<client> <server-hostname>xxx.xxx.xx.xxx</server-hostname> </client>
それが完了したら、サーバーマシンとエージェントマシンの両方でOSSECを再起動します。
# /var/ossec/bin/ossec-control restart
これで、標準の Web UIからエージェントを監視できます。 またはアナロジーダッシュボード 。それはあなた次第です。もちろん、OSSECは複雑な侵入検知システムであり、その構成とエージェントを調整することができます。詳細については、OSSECの詳細なドキュメントを確認してください。
おめでとう。これで、OSSECエージェントが正常に構成されてOSSECサーバーに統合されました。 OSSECに別のエージェントを追加する場合は、これと同じ手順に従う必要があります。
もちろん、Linux VPSホスティングサービスのいずれかを使用している場合は、これを行う必要はありません。その場合は、専門のLinux管理者に依頼するだけで済みます。 24時間年中無休でご利用いただけます。リクエストはすぐに処理されます。
PS 。この投稿が気に入った場合は、左側のボタンを使用してソーシャルネットワーク上の友達と共有するか、下に返信を残してください。ありがとう。