ossim记录

静下心来想想,感觉刚开始分析的方向就是错的,转而从ossim官方下载了手册通读了一遍,梳理了下日志处理流程。

ossec-agent->ossec-server->写日志到/var/ossec/logs/alert/alerts.log->ossim-agent读取日志->匹配规则发送给ossim-server

应该出在ossim-agent端匹配日志规则上,看了下ossec的插件/etc/ossim/agent/plugins/ossec.cfg,发现1111行

[OSSEC – Windows Security audit – Logged on/off]应该就是匹配这个规则

看了下regexp,和日志匹配是正确的,很奇怪,然后再看看日志web管理端,username和userdata1的值都能获取到,于是把

src_ip改成$user,获取username,重启agent /etc/init.d/ossim-agent restart

从新登陆系统产生一个事件,查看后居然src_ip还是0.0.0.0,费解了,难道不是匹配的这条规则?

一想干脆粗暴点,打开ossec.cfg把所有src_ip都改成$user,重启agent,我靠,终于变了,肉流满面。然后逐个修改,最后定为到匹配的规则是[OSSEC -zzz- Generic Rule]

regexp=”Alert.*\n(?P<date_header>\d+\s+\w+\s+\d+\s+\d+:\d+:\d+)\s(\((?P<agent_name>.*)\)\s)?(?P<agent_ip>.*)->.*\nRule:\s+(?P<sid>\d+).*\'(?P<msg>.*)\’\nSrc\sIP:\s(?P<sip>.*)\nUser:\s(?P<user>.*)\n(?P<data>.*)\n”src_ip={$sip}

再看看ossec的日志

** Alert 1317615907.709569: – windows,authentication_success,

2011 Oct 03 12:25:07 (10.135.15.201) 10.135.15.201->WinEvtLog

Rule: 18107 (level 3) -> ‘Windows Logon Success.’

Src IP: (none)

User: Administrator

WinEvtLog: Security: AUDIT_SUCCESS(528):

居然是none。。然是none。。是none。。none。。。。。。。。

还好[OSSEC -zzz- Generic Rule]能获取到agent_ip

修改srp_ip={resolv($agent_ip)},重启agent,终于正常了

src_ip改成$user,获取username,重启agent /etc/init.d/ossim-agent restart

从新登陆系统产生一个事件,查看后居然src_ip还是0.0.0.0,费解了,难道不是匹配的这条规则?

一想干脆粗暴点,打开ossec.cfg把所有src_ip都改成$user,重启agent,我靠,终于变了,肉流满面。然后逐个修改,最后定为到匹配的规则是[OSSEC -zzz- Generic Rule]

regexp=”Alert.*\n(?P<date_header>\d+\s+\w+\s+\d+\s+\d+:\d+:\d+)\s(\((?P<agent_name>.*)\)\s)?(?P<agent_ip>.*)->.*\nRule:\s+(?P<sid>\d+).*\'(?P<msg>.*)\’\nSrc\sIP:\s(?P<sip>.*)\nUser:\s(?P<user>.*)\n(?P<data>.*)\n”src_ip={$sip}

再看看ossec的日志

** Alert 1317615907.709569: – windows,authentication_success,

2011 Oct 03 12:25:07 (10.135.15.201) 10.135.15.201->WinEvtLog

Rule: 18107 (level 3) -> ‘Windows Logon Success.’

Src IP: (none)

User: Administrator

WinEvtLog: Security: AUDIT_SUCCESS(528):

居然是none。。然是none。。是none。。none。。。。。。。。

还好[OSSEC -zzz- Generic Rule]能获取到agent_ip

修改srp_ip={resolv($agent_ip)},重启agent,终于正常了


已发布

分类

,

来自

标签:

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据