自适应 iptables 守护进程的良好解决方案是什么?

自适应 iptables 守护进程的良好解决方案是什么?

我正在运行一系列 Web 服务器,并且已经设置了一套相当不错的防火墙规则,但是我正在寻找可以监控流量并根据需要添加规则的东西。我使用 Denyhosts 来监控不良 SSH 登录,这很棒 - 但我希望可以应用到整个机器上的东西,这将有助于防止针对我的 Web 应用程序的强制攻击,并添加规则来阻止显示常见攻击证据的 IP。

我见过 APF,但它似乎已经好几年没有更新了。它还在使用吗?它对此有用吗?此外,还有哪些其他解决方案可以操纵 iptables 以某种自适应方式运行?

我正在运行 Ubuntu Linux,如果有帮助的话。

答案1

我是 fail2ban 的忠实粉丝

http://www.fail2ban.org/wiki/index.php/Main_Page

以下是 Fail2ban 中主要功能的列表。

Client/Server architecture.
Multi-threaded.
Highly configurable.
FAM/Gamin support.
Parses log files and looks for given patterns.
Executes commands when a pattern has been detected for the same IP address for more than X times. X can be changed.
After a given amount of time, executes another command in order to unban the IP address.
Uses Netfilter/Iptables by default but can also use TCP Wrapper (/etc/hosts.deny) and many other actions.
Handles log files rotation.
Can handle more than one service (sshd, apache, vsftpd, etc).
Resolves DNS hostname to IP address. 

答案2

学习关于ipset,来自 的制造商iptables

然后,学习如何使用目标;最好与and/or-j SET结合使用。-m recent -m limit-m hashlimit

祝你好运,年轻的绝地武士!:-)

(由于你使用的是 Ubuntu,因此必须从源代码安装 ipset;请参阅我的博客以了解操作方法:http://pepoluan.posterous.com/powertip-howto-install-ipset-on-ubuntu

答案3

答案4

这有点小题大做,但是有一个很棒的项目叫做 OSSEC,它可以监控服务器日志,如果发现有什么可疑的东西(它有规则列表,你也可以编写自己的规则),它可以阻止远程 IP。

你不能称它为 iptables 守护进程,但它比 deniedhost 强大得多。

相关内容