你好,新年快乐,
我想知道是否可以在使用bridge-util的虚拟主机上使用fail2ban。 我正在使用LXC容器进行虚拟化,因此可以直接访问主机环境中的所有日志文件。 如果我可以在主机上安装fail2ban并且立即保护所有的虚拟机,那将是非常好的。
我只是不确定fail2ban在bridge-util方面有多好,或者有什么需要考虑的方法。
谢谢,让更好的一年的希望(2012年)
新年快乐 :)
fail2ban可以使用自定义命令。 你需要:
cd /etc/fail2ban
cp jail.conf jail.local
在jail.local中:
[ssh-host1] enabled = true port=ssh filter=sshd logpath=/path/to/host1/logs/auth.log maxretry=6 banaction=bridge-utils
创buildaction.d / bridge-utils.local:
[Definition] # executed once at the start of fail2ban actionstart = brctl ... # executed once at the end of fail2ban actionstop = brctl ... # executed once before each actionban command actioncheck = ... # ban action actionban = brctl ... brctl ... # unban action actionunban = brctl ... brctl ... [Init] # some default variables here
重新启动fail2ban并testing它是否正常工作。