linux - Fail2Ban 在 10 分钟后解禁。 bantime 没有警告?

标签 linux nginx fail2ban

fail2ban 过滤器有点问题,出于某种原因它会在 10 分钟后解除禁令,即使我将禁令期限设置为一年。能帮个小弟吗?

过滤器的 jail.local 声明:

[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

[Definition]
failregex = ^<HOST> .* "GET http.*
ignoreregex =

nginx-shellshock.conf

[Definition]
failregex = ^<HOST>.*\(\s*\)\s*\{[^"]*\}\s*\;[^"]+.*

ignoreregex =

这是我的 fail2ban.log 文件

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 服务重新启动时,我还收到有关将 shellshock bantime 设置为 none 的错误:

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'",)

非常感谢任何帮助,谢谢。

最佳答案

整个问题都围绕着我使用评论标签,这显然在 fail2ban 配置中评论了整行。将散列标记更改为分号或将其放在另一行。

关于linux - Fail2Ban 在 10 分钟后解禁。 bantime 没有警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33380915/

相关文章:

c++ - 在 Linux 下从 C++ 中的串行接口(interface)读取字节的问题

php - PHP 处理大文件上传的理想 Web 服务器是什么?

django - 使用 Django 为静态文件自定义 HTTP header

自定义 node.js 应用程序的 fail2ban 自定义过滤器

Fail2ban 不发送电子邮件通知

linux - 如何将 MCP23017 与 MCP3008 一起用于 Raspberry Pi 的 I2C 电压传感器?

c++ - 如何检查给定进程在运行时加载了哪些共享库?

linux - 为 tcpdump 编写一个 linux 脚本以停止并再次运行,但将信息保存在另一个文件中

nginx - 增加 proxy_send_timeout 和 proxy_read_timeout ingress nginx

docker - 如何使用 Traefik 实现 fail2ban