GNU/Linux >> LINUX-Kenntnisse >  >> Panels >> Panels

Installieren Sie OSSEC auf Ubuntu 14.04

Dieser Artikel ist der erste Teil des vollständigen Tutorials zum Installieren von OSSEC-Server/-Agent auf einem Ubuntu 14.04 VPS . Dieser Teil behandelt die Installation von OSSEC 2.8.3 (die neueste stabile Version, als dieses Tutorial geschrieben wurde), die Installation der Web-Benutzeroberfläche und zeigt, wie die MySQL-Unterstützung für OSSEC aktiviert wird.

OSSEC ist ein Host-basiertes Open Source Intrusion Detection System. Es vereint alle Aspekte von HIDS (hostbasierte Intrusion Detection) und Security Incident Management (SIM)/Security Information and Event Management (SIEM) in einer einfachen, leistungsstarken Open-Source-Lösung.

Die Hauptvorteile von OSSEC sind:

  • Compliance-Anforderungen
  • Multi-Plattform
  • Echtzeit- und konfigurierbare Warnungen
  • Integration in aktuelle Infrastruktur
  • Zentralisierte Verwaltung
  • Agent- und agentenlose Überwachung

OSSEC führt Protokollanalysen, Dateiintegritätsprüfungen, Richtlinienüberwachung, Rootkit-Erkennung, Echtzeit-Warnungen und aktive Reaktionen durch. Um die von OSSEC unterstützten Betriebssysteme und Protokollformate zu überprüfen, besuchen Sie bitte deren Seite.

ANFORDERUNGEN

Für dieses Tutorial verwenden wir unseren SSD 1 Linux VPS-Hostingplan.

Melden Sie sich über SSH bei Ihrem Server an:

# ssh root@server_ip

Geben Sie vor dem Start den folgenden Befehl ein, um zu überprüfen, ob Sie die richtige Version von Ubuntu auf Ihrem Computer installiert haben:

# lsb_release -a

Es sollte Ihnen die folgende Ausgabe geben:

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

SYSTEM AKTUALISIEREN

Stellen Sie sicher, dass Ihr Server auf dem neuesten Stand ist:

# apt-get update && apt-get upgrade

Installieren Sie nun Apache, MySQL, PHP und einige benötigte Module mit dem folgenden Befehl:

# 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 INSTALLIEREN

Geben Sie /opt ein Verzeichnis:

# cd /opt

OSSEC herunterladen:

# wget https://bintray.com/artifact/download/ossec/ossec-hids/ossec-hids-2.8.3.tar.gz

Entpacken Sie das Archiv und geben Sie das entpackte Verzeichnis ein:

# tar -xzf ossec-hids-2.8.3.tar.gz

# cd ossec-hids-2.8.3

Aktivieren Sie die MySQL-Datenbankunterstützung:

# cd src

# make setdb

Gehen Sie zurück zum vorherigen Verzeichnis:

# cd ../

Starten Sie nun das OSSEC-Installationsskript und folgen Sie den einfachen Anweisungen:

# ./install.sh

Darunter befindet sich die Ausgabe des gesamten Installationsvorgangs und der Funktionen, die wir aktiviert haben. Natürlich wählen Sie, welche Optionen Sie aktivieren/deaktivieren möchten, aber wir empfehlen Ihnen, der folgenden Ausgabe zu folgen. Sie können die Eingabetaste drücken, wenn Sie für jede gestellte Frage mit der Standardauswahl (die in Klammern steht) fortfahren möchten.

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

Drücken Sie die Eingabetaste.

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

Drücken Sie nun die Eingabetaste, um mit der Installation fortzufahren, die nicht länger als 2 Minuten dauern sollte. Nachdem alles abgeschlossen ist, erhalten Sie:

- 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 starten:

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

Der nächste Schritt besteht darin, einen MySQL-Benutzer und eine Datenbank für OSSEC zu erstellen. Geben Sie MySQL als root ein:

# 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 stellt ein Schema für die Datenbank bereit und befindet sich im Verzeichnis src/os_dbd/. Importieren Sie es daher in Ihre neu erstellte Ossec-Datenbank:

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

Geben Sie das Ossecuser-Passwort ein, wenn Sie dazu aufgefordert werden.

Fügen Sie nun die Datenbankkonfiguration zur OSSEC-Konfigurationsdatei hinzu:

# 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>

Sie können die obigen Zeilen an beliebiger Stelle im -Block einfügen. Speichern und beenden Sie die Datei. Aktivieren Sie dann die Datenbank und starten Sie OSSEC neu:

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

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

INSTALLIEREN SIE DIE OSSEC-WEB-BENUTZERSCHNITTSTELLE

Installieren Sie die OSSEC-Web-Benutzeroberfläche im standardmäßigen Dokumentenstammverzeichnis von Apache. Geben Sie das Verzeichnis ein:

# cd /var/www/html/

Laden Sie die neuste OSSEC WUI herunter und entpacken Sie das Archiv:

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

# unzip master.zip

Benennen Sie das Verzeichnis in ossec:

um
# mv ossec-wui-master/ ossec/

Erstellen Sie darin ein tmp-Verzeichnis und legen Sie den richtigen Dateibesitz und die richtigen Berechtigungen fest:

# mkdir ossec/tmp/

# chown www-data: -R ossec/

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

Sie können jetzt auf die Webbenutzeroberfläche zugreifen, indem Sie Ihren bevorzugten Webbrowser öffnen und zu http://your_server_IP/ossec/ navigieren

Herzlichen Glückwunsch, Sie haben den OSSEC-Server und seine Web-Benutzeroberfläche erfolgreich auf einem Ubuntu 14.04 VPS installiert. Weitere Informationen finden Sie in der ausführlichen OSSEC-Dokumentation.

Im zweiten Teil dieses Tutorials werden wir die Installation des OSSEC-Agenten auf einem anderen Computer behandeln und das Analogi-Web-Dashboard installieren, das im Vergleich zur Standard-Web-Benutzeroberfläche eine bessere und informativere Oberfläche bietet.

Natürlich müssen Sie nichts davon tun, wenn Sie einen unserer Linux-VPS-Hosting-Dienste nutzen. In diesem Fall können Sie einfach unsere erfahrenen Linux-Administratoren bitten, dies für Sie zu tun. Sie sind 24×7 erreichbar und kümmern sich umgehend um Ihr Anliegen.

PS . Wenn Ihnen dieser Beitrag gefallen hat, teilen Sie ihn bitte mit Ihren Freunden in den sozialen Netzwerken über die Schaltflächen auf der linken Seite oder hinterlassen Sie einfach unten eine Antwort. Danke.


Panels
  1. Installieren Sie phpMyAdmin auf Ubuntu 16.04

  2. Installieren Sie PHP 7 auf Ubuntu 14.04

  3. Installieren Sie Radiant unter Ubuntu 14.04

  4. Installieren Sie den OSSEC-Agenten auf Ubuntu 14.04

  5. Installieren Sie Laravel auf Ubuntu 16.04

So installieren Sie OSSEC unter Ubuntu 14.04

Installieren Sie RethinkDB auf Ubuntu

Installieren Sie Elasticsearch auf Ubuntu

Installieren Sie GrandCMS auf Ubuntu

Installieren Sie Bludit auf Ubuntu 16.04

Installieren Sie Tomcat 9 auf Ubuntu 16.04