Hi,
many thanks for your message. First, you would need to configure ownCloud to log failed login attempts.
For fail2ban, you would need to specify following 2 files
nano /etc/fail2ban/filter.d/owncloud.conf
[Definition]
failregex={.*Login failed: \'.*\' \(Remote IP: \'<HOST>\'\)"}
ignoreregex =
and
nano /etc/fail2ban/jail.d/owncloud.conf
[owncloud]
enabled = true
port = 80,443
protocol = tcp
backend = auto
filter = owncloud
maxretry = 3
bantime = 10800
logpath = /mnt/dietpi_userdata/owncloud_data/owncloud.log
once done restart fail2ban
systemctl restart fail2ban.service
Now you should see something like this
root@DietPi3:~# fail2ban-client status owncloud
Status for the jail: owncloud
|- Filter
| |- Currently failed: 1
| |- Total failed: 1
| `- File list: /mnt/dietpi_userdata/owncloud_data/owncloud.log
`- Actions
|- Currently banned: 0
|- Total banned: 0
`- Banned IP list:
root@DietPi3:~#