Hello team,
I have deployed the following architecture: 1 wazuh manager (All in one deployment v.4) and 1 wazuh agent(v.4)
I am monitoring a specific file of the agent, so i have modified the ossec.conf file of the agent as follows:
/ossec.conf
<ossec_config>
<localfile>
<log_format>syslog</log_format>
<location>/opt/dionaea/var/lib/dionaea/bistreams/dionaea_logs/dionaea.log</location>
</localfile>
There were no decoders or rules matching the logs generated so i created a decoder in the wazuh manager at /var/ossec/etc/decoders/0379-dionaea_decoder.xml
<decoder name="dionaea">
<type>syslog</type>
<program_name>dionaea</program_name>
</decoder>
<decoder name="dionaea-logs">
<parent>dionaea</parent>
<prematch offset="after_parent">^log </prematch>
<!-- offset="after_parent" makes OSSEC ignore anything matched by the parent decoder and before -->
<regex offset="after_prematch">^(\S+) (\S+) (\S+) (\S+) (\S+)</regex> <!-- offset="after_prematch" makes OSSEC ignore anything matched by the prematch and earlier-->
<order>protocol, dstip, dstport, srcip, srcport</order>
</decoder>
and i also modified the rules in the /var/ossec/rules/local_rules.xml as follows
<group name="local,syslog,sshd,json,">
<!--
Dec 10 01:02:02 host sshd[1234]: Failed none for root from 1.1.1.1 port 1066 ssh2
-->
<rule id="100001" level="5">
<if_sid>5716</if_sid>
<srcip>1.1.1.1</srcip>
<description>sshd: authentication failed from IP 1.1.1.1.</description>
<group>authentication_failed,pci_dss_10.2.4,pci_dss_10.2.5,</group>
</rule>
<rule id="100010" level="5">
<decoded_as>dionaea</decoded_as>
<description>Dionaea messages grouped.</description>
</rule>
<rule id="100011" level="10" frequency="20" timeframe="120">
<if_matched_sid>100010</if_matched_sid>
<same_source_ip />
<description>DOS attack detected!</description>
</rule>
</group>
I have tested my logs with /var/ossec/bin/ossec-logtest and everything seems to work fine. The last messages I get are:
**Phase 3: Completed filtering (rules).
Rule id: '100010'
Level: '5'
Description: 'Dionaea messages grouped.'
**Alert to be generated.
Also, when i start gathering data from the agent all the alerts appear in the alerts.log file but when i try to see them on the web app nothing appears!!! Any ideas for how to solve that problem?
Thanks allot!!!