Giter Club home page Giter Club logo

dynfirewall's Introduction

DynFirewall

To help to protect servers from remote attacks such as ssh service 3306 database services, or windows remote desktop. for dynamically updating firewall whitelist based from DNS TXT record

  • Use , you can add it to crontab
    python firewall_update_linux.py ip.txt.example.com

  • add following line to your iptables configure file
    -A INPUT -m set --match-set trusted src -j ACCEPT
    /etc/sysconfig/iptables

  • and Comment out the following line
    You can find this line
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

Change into
#-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

  • If you want automatically create ipset on startup please check systemd-ipset by BroHui
  • If you iptables including a Non-existent ipset, iptables service will broken won't start, that's why we need systemd-ipset

DNS TXT record guide:

you can add IPv4 address or subnet. if you want add multiple IP or subnets you can use ',' split, also you can add txt alone for per ip address/subnet

  • Example host type record
    ip.txt TXT "1.1.1.1,2.2.2.2/32"
    ip.txt TXT "3.3.3.3"
    ip.txt TXT "4.4.4.0/24"

Windows Server 2012 Later

  • You can use pyinstaller to Build EXE binary
    pyinstaller -F firewall_update_win.py
  • CDM to create a Schtasks(Update in minute)
    Schtasks /create /tn "Firewall_Update" /RU SYSTEM /sc daily /st 00:00 /RI 1 /K /DU 24:00 /tr "C:\Windows\system32\firewall_update_win.exe ip.txt.example.com"

dynfirewall's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.