从ossec(服务器代理)模型生成警报

我对OSSEC很陌生。 我使用服务器代理模型。 我希望为以下操作生成警报(在代理端):

1)日志消除的样本警报

我使用<localfile>标签在代理的ossec.conf添加了这些规则。 喜欢这个 :

  <localfile> <log_format>syslog</log_format> <location>/var/log/syslog</location> </localfile> 

在我的服务器的ossec.conf。 我添加了以下内容:

 <global> <email_notification>yes</email_notification> <email_to>xxxx@xxxxxx</email_to> <smtp_server>smtp.gmail.com</smtp_server> <email_from>xxxx@xxx</email_from> </global> 

我重新启动了我的服务器。 现在我试图使用rm syslog删除代理syslog文件。 但是没有警报被触发。

我犯了什么错误?

localfilesyscheck不同。

打开/var/ossec/rules/syslog_rules.xml ,你会看到一个不好的单词列表:

<var name="BAD_WORDS">core_dumped|failure|error|attack|bad |illegal |denied|refused|unauthorized|fatal|failed|Segmentation Fault|Corrupted|unresolved|Down</var>

使用logger命令在系统日志中创build一个条目:

 $ logger connection failed 

你可以在/var/log/syslog看到这个消息:

 Aug 28 17:12:41 ubuntu quanta: connection failed 

并收到一封电子邮件,内容如下:

 OSSEC HIDS Notification. 2012 Aug 28 17:12:32 Received From: (Nagios_Slave_6.142) 192.168.6.142->/var/log/messages Rule: 1002 fired (level 2) -> "Unknown problem somewhere in the system." Portion of the log(s): Aug 28 17:12:21 ubuntu quanta: connection failed --END OF NOTIFICATION