GNU/Linux >> Tutoriales Linux >  >> Panels >> Panels

Instale el agente OSSEC en Ubuntu 14.04

Este artículo es la segunda parte de nuestra Instalación de OSSEC en Ubuntu 14.04 tutorial.

En la primera parte, instalamos OSSEC como servidor y su interfaz de usuario web en un Ubuntu 14.04 VPS.

Hoy instalaremos Analogi Web Dashboard y cubriremos la instalación del agente OSSEC en otro Ubuntu 14.04 VPS. Luego agregaremos el agente instalado (cliente) al servidor OSSEC.

Entonces, comencemos.

Inicie sesión en el VPS de Linux donde instaló OSSEC como servidor:

# ssh root@server_ip

Actualice el índice de paquetes y verifique si tiene actualizaciones disponibles para el servidor:

# apt-get update && apt-get upgrade

Una vez que esté fuera de la imagen, instalemos el panel web de Analogi. Ingrese la raíz del documento predeterminado para Apache que es '/var/www/html':

# cd /var/www/html/

Clonar el repositorio GIT de Analogi:

# git clone https://github.com/ECSC/analogi.git

Copie el archivo de configuración de la base de datos y modifique la configuración de la base de datos con los valores de la base de datos creada en la primera parte de este tutorial:

# cp analogi/db_ossec.php.new analogi/db_ossec.php

# nano analogi/db_ossec.php

Una vez que modifique los valores, deberían verse así:

define ('DB_USER_O', 'ossecuser');
define ('DB_PASSWORD_O', 'your_password');
define ('DB_HOST_O', '127.0.0.1');
define ('DB_NAME_O', 'ossec');

Guarde y cierre el archivo.

Ahora puede visitar el panel de control de Analogi desde su navegador web favorito. Abra http://your_IP_address/analogi

INSTALACIÓN DEL AGENTE OSSEC

A continuación, debe instalar OSSEC como agente en su otra instancia de Ubuntu. Pero primero, instale los módulos como se muestra en la primera parte de este tutorial. Si ya tiene la pila LAMP instalada en su instancia de Ubuntu 14.04, continúe y ejecute el siguiente comando:

# 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

Descargue OSSEC en el directorio ‘/opt’, descomprima el archivo e ingrese al directorio desempaquetado:

# 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

Ahora, inicie el script de instalación de OSSEC y siga las sencillas instrucciones que se muestran a continuación:

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

Como muestra la declaración anterior, ahora debe agregar el agente al servidor OSSEC. Vuelva a la consola de su servidor OSSEC y genere una clave para el agente. Utilice el siguiente comando:

# /var/ossec/bin/manage_agents

Ahora elija la opción A, ingrese el nombre del nuevo agente, su dirección IP e ID. Siga la salida debajo:

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

Ejecute /var/ossec/bin/manage_agents Comando nuevamente y extraiga la clave para el agente:

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

Copie la clave y cambie a la consola de su agente OSSEC. Ejecute el comando /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.

Puede consultar el archivo de configuración OSSEC para ver si el servidor OSSEC se ha agregado correctamente:

# nano /var/ossec/etc/ossec.conf

La dirección IP del servidor OSSEC se agrega al principio del archivo:

<client>
  <server-hostname>xxx.xxx.xx.xxx</server-hostname>
</client>

Una vez hecho esto, reinicie OSSEC en las máquinas servidor y agente:

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

Ahora puede monitorear al agente desde la interfaz de usuario web estándar o el panel de control de Analogi . Es tu decision. Por supuesto, OSSEC es un sistema complejo de detección de intrusos y puede modificar su configuración y agentes, así que para obtener más información, consulte la documentación completa de OSSEC.

Felicidades. Ha configurado e integrado con éxito un agente OSSEC con el servidor OSSEC. Debe seguir este mismo procedimiento si desea agregar otro agente a OSSEC.

Por supuesto, no tiene que hacer nada de esto si utiliza uno de nuestros servicios de alojamiento VPS de Linux, en cuyo caso simplemente puede pedirle a nuestros administradores expertos de Linux que lo hagan por usted. Están disponibles las 24 horas del día, los 7 días de la semana y atenderán su solicitud de inmediato.

PD . Si te gustó esta publicación, compártela con tus amigos en las redes sociales usando los botones de la izquierda o simplemente deja una respuesta a continuación. Gracias.


Panels
  1. Instalar Webmin en Ubuntu 16.04

  2. Instale MEAN en un Ubuntu 14.04

  3. Instalar Elasticsearch en Ubuntu

  4. Instalar GrandCMS en Ubuntu

  5. Instalar Bludit en Ubuntu 16.04

Instale el agente Zabbix en Ubuntu 20.04

Cómo instalar OSSEC en Ubuntu 14.04

Instalar OSSEC en Ubuntu 14.04

Instalar RethinkDB en Ubuntu

Instalar XWiki en Ubuntu 16.04

Instalar npm en Ubuntu 16.04