V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
lowman
V2EX  ›  程序员

用 Python 做了一个动态添加/删除 IP 黑名单的程序(或者说实现方案),一起探讨下

  •  
  •   lowman · Sep 5, 2019 · 2077 views
    This topic created in 2432 days ago, the information mentioned may be changed or developed.

    抽空用 python 做了一个能根据过期时间 动态添加 /删除 IP 黑名单 的程序(或者说实现方案), 是利用了 redis + ipset + python 去进行实现的.

    个人认为,在 nginx 实现 IP 黑名单动态增删(nginx + redis + lua)虽然也是一个可选的方案,但是遇到 ddos 时,终究还是会在一定程度上占用服务器资源, 如果使用 iptables(ipset 是 iptables 的拓展工具)能进一步减轻黑名单 IP 高频访问服务器而造成的资源占用.

    程序地址------> https://gitee.com/lowmanisbusy/ip_blacklists

    第一次在社区公开自己写的程序,只求一起探讨一下这个方案的可行性,有什么问题,热烈欢迎批评指正,如果觉得这个方案还可以,star 可否?

    手动自己的狗头.gif.........................

    lowman
        1
    lowman  
    OP
       Sep 5, 2019
    有胜阅兵,手动狗头
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2485 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:40 · PVG 15:40 · LAX 00:40 · JFK 03:40
    ♥ Do have faith in what you're doing.