Network Load Balancers (Amazon NLB) Elastic Load Balancing automatically distributes the incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in one or more Availability Zones. It monitors the health of its registered targets and routes traffic only to the healthy targets. Users can select the type of load balancer that best suits their needs. A Network Load Balancer functions at the fourth layer of the Open Systems Interconnection (OSI) model. It can handle millions of requests per second. After the load balancer receives a connection request, it selects a target from the target group for the default rule. It attempts to open a TCP connection to the selected target on the port specified in the listener configuration.
Select an existing S3 Bucket or create a new one.
Go to Services > Compute > EC2:
Go to Load Balancing > Load Balancers on the left menu. Create a new load balancer or select one or more load balancers and select Edit attributes on the Actions menu:
In this tab we will define our S3 and the path where the logs will be stored:
To enable access logs for NLB (Network Load Balancers), check the following link:
Open the Wazuh configuration file (
/var/ossec/etc/ossec.conf) and add the following block for NLB:
<wodle name="aws-s3"> <disabled>no</disabled> <interval>10m</interval> <run_on_start>yes</run_on_start> <skip_on_error>yes</skip_on_error> <bucket type="nlb"> <name>wazuh-aws-wodle</name> <path>NLB</path> <aws_profile>default</aws_profile> </bucket> </wodle>
Check the AWS S3 module reference manual to learn more about each setting.
Restart Wazuh in order to apply the changes:
If you’re configuring a Wazuh manager:
# systemctl restart wazuh-manager
For SysV Init:
# service wazuh-manager restart
If you’re configuring a Wazuh agent:
# systemctl restart wazuh-agent
For SysV Init:
# service wazuh-agent restart