使用fail2ban在特定时间段内手动阻止IP

Tre*_*ree 6 security iptables fail2ban centos7

我注意到蛮力密码破解程序变得越来越复杂,了解他们的 IP 被禁止的速度,并减缓他们的入侵尝试,以免被 fail2ban 捕获。我想要一种能够手动将 IP 添加到 Fail2Ban 中的禁止列表的方法,这些 IP 将在特定时间段内(但可能比通常时间长)解除禁止。是否有手动命令行方式来告诉fail2ban 阻止某个IP/范围,然后在一段时间后取消禁用它?这是在 CentOS7 下

HTF*_*HTF 14

有一个fail2ban客户端:

# fail2ban-client set <JAIL> banip <IP>
# fail2ban-client set <JAIL> unbanip <IP>
Run Code Online (Sandbox Code Playgroud)

例子:

# fail2ban-client set example banip 10.10.1.1
10.10.1.1

# fail2ban-client status example
Status for the jail: example
|- Filter
|  |- Currently failed: 0
|  |- Total failed: 10
|  `- File list:    /var/log/example.log
`- Actions
   |- Currently banned: 1
   |- Total banned: 2
   `- Banned IP list:   10.10.1.1

# fail2ban-client set example unbanip 10.10.1.1
10.10.1.1

# fail2ban-client status example
Status for the jail: example
|- Filter
|  |- Currently failed: 0
|  |- Total failed: 10
|  `- File list:    /var/log/example.log
`- Actions
   |- Currently banned: 0
   |- Total banned: 2
   `- Banned IP list:
Run Code Online (Sandbox Code Playgroud)