It seems that the module is working correctly. However, it's possible that these WAF logs are not generating alerts. Take into account that not every WAF log you process will generate alerts, only those that match the rules, either default or custom, will trigger an alert. Having this in mind, let's see how we can check if the module is processing data and the data is triggering alerts.
Checking if logs are being processedThe easiest way to check if the logs are being processed, regardless of the type of bucket or service configured and regardless of whether alerts are being generated or not is by using the
logall parameter. This parameter must be enabled in the ossec.conf configuration. You have to set this option to "yes" and then restart the wazuh service.
To understand how the logall parameter works it is necessary to learn about the flow that is followed when processing a log until the corresponding alert is displayed in the Wazuh UI. It is as follows:
- The module downloads the logs available in AWS for the requested date and path.
- The content of these logs is sent to the analysis engine in the form of an Event.
- The analysis engine evaluates these events and compares them with the different rules available. If the event matches any of the rules an alert is generated, which is what ultimately is shown in the Wazuh UI.
With this in mind, it is possible to make use of the logall. When this option is enabled, Wazuh stores into "
WAZUH_PATH/logs/archives/archives.log" file every event sent to the analysis engine whether they tripped a rule or not. By checking this file it is possible to determine if the AWS events are being sent to the analysis engine and therefore working properly.
Note: Don't forget to disable the logall parameter once the troubleshooting has finished. Leaving it enabled could result in high disk space consumption.
Checking if a Event triggers a ruleIf you have AWS logs available in your
WAZUH_PATH/logs/archives/archives.log this means that the module is working, so it remains to check if there are no rules that match these logs. You can use our
WAZUH_PATH/bin/wazuh-logtest tool for this. Copy one of the events in your archives.log file, run the logtest tool and paste it inside.
The events in the archives.log shall appear in the following format:
2022 Nov 28 16:36:21 wazuh-master->Wazuh-AWS {"integration": "aws", "aws": {...}}
You must ignore everything to the left of the first curly bracket ("{"). That is, you must copy {"integration": "aws", "aws": {...}} to the end of the event, including the curly bracket.
The tool will validate your event and will show if there is rules that matches these kind of events.
Let me know if this was your case.