Skip to content

是否考虑增加限制ip地址请求频率的功能?类似于fail2ban,用于防御暴力破解。 #252

@x1ntt

Description

@x1ntt

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
我注意到我映射的ssh服务端有大量尝试登录的日志(数万条),映射的web服务也有目录扫描的日志。禁止ssh密码登录确实可以解决问题,但是也会带来一些不方便,毕竟一般不会随身带着密钥文件。再者尝试登录是会走服务器流量的,虽然很少(cc攻击就会很多了)。

Image

Describe the solution you'd like
A clear and concise description of what you want to happen.
类似于fail2ban的功能,当某个隧道的连接频率超过指定阈值,则禁止一段时间的连接。例如fail2ban可以设置10分钟内有10次失败尝试(可以是建立连接)可以调用ufw防火墙ban掉对应ip一段时间。
如果是nps来做这件事的话,甚至不需要防火墙

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
目前我是打算使用fail2ban来做这件事,它通过分析日志来得到远程ip的访问频率,但是自定义规则很麻烦,我尝试了一个下午也没有解决。

  • 我注意到本分支建立连接的日志需要设置为7才能看到,也即是2025/04/14 17:10:19.310 [D] [tcp.go:42] new tcp connection,local port 4222,client 36,remote address 123.207.125.84:50904。如果使用fail2ban的方案,会导致日志文件过大。
  • nps.log的日志位置和原项目不一样,原项目是/var/log/nps.log,本项目是/nps.log

鉴于以上情况,非常期待nps实现这个功能。

Additional context
Add any other context or screenshots about the feature request here.
期待您的回复 🫡

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions