Samba – Use fail2ban for Samba

fail2bansamba

I'm looking for a way to use fail2ban to control/block samba logins on Ubuntu 12.04.3 LTS.
I already set up an jail.local. The samba part currently looks like this:

[samba]
enabled = true
port = 135,139,445,137,138
protocol = tcp,udp

I'm missing these two options:

filter =
logpath =

I know that samba log are located in /var/log/samba, but every hostname has its own file, so what do I have to set as logpath and as filter? Or is this even possible?

Thank you very much

Best Answer

The logpath option takes a wildcard as the official wiki you reference says

wildcard support in logpath option

so for example

logpath  = /var/log/apache*/*error.log 

Again from the document you say you read

filter : a filter defines a regular expression which must match a pattern corresponding to a log-in failure or any other expression

These are normally put into a .conf file in the filter.d directory.

Related Topic