對於自適應 iptables 守護程式來說,什麼是好的解決方案?

對於自適應 iptables 守護程式來說,什麼是好的解決方案?

我正在運行一系列網路伺服器,並且已經設定了一套相當好的防火牆規則,但是我正在尋找一些東西來監視流量並根據需要添加規則。我有 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

然後,學習如何使用-j SET目標;優選地與-m recent -m limit和/或組合-m hashlimit

祝你好運,年輕的絕地武士! :-)

(既然你使用的是Ubuntu,你必須從源安裝 ipset;請參閱我的部落格以了解 HOWTO:http://pepoluan.posterous.com/powertip-howto-install-ipset-on-ubuntu

答案3

答案4

這有點矯枉過正,但有一個名為 OSSEC 的偉大項目,它可以監視伺服器日誌,如果它看到一些可疑的東西(它有規則列表,而且你可以編寫自己的規則),它可以阻止遠端 IP。

你不能稱它為 iptables 守護進程,但它比 denyhost 更強大。

相關內容