Skip to content

Latest commit

 

History

History
118 lines (74 loc) · 4.53 KB

agents-without-internet.rst

File metadata and controls

118 lines (74 loc) · 4.53 KB

Agents without Internet access

Even if an agent does not have Internet access, Wazuh provides different approaches to securely connect your private network to your environment:

Using a forwarding proxy

It is possible to access your environment using an NGINX forwarding proxy.

../../images/cloud-service/nginx-scheme.png

To achieve this configuration, follow these steps:

  1. Deploy a new instance in a public subnet with internet access.
  2. Install NGINX on your instance following the NGINX documentation.
  3. Configure NGINX.

    1. Add the following lines to the HTTP section in your NGINX configuration, located in the /etc/nginx/nginx.conf file. This configuration enables Nginx to extract and use the real client IP address from the X-Forwarded-For header and sets restrictions on which real IP addresses are accepted as valid.

      http{
      ...
      real_ip_header X-Forwarded-For;
      set_real_ip_from nginx_ip;
         }
    2. Add the following block to the end of the NGINX configuration file /etc/nginx/nginx.conf and replace <CLOUD_ID> with the Cloud ID of your environment. This configuration enables stream proxying, where incoming traffic on specific ports is forwarded to the corresponding upstream servers (master or mycluster). This is based on the port numbers, 1515 and 1514 specified in the listen directive.

    stream {
    upstream master {

    server <CLOUD_ID>.cloud.wazuh.com:1515;

    } upstream mycluster { server <CLOUD_ID>.cloud.wazuh.com:1514; } server { listen nginx_ip:1515; proxy_pass master; } server { listen nginx_ip:1514; proxy_pass mycluster; }

    }

    1. Run the command to restart NGINX: systemctl restart nginx.
    2. Enroll your agent with the IP address of the NGINX instance. To learn more about registering agents, see the Enroll agents <cloud_register_agents> section.

      Example:

      WAZUH_MANAGER_IP=<NGINX_IP> WAZUH_PROTOCOL="tcp" \
      WAZUH_PASSWORD="<PASSWORD>" \
      yum install wazuh-agent|WAZUH_AGENT_RPM_PKG_INSTALL|

      Replace <PASSWORD> with your Wazuh server enrollment password.

In case your agents are located in AWS, you can access our Wazuh Cloud service securely by keeping your network traffic within the AWS network. For that purpose, we use AWS Private Link.

  1. Log in to the Wazuh Cloud Console.
  2. Go to the Help section to contact the Wazuh team requesting your VPC endpoint service name. It has this format:

    com.amazonaws.vpce.<region>.vpce-svc-<aws-service-id>

  3. Select your endpoints in AWS:
    1. Navigate to your AWS Console.
    2. Select VPC.
    3. Select Endpoints.
  4. Create a new endpoint pointing to the endpoint service you requested from the Wazuh team. Keep in mind that the endpoint must be located in the same AWS Region as the endpoint service. For more information on AWS PrivateLink and VPC endpoints, see the AWS documentation.
  5. After the endpoint is created, Wazuh approves the connection and sends a notification when it is ready to use.
  6. You can now enroll your Wazuh agent but replace the WAZUH_MANAGER_IP value with the endpoint's DNS (vpce-<aws-endpoint-id>.vpce-svc-<aws-service-id>.<region>.vpce.amazonaws.com).

    If the agents are located in a different region than your endpoint, use VPC Peerings to connect them to the endpoint service.

    Example:

    WAZUH_MANAGER_IP=vpce-<aws-endpoint-id>.vpce-svc-<aws-service-id>.<region>.vpce.amazonaws.com WAZUH_PROTOCOL="tcp" \
    WAZUH_PASSWORD="<PASSWORD>>" \
    yum install wazuh-agent|WAZUH_AGENT_RPM_PKG_INSTALL|

    In this example, make sure to replace <PASSWORD> with your actual password.