GNU/Linux >> Linux の 問題 >  >> Panels >> Panels

Ubuntu14.04にOSSECをインストールします

この記事は、 Ubuntu14.04VPSにOSSECサーバー/エージェントをインストールするための完全なチュートリアルの最初の部分です。 。このパートでは、OSSEC 2.8.3(このチュートリアルが作成されたときの最新の安定バージョン)のインストール、Web UIのインストール、およびOSSECのMySQLサポートを有効にする方法について説明します。

OSSECは、オープンソースのホストベースの侵入検知システムです。 HIDS(ホストベースの侵入検知)とセキュリティインシデント管理(SIM)/セキュリティ情報およびイベント管理(SIEM)のすべての側面を、シンプルで強力なオープンソースソリューションに統合します。

OSSECの主な利点は次のとおりです。

  • コンプライアンス要件
  • マルチプラットフォーム
  • リアルタイムで構成可能なアラート
  • 現在のインフラストラクチャとの統合
  • 集中管理
  • エージェントとエージェントレスの監視

OSSECは、ログ分析、ファイル整合性チェック、ポリシーモニタリング、ルートキット検出、リアルタイムアラート、およびアクティブレスポンスを実行します。 OSSECがサポートするオペレーティングシステムとログ形式を確認するには、OSSECのページにアクセスしてください。

要件

このチュートリアルでは、SSD 1LinuxVPSホスティングプランを使用します。

SSH経由でサーバーにログインします:

# ssh root@server_ip

開始する前に、以下のコマンドを入力して、マシンに適切なバージョンのUbuntuがインストールされているかどうかを確認してください。

# lsb_release -a

下の出力が表示されるはずです:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:        14.04
Codename:       trusty

システムを更新する

サーバーが完全に最新であることを確認してください:

# apt-get update && apt-get upgrade

次に、以下のコマンドを使用して、Apache、MySQL、PHP、およびいくつかの必要なモジュールをインストールします。

# apt-get install mysql-server libmysqlclient-dev mysql-client apache2 php5 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

OSSECのダウンロード:

# 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

MySQLデータベースのサポートを有効にします:

# cd src

# make setdb

前のディレクトリに戻ります:

# cd ../

次に、OSSECインストールスクリプトを開始し、簡単な手順に従います。

# ./install.sh

その下には、インストール手順全体と有効にした機能の出力があります。もちろん、有効/無効にするオプションを選択しますが、以下の出力に従うことをお勧めします。質問するたびにデフォルトの選択肢(角かっこで囲まれている)を使用する場合は、Enterキーを押すことができます。

OSSEC HIDS v2.8.3 Installation Script - http://www.ossec.net

 You are about to start the installation process of the OSSEC HIDS.
 You must have a C compiler pre-installed in your system.
 If you have any questions or comments, please send an e-mail
 to [email protected] (or [email protected]).

  - System: Linux vps 2.6.32-042stab113.11
  - User: root
  - Host: vps.rosehosting.com


  -- Press ENTER to continue or Ctrl-C to abort. --

Enterキーを押します。

1- What kind of installation do you want (server, agent, local, hybrid or help)? server

  - Server 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- Do you want e-mail notification? (y/n) [y]:

   - What's your e-mail address? [email protected]
   - What's your SMTP server ip/host? smtp.example.com

  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- Active response allows you to execute a specific
       command based on the events received. For example,
       you can block an IP address or disable access for
       a specific user.
       More information at:
       http://www.ossec.net/en/manual.html#active-response

   - Do you want to enable active response? (y/n) [y]:

     - Active response enabled.

   - By default, we can enable the host-deny and the
     firewall-drop responses. The first one will add
     a host to the /etc/hosts.deny and the second one
     will block the host on iptables (if linux) or on
     ipfilter (if Solaris, FreeBSD or NetBSD).
   - They can be used to stop SSHD brute force scans,
     portscans and some other forms of attacks. You can
     also add them to block on snort events, for example.

   - Do you want to enable the firewall-drop response? (y/n) [y]:

     - firewall-drop enabled (local) for levels >= 6

   - Default white list for the active response:
      - xxx.xxx.xxx.xx
      - xx.xxx.xx.xxx

   - Do you want to add more IPs to the white list? (y/n)? [n]:

  3.5- Do you want to enable remote syslog (port 514 udp)? (y/n) [y]:

   - Remote syslog enabled.

  3.6- 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 .


   --- Press ENTER to continue ---

次に、Enterキーを押してインストールを続行します。これには、2分以上かかることはありません。すべてが完了すると、次のようになります。

- 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). ---

    - In order to connect agent and server, you need to add each agent to the server.
   Run the 'manage_agents' to add or remove them:

   /var/ossec/bin/manage_agents

OSSECを起動します:

# /var/ossec/bin/ossec-control start

次のステップは、OSSEC用のMySQLユーザーとデータベースを作成することです。ルートとしてMySQLを入力してください:

# mysql -u root -p

mysql> create database ossec;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on ossec.* to ossecuser@localhost identified by 'your_password';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

OSSECはデータベースのスキーマを提供し、それはsrc /os_dbd/ディレクトリにあります。したがって、新しく作成したossecデータベースにインポートします。

# mysql -u ossecuser -p ossec < src/os_dbd/mysql.schema

プロンプトが表示されたら、ossecuserパスワードを入力します。

次に、データベース構成をOSSEC構成ファイルに追加します。

# nano /var/ossec/etc/ossec.conf
<database_output>
        <hostname>127.0.0.1</hostname>
        <username>ossecuser</username>
        <password>your_password</password>
        <database>ossec</database>
        <type>mysql</type>
    </database_output>

上記の行は、ブロックのどこにでも配置できます。ファイルを保存して終了します。次に、データベースを有効にして、OSSECを再起動します。

# /var/ossec/bin/ossec-control enable database

# /var/ossec/bin/ossec-control restart

OSSECWEBUIのインストール

OSSECWebUIをApacheのデフォルトのドキュメントルートにインストールします。ディレクトリを入力してください:

# cd /var/www/html/

最新のOSSECWUIをダウンロードし、アーカイブを解凍します。

# wget https://github.com/ossec/ossec-wui/archive/master.zip

# unzip master.zip

ディレクトリの名前をossecに変更します:

# mv ossec-wui-master/ ossec/

内部にtmpディレクトリを作成し、正しいファイルの所有権と権限を設定します。

# mkdir ossec/tmp/

# chown www-data: -R ossec/

# chmod 666 /var/www/html/ossec/tmp

これで、お気に入りのWebブラウザーを開き、 http:// your_server_IP / ossec / に移動して、WebUIにアクセスできます。

おめでとうございます。OSSECサーバーとそのWebユーザーインターフェイスがUbuntu14.04VPSに正常にインストールされました。詳細については、OSSECの詳細なドキュメントを確認してください。

このチュートリアルの第2部では、別のマシンへのOSSECエージェントのインストールについて説明し、標準のWebUIと比較してより優れた有益なインターフェイスを提供するAnalogiWebダッシュボードをインストールします。

もちろん、Linux VPSホスティングサービスのいずれかを使用している場合は、これを行う必要はありません。その場合は、専門のLinux管理者に依頼するだけで済みます。 24時間年中無休でご利用いただけます。リクエストはすぐに処理されます。

PS 。この投稿が気に入った場合は、左側のボタンを使用してソーシャルネットワーク上の友達と共有するか、下に返信を残してください。ありがとう。


Panels
  1. Ubuntu16.04にWebminをインストールします

  2. Ubuntu14.04にMEANをインストールします

  3. UbuntuにElasticsearchをインストールする

  1. UbuntuにGrandCMSをインストールする

  2. Ubuntu16.04にBluditをインストールします

  3. Ubuntu16.04にTomcat9をインストールします

  1. Ubuntu16.04にLaravelをインストールする

  2. Ubuntu16.04にRをインストールする方法

  3. MyBBをUbuntu16.04にインストールします