大网数据广告活动
服务器运维问答

Disable OSSEC email for SSH maximum authentication attempts

· 52CE 我爱测

I try to disable the email notifications for the OSSEC rule 5758. <rule id="5758" level="8"> <decoded_as>sshd</decoded_as> <match>^error: maximum authentication attempts exceeded </match> <description>Maximum authentication attem…

问题原文

原帖链接 · Dave · CC BY-SA 3.0

I try to disable the email notifications for the OSSEC rule 5758.

<rule id="5758" level="8">
<decoded_as>sshd</decoded_as>
<match>^error: maximum authentication attempts exceeded </match>
<description>Maximum authentication attempts exceeded.</description>
<group>authentication_failed,</group>
</rule>

In /var/ossec/rules/local_rules.xml I added this custom rule:

<rule id="100002" level="8">
<if_sid>5758</if_sid>
<description>No mail for max auth SSH</description>
<options>no_email_alert</options>
</rule>

But this rule has no effect.

已采纳解答

原帖链接 · Tux_DEV_NULL · CC BY-SA 3.0

You need <rule id="5758" level="0">

Level 0 means ignored/no action taken. It will still scan the file. I have this in my /var/ossec/rules/sshd_rules.xml. Just change the level to zero. If you want to keep the local changes in a different file then you can this in the local_rules.xml file which is probably a better way to manage this. Basically keep the original rule in sshd_rules.xml then overwrite it via local rules.

the main rule in /sshd_rules.xml:

 <rule id="5758" level="8">
    <decoded_as>sshd</decoded_as>
    <match>^error: maximum authentication attempts exceeded </match>
    <description>Maximum authentication attempts exceeded.</description>
    <group>authentication_failed,</group>
  </rule>

and then in local_rules:

   <rule id="100002" level="0">
<if_sid>5758</if_sid>
<description>No mail for max auth SSH</description>
<options>no_email_alert</options>
</rule>

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-04-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。