微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

RedisPushIptables 通过 Redis 调用 iptables

程序名称:RedisPushIptables

授权协议: GPLv3

操作系统: 跨平台

开发语言: C/C++

RedisPushIptables 介绍

该模块可以通过 redis 来操作 iptables 的 INPUT
表规则的增加删除,可以用来动态调用防火墙。比如用来防御攻击。功能与fail2ban相同,只不过它不需要日志分析,但是需要api主动调用,性能更好.

但是前提要以 root 来运行,因为 iptables 需要 root 权限。

  • accept.insert - Filter table INPUT ADD ACCEPT
  • accept.delete - Filter table INPUT DEL ACCEPT
  • drop.insert - Filter table INPUT ADD DROP
  • drop.delete - Filter table INPUT DEL DROP
  • ttl.drop.insert - Filter table INPUT ADD DROP

    127.0.0.1:6379>accept.insert 192.168.188.8
    (integer) 13
    127.0.0.1:6379>accept.delete 192.168.188.8
    (integer) 13
    127.0.0.1:6379>drop.delete 192.168.188.8
    (integer) 13
    127.0.0.1:6379>ttl.drop.insert 192.168.188.8 60
    (integer) 13

    root@debian:~# iptables -L -n
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    DROP       all  –  192.168.188.8        0.0.0.0/0 
    ACCEPT       all  –  192.168.188.8        0.0.0.0/0

RedisPushIptables 官网

https://github.com/limithit/RedisPushIptables

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐