我刚刚设置了OSSEC,但我意外地将自己从我的家庭ip中排除在外。
那么,OSSEC是否有在IP被阻塞后解除阻塞的功能,或者我是否需要在iptables中手动进行此操作?
另外,OSSEC是否提供了一种临时禁止IP的方法?
发布于 2012-03-27 21:12:39
要手动解除阻塞,需要将“添加”更改为“删除”,以便删除以前的规则:
/var/ossec/active-response/bin/host-deny.sh delete - 188.163.238.252 1328614852.61546 5712
/var/ossec/active-response/bin/firewall-drop.sh delete - 188.163.238.252 1328614852.61546 5712有时规则是严格的或不够严格的。你可能想要改变一些东西或者自己添加一些东西。这可以在local_rules.xml文件中完成。建议我们增加在apache2的http auth上失败登录的tresshold。如果我们看一下apache_rules.xml,我们就会看到一些规则。有趣的是:
<rule id="30119" level="12" frequency="6" timeframe="120">
<if_matched_sid>30118</if_matched_sid>
<same_source_ip />
<description>Multiple attempts blocked by Mod Security.</description>
<group>access_denied,</group>
</rule>要将频率从6更改为10,我们需要复制规则并将其粘贴到local_rules.xml中。然后我们添加一个参数overwrite=“是”来告诉OSSEC它需要覆盖在apache_rules.xml中定义的规则,而使用在local_rules.xml中定义的规则。规则应该是这样的:
<rule id="30119" level="12" frequency="10" timeframe="120" overwrite="yes">
<if_matched_sid>30118</if_matched_sid>
<same_source_ip />
<description>Multiple attempts blocked by Mod Security.</description>
<group>access_denied,</group>
</rule>如果我们想完全忽略这条规则,因为它与我们无关,我们只需将级别更改为0:
<rule id="30119" level="0" frequency="10" timeframe="120" overwrite="yes">
<if_matched_sid>30118</if_matched_sid>
<same_source_ip />
<description>Multiple attempts blocked by Mod Security.</description>
<group>access_denied,</group>
</rule>我的博客的摘录回答了这个问题。
https://serverfault.com/questions/356729
复制相似问题