No alerts for http status code 200 #28637
-
This is a very similar question to #15910 My goal to to create an alert, when a user accesses a special URL.
To test my configuration, I created a custom decoder for my nginx-proxy-manager:
I also added some rules for testing:
A logtest for the given logentry gives my the following output:
So in theory I am happy with the result. But in the threathunting events I can only see http_status_code 400 events, although from the logtest there should be matches for rule 100203: I cannot explain this to myself. So maybe someone can help me with that, as I think adding a filter for the URL, I want to alert on, is the easier part. Thank you for helping me, as I am new to wazuh :-) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Hello meimi039, Let me understand your problem. Are you wondering why you don't receive alerts other than the one with ID 100200 and code 400? Having tested your custom rules with "wazuh-logtest" tool successfully. Now you can check if the expected log events are reaching the Wazuh manager in the working environment. To check all data that is collected by the manager you can set the parameter "logall" and "logall_json" to "yes" on the configuration file "ossec.conf" on the wazuh-manager. After setting these parameters, please restart the wazuh-manager. With these parameters set to "yes", the manager will start to log all events received from agents even if they don't trip a rule. At this point, you can verify if the manager is receiving the expected event logs. If not, there is another issue that is not related to the custom decoders or rules you have created. Regards |
Beta Was this translation helpful? Give feedback.
-
Hi meimi039, To get the event log information is convenient to use the events found in the "archives.json" file instead of the "archives.log". The log you are looking for will be inside a JSON object in the file "archives.json" in key "full_log":
This is because sometimes there are differences between the message of "archives.json" and "archives.log". Once you have the event log from the "archives.json" file, we have to test it again in the wazuh-logtest tool. Regards |
Beta Was this translation helpful? Give feedback.
-
Hi again, The alert information in the record of the file "archives.json" that you have for the rule id 100203 does not mean that the alert was correctly indexed. One possibility is that there exists indexing issues for these alerts (for example: one invalid field n 8000 ame, etc). First, we can check if these alerts are being indexed. Please share your results. |
Beta Was this translation helpful? Give feedback.
-
Hi, I could reproduce the problem on my local machine with the information you sent me previously. There are issues indexing these event logs. The problem is the field named "timestamp" in your custom decoder. A workaround for this situation could be:
|
Beta Was this translation helpful? Give feedback.
Hi,
I could reproduce the problem on my local machine with the information you sent me previously.
There are issues indexing these event logs. The problem is the field named "timestamp" in your custom decoder.
The format of this field is not the expected, the format used is ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). In future Wazuh version 5.x the timestamp fields format will be configurable.
A workaround for this situation could be: