Hello Valton,
Perform the steps below on your Wazuh server to accomplish your goal:
Step 1: Add the following decoder to the /var/ossec/ruleset/decoders/0170-nginx_decoders.xml file.
<decoder name="nginx-custom">
<parent>nginx-errorlog</parent>
<regex type="pcre2">(\S+ \S+) \[(\w+)] (.*?) .*? \[(\w+)] (.*?) Event: (.*?), Address: (.*?), User Hash: (.*?), client: (.*?), server: (.*?), request: (.*?), host: "(.*?)"</regex>
<order>logtimestamp, log_level, message_id, origin, location, event, ip_address, user_hash, client_ip, server, request, host</order>
</decoder>
Step 2: Add the following content to the /var/ossec/etc/rules/local_rules.xml file.
<group name="ddos">
<rule id="112001" level="13">
<if_sid>31301</if_sid>
<match>Challenged</match>
<description>ANTIDDOS: Challenged this Address $(ip_address)</description>
<mitre>
<id>T1110</id>
</mitre>
</rule>
</group>
Step 3: Restart your Wazuh manager using systemctl restart wazuh-manager.
Once you ingest new logs, you should be able to see the alerts generated the way you want. Find the attached image of a Wazuh logtest result for your reference.
Note: keep this thread for others to get benefited.
Regards,
On Tuesday, June 6, 2023 at 11:02:09 AM UTC+3 Valton T. wrote:
Hi?
any updates regarding this
On Monday, June 5, 2023 at 10:03:05 AM UTC+2 Valton T. wrote:
Hi abdullah.
I manager to create an different rule but using <match> but now i have this problem the $Address nor the client IP wont show in rule description and i have no Idea why .
for example i need to get the ip from
Address : 2023/06/01 10:33:56 [error] 262918#262918: *532931 [lua] main.lua:303:
Event: Challenged IP,
Address: 45.76.202.163, User Hash:
NDUuNzYuMjAyLjE2M3w0NS43Ni4yMDIuMTYzfHlvdXJfc2VjcmV0X3Bhc3NwaHJhc2VfaGVyZQ==,
client: 172.68.118.140, server:
xx.com, request: "GET /category/sporti/ HTTP/1.1", host: ""
i also did try with client_ip but stilll same
Thanks after we fix this issue maybe u can delete this thread.
thanks with respect