Plaidstallion

fail2ban nextcloud

Aug 2nd, 2020 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. -----nextcloud.conf in filter.d------
  2.  
  3. [Definition]
  4. failregex = ^{"reqId":"\w{20}","level":\d,"time":"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+00:00","remoteAddr":".+\","message":"Login failed:
  5. ignoreregex =
  6.  
  7. ------nextcloud.conf in jail.d---------
  8.  
  9. [nextcloud]
  10. enabled = true
  11. chain = DOCKER-USER
  12. port = http,https
  13. filter = nextcloud
  14. logpath = /var/log/nextcloud/access.log
  15.  
  16. ----Error log sample output--------
  17.  
  18. {"reqId":"icEl09JwlHfYBLA69Wq4","level":2,"time":"2020-07-31T13:08:23+00:00","remoteAddr":"192.168.1.1","user":"--","app":"no app in context","method":"POST","url":"/login","message":"Login failed: sdf (Remote IP: 192.168.1.1)","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36","version":"19.0.1.1"}
  19.  
  20. -----Error when starting fail2ban-----------
  21.  
  22. fail2ban | 2020-08-02 18:35:53,019 fail2ban.filter [1]: ERROR No failure-id group in '^{"reqId":"\w{20}","level":\d,"time":"..<a lot more here>...
  23.  
  24. fail2ban | 2020-08-02 18:35:53,020 fail2ban [1]: ERROR NOK: ('No failure-id group in \'^{"reqId":"\\w{20}","level":\\d,"time":"\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+00:00","remoteAddr":".+\\","message":"Login failed:\'',)
  25.  
Add Comment
Please, Sign In to add comment