首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Fail2Ban取消10分钟后。没有警告吗?

Fail2Ban取消10分钟后。没有警告吗?
EN

Stack Overflow用户
提问于 2015-10-28 00:32:01
回答 1查看 866关注 0票数 0

fail2ban过滤器有一点问题,因为某些原因,它在10分钟后就取消了,尽管我将禁令的长度设置为一年。你能帮一个哥哥出去吗?

过滤器的jail.local声明:

代码语言:javascript
复制
[nginx-proxy]
enabled  = true
#port    = http,https
action   = iptables-multiport[name=NoProxy, port="http,https"]
filter   = nginx-proxy
logpath  = /etc/nginx/logs/*access*.log
bantime  = 31536000 # 1 year
maxretry = 0

[nginx-shellshock]
enabled  = true
#port    = http,https
action   = iptables-multiport[name=ShellShock, port="http,https"]
filter   = nginx-shellshock
logpath  = /etc/nginx/logs/*access*.log
bantime  = 31536000 # 1 year
maxretry = 0

nginx-proxy.conf

代码语言:javascript
复制
[Definition]
failregex = ^<HOST> .* "GET http.*
ignoreregex =

nginx-shellshock.conf

代码语言:javascript
复制
[Definition]
failregex = ^<HOST>.*\(\s*\)\s*\{[^"]*\}\s*\;[^"]+.*

ignoreregex =

这是我的fail2ban.log文件

代码语言:javascript
复制
2015-10-27 06:21:48,953 fail2ban.jail           [8319]: INFO    Jail 'nginx-auth' started
2015-10-27 06:21:48,981 fail2ban.jail           [8319]: INFO    Jail 'nginx-badbots' started
2015-10-27 06:21:49,022 fail2ban.jail           [8319]: INFO    Jail 'nginx-proxy' started
2015-10-27 06:21:49,062 fail2ban.jail           [8319]: INFO    Jail 'nginx-shellshock' started
2015-10-27 13:17:40,737 fail2ban.filter         [8319]: INFO    [nginx-shellshock] Found 108.171.178.73
2015-10-27 13:17:41,667 fail2ban.actions        [8319]: NOTICE  [nginx-shellshock] Ban 108.171.178.73
2015-10-27 13:17:41,747 fail2ban.filter         [8319]: INFO    [nginx-shellshock] Found 108.171.178.73
2015-10-27 13:17:41,747 fail2ban.filter         [8319]: INFO    [nginx-shellshock] Found 108.171.178.73
2015-10-27 13:17:41,880 fail2ban.actions        [8319]: NOTICE  [nginx-shellshock] 108.171.178.73 already banned
2015-10-27 13:27:42,572 fail2ban.actions        [8319]: NOTICE  [nginx-shellshock] Unban 108.171.178.73

在fail2ban服务重新启动时,我还会看到一个错误,即set休克班时设置为none:

代码语言:javascript
复制
2015-10-28 00:29:31,351 fail2ban.transmitter    [11600]: WARNING Command ['set', 'nginx-shellshock', 'bantime', 'None'] has failed. Received ValueError("invalid literal for int() with base 10: 'None'",)

非常感谢您的帮助,谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-28 09:59:50

整个问题在我周围使用了注释标签,显然在fail2ban配置中注释了整行。要么将哈希标记更改为分号,要么将其放在另一行。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33380915

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档