小编Eth*_*lle的帖子

如何让 sec 正确忽略时间戳

我有一个这样设置的规则;

在 /etc/sec/rules.d 我有;

type=SingleWithSuppress
ptype=regexp
pattern=(\S+) sshd\[\d+\]: PAM \d+ more authentication failures\; logname=.* uid=.* euid=.* tty=ssh ruser=.* rhost=(.*) user=(.*)
desc=Login Failure: $0
action=pipe '%s ' /bin/mail -s "login failure $2 to $3@$1" team@team.com
window=300
Run Code Online (Sandbox Code Playgroud)

因此,如果这是通过系统日志实现的;

Nov 21 11:24:10 servername.server.com sshd[26846]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost= user=kloggins
Run Code Online (Sandbox Code Playgroud)

它应该根据模式匹配这个(它根据我的正则表达式编辑器匹配);

servername.server.com sshd[26846]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost= user=kloggins
Run Code Online (Sandbox Code Playgroud)

我们遇到了垃圾邮件问题,因为时间戳正在发生变化。所以我重写了模式以匹配主机名之后的所有内容。

但是,这似乎不起作用,每次用户“身份验证失败”时,我仍然会收到一封电子邮件。

我一直在使用以下内容进行测试;

logger -p syslog.err 'sshd[26846]: PAM 2 more authentication failures; …
Run Code Online (Sandbox Code Playgroud)

linux logging regex syslog

13
推荐指数
1
解决办法
313
查看次数

在 Nagios 问题上将 80 转发到 443

我可能只需要一些额外的洞察力,因为我不知道我哪里出错了。我使用 SSL 证书来保护我们的 nagios 服务器。我们希望特别要求所有通过 nagios 的流量(如 2 个用户,哈哈)使用 SSL。

所以我想,哦,.htaccess 中的 mod_rewrite + 重写规则,对吗?

所以我进入 DocumentRoot 并做了一个 vi .htaccess(一个不存在),然后我输入了以下规则;

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://our.server.org/$1 [R,L]
Run Code Online (Sandbox Code Playgroud)

这绝对没有任何作用。纳达。

为什么..

注意: httpd.conf 中的 AllowOverride all 已开启。另外,我验证了该模块没有取消注释......但请注意,我找不到安装的 mod_rewrite 模块,所以我从另一台服务器复制了它并将它放在 modules/mod_rewrite.so 中。这很奇怪,因为它在 httpd.conf 文件中启用,但在模块中不存在......

我是坏人:(

mod-rewrite ssl nagios .htaccess centos6

4
推荐指数
1
解决办法
2538
查看次数

标签 统计

.htaccess ×1

centos6 ×1

linux ×1

logging ×1

mod-rewrite ×1

nagios ×1

regex ×1

ssl ×1

syslog ×1