I need to integrate My Mikrotik router with Ossec at http://www.ossec.net. Has anyone already done this? I want to collect all the logs that my router generates. What is the best way to do this? I have a home setup so I was thinking of logging everything to an external drive.
I have a Rd 751G-2HnD router.
RouterOS version 6.4.
In addition, is there a place where the Mikrotik loggig format is described? I saw something in the wiki where the format was date, categories and then the event. Is this a standard format? Does the router follow the bsd syslog rfc 3164?
Pranav
What I ended up doing is adding a “mikrotik” prefix to messages I send to “remote” and created a custom decoder that searches for “mikrotik:” in the message. From there I created other child decoders to interpret login (good and bad) attempts and corresponding rules.
Decoder:
<decoder name="mikrotik">
<prematch>mikrotik:</prematch>
</decoder>
<decoder name="mikrotik-successful-login">
<parent>mikrotik</parent>
<prematch>^system,info,account mikrotik: user </prematch>
<regex offset="after_prematch">^(\S+) logged in from (\S+) via (\S+)</regex>
<order>user,srcip,extra_data</order>
</decoder>
<decoder name="mikrotik-failed-login">
<parent>mikrotik</parent>
<prematch>^system,error,critical mikrotik: login failure for user </prematch>
<regex offset="after_prematch">^(\S+) from (\S+) via (\S+)</regex>
<order>user,srcip,extra_data</order>
</decoder>
Now I need to figure out ossec active response – I’m going to see if I can create a script/program to add IP addresses to an IP firewall address list to simulate something like fail2ban.