Thanks Juan,
I found out that wazuh has a problem with fail2ban's file format, which
is not 100% syslog.
I described the solution/workaround on reddit:
https://www.reddit.com/r/Wazuh/comments/1c8nfbz/comment/l0ql9al/?context=3
On the agent, I set:
<localfile>
<log\_format>syslog</log\_format>
<location>/var/log/fail2ban.log</location>
<out\_format>$(timestamp) fail2ban: $(log)</out\_format> </localfile>
Which still allows me to write into a file. I now have redundant
timestamps in the entry, but - so what...
With this decoder, I can then check for the Ban and Unban action. The
line is now close enough to a syslog entry, so I can filter with
"program_name".
<decoder name="fail2ban-wgold">
<program\_name>fail2ban</program\_name>
</decoder>
<decoder name="fail2ban-action-wgold">
<parent>fail2ban-wgold</parent>
<prematch>fail2ban.actions\\s+\\S+\\s+</prematch>
<regex type="pcre2" option="after\_prematch">
(\\S+) +\\\[(\\S+)\\\] (\\w+) (\\S+)</regex>
<order>fbseverity,cause,actiontaken,srcip</order>
</decoder>
Best
Werner
Am 22.04.24 um 13:35 schrieb 'Juan Nicolás Asselle (Nico Asselle)' via
Wazuh | Mailing List:
--
Werner Gold
Technik / zentrada.Europe
zentrada Europe GmbH & Co.KG
Delpstraße 5, D - 97084 Würzburg
E-Mail:
werne...@zentrada.com
Sitz der Gesellschaft und Amtsgericht Würzburg, HRA 5427, UID DE813805341
Komplementär: zentrada Management GmbH, Sitz und Amtsgericht Würzburg, HRB
8245
Geschäftsführer: Ingo Schloo, Martina Schimmel, Gudrun Schimmel-Wanner
European Wholesale Buyer Network
Würzburg - Paris - Harderwijk - Opole - Zalaegerszeg - Caceres - Stockholm
www.zentrada.de;
www.zentrada.fr;
www.zentrada.pl;
www.zentrada.nl;
www.zentrada.eu;
www.zentrada.hu;
www.zentrada.it;
www.zentrada.es;
www.zentrada.se