我有一个运行Logwatch的CentOS 5.6系统。
如果我对此主机执行安全扫描(Nessus),它会在Logwatch输出中产生不必要的噪声。我希望定期运行这些安全扫描,从内部IP和外部IP,而不产生不必要的噪音安全扫描。
既然我知道这些主机的up,我能阻止这个输出出现在Logwatch输出中吗?
--------------------- pam_unix Begin ------------------------
sshd:
Authentication Failures:
root (scan1.example.org): 1 Time(s)
unknown (scan1.example.org): 1 Time(s)
Invalid Users:
Unknown Account: 1 Time(s)
--------------------- SSHD Begin ------------------------
Failed logins from:
192.168.100.1 (scan1.example.org): 1 time
Illegal users from:
X.Y.123.123 (scan2.example.org): 1 time
**Unmatched Entries**
pam_succeed_if(sshd:auth): error retrieving information about user admin : 1 time(s)
fatal: Write failed: Connection reset by peer : 1 time(s)发布于 2011-06-15 20:27:57
Logwatch提供了*Remove共享脚本,该脚本将告诉Logwatch忽略包含特定字符串(例如grep -v)的行,然后再对它们进行处理。
/usr/share/logwatch/default.conf/services/sshd.conf复制到/etc/logwatch/conf/services/sshd.conf# Ignore these hosts
*Remove = 192.168.100.1
*Remove = X.Y.123.123
# Ignore these usernames
*Remove = testuser我不能用ignore.conf做这件事。我不能想出一个正则表达式,它允许Logwatch打印关于来自邪恶域的攻击的消息:
Failed logins from:
11.12.100.1 (EVILSCAN.example.ru): 1 time隐藏友好扫描器生成的消息时:
Failed logins from:
192.168.100.1 (friendscan.example.org): 1 time用于执行此操作的Logwatch方法文档非常贫乏,并且不能很好地搜索。
/usr/share/logwatch/scripts/shared/remove上的共享脚本将对字符串执行逆grep。/usr/share/doc/logwatch-*/HOWTO-Customize-LogWatch文档如何执行这些脚本:
您可以使用以下形式的命令:*SharedScriptName =参数,这些命令将执行在/usr/share/logwatch/ script /shared/目录中找到的名为'SharedScriptName‘的带有参数的“参数”的脚本。这个过滤器将修改服务过滤器的输入。
发布于 2011-06-09 15:30:50
可以将regexp放置为忽略/etc/logwatch/conf/ignore.conf中的日志行。
https://serverfault.com/questions/278504
复制相似问题