En esta entrada un pequeño tutorial para dar de alta los clientes en el servidor de OSSEC, tanto estando instalado en OSSIM o en un servidor aislado.


  • Dar de alta el nuevo cliente en el servidor


    (server)# /var/ossec/bin/manage_agents
    
    ****************************************
    * OSSEC HIDS v0.8 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 actions: A,E,R or Q: a
    
    - Adding a new agent (use ‘q’ to return to main menu).
      Please provide the following:
        * A name for the new agent: linux1
        * The IP Address for the new agent: 192.168.2.32
    
        * An ID for the new agent[001]:
    Agent information:
        ID:001
        Name:linux1
        IP Address:192.168.2.32
    
    Confirm adding it?(y/n): y
    Added.


  • Extraer la key para el nuevo agente


    (server)# /var/ossec/bin/manage_agents
    
    ****************************************
    * OSSEC HIDS v0.8 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 actions: A,E,R or Q: e
    
    Available agents:
        ID: 001, Name: linux1, IP: 192.168.2.32
        ID: 002, Name: obsd1, IP: 192.168.2.10
    Provide the ID of the agent you want to extract the key: 001
    
    Agent key information for ‘001′ is:
    CDAxIGxpbnX4MSAxOTIuMTY4LjAuMzIgOWM5MENlYzNXXXYYYZZZZZ==
    
    ** Press ENTER to continue


  • Instalar el agente en la máquina a monitorizar


    Existen versiones del agente de ossec tanto para Windows como para Linux. Descargamos el agente correspondiente en la máquina a monitorizar en la página de descargas de OSSEC y lo instalamos.


  • Introducir la key generada en el paso 1 en el agente instalado


    Según el SO los pasos son:

    1. En máquinas Linux:


      Arrancar el mismo script de configuración y seguir los siguientes pasos:

      (agent)# /var/ossec/bin/manage_agents
      ****************************************
      * OSSEC HIDS v0.8 Agent manager.       *
      * The following options are available: *
      ****************************************
         (I)mport key for the server (I).
         (Q)uit.
         Choose your actions: I or Q: i
      
      * Provide the Key generated from the server.
      * The best approach is to cut and paste it.
      *** OBS: Do not include spaces or new lines.
      
      Paste it here: CDAxIGxpbnX4MSAxOTIuMTY4LjAuMzIgOWM5MENlYzNXXXYYYZZZZZ==
      
      Agent information:
          ID:001
          Name:linux1
          IP Address:192.168.2.32
      
      Confirm adding it?(y/n): y
      Added.
      ** Press ENTER to continue.
      
      ****************************************
      * OSSEC HIDS v0.8 Agent manager.       *
      * The following options are available: *
      ****************************************
          (I)mport key for the server (I).
          (Q)uit.
      Choose your actions: I or Q: q
      
      manage_agents: Exiting ..
      


    2. En máquinas Windows:


      Una vez instalado el agente abrimos el administrador del mismo en Inicio -> ossec -> manage agent:


      OSSEC Agent Manager


      Copiamos la key generada en el Server y la pegamos en la casilla de “Authentication key”, guardamos los cambios con “Save”, clic en “Refresh” y reiniciamos el agente en Manage->Restart.