2021年1月12日 星期二

roundcube webmail Brute Forcing Attack 防禦

https://mattrude.com/projects/roundcube-fail2ban-plugin/

1. 下載 roundcube-fail2ban-plugin,解壓縮放在roundcube的plugin目錄裏,
    並把目錄名稱改成fail2ban。

2. 在roundcube的設定檔config.inc.php裏掛載fail2ban plugin
$rcmail_config['plugins'] = array('fail2ban');


3. 在 /etc/fail2ban/jail.conf 加上
[roundcube]
enabled  = true
port     = http,https
filter   = roundcube
action   = iptables-multiport[name=roundcube, port="http,https"]
logpath  = /var/log/roundcubemail/userlogins

4. 新增 /etc/fail2ban/filter.d/roundcube.conf 
[Definition]
failregex = FAILED login for .*. from <HOST>
ignoreregex =

也可以不使用這個plugin去產生userlogins這個LOG檔,
直接修改fail2ban的設定去抓roundcube的log檔,
另外也要修改filter截取字串的內容。

沒有留言:

Ubuntu 的 amavis & clamav 問題

紀錄一下~ 最近把老舊的Centos換成 Ubuntu ,重裝後 發現 log 總有 clamav 沒有權限 2025-04-01T08:07:37.567746+08:00 mail amavis[24976]: (24976-01) (!)run_av (ClamAV-cla...