PyFilter | Denies user access via blocking IP addresses | Firewall library

 by   Jason2605 Python Version: v2.1.0 License: MIT

kandi X-RAY | PyFilter Summary

kandi X-RAY | PyFilter Summary

PyFilter is a Python library typically used in Security, Firewall applications. PyFilter has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However PyFilter build file is not available. You can download it from GitHub.

PyFilter aims to filter out all of the requests that are not legitimate to your server, and blocks them if too many are sent. It works by reading log files and checking if a failed request has came from the same IP address within a user configurable amount of time and adding rules to the firewall if too many attempts have been captured. By default PyFilter is configured to read from /var/log/auth.log for incoming SSH requests, however there are options for Apache, Nginx and MySQL too. PyFilter uses a database to store all the banned ip addresses to ensure ips arent added more than once. PyFilter currently supports sqlite and redis, by default it is setup to use sqlite so no installation of a redis server is needed. However redis has support for cross server ban syncing (more info below).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              PyFilter has a low active ecosystem.
              It has 44 star(s) with 7 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 1 have been closed. On average issues are closed in 266 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of PyFilter is v2.1.0

            kandi-Quality Quality

              PyFilter has 0 bugs and 0 code smells.

            kandi-Security Security

              PyFilter has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              PyFilter code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              PyFilter is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              PyFilter releases are available to install and integrate.
              PyFilter has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              PyFilter saves you 131 person hours of effort in developing the same functionality from scratch.
              It has 330 lines of code, 22 functions and 6 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed PyFilter and discovered the below as its top functions. This is intended to give you an instant insight into PyFilter implemented functionality, and help decide if they suit your requirements.
            • Runs firewall rules
            • Get all ban messages
            • Scans the server
            • Ban an IP address from redis
            • blacklist an IP address
            • Checks IP address
            • Log a message to a log file
            • Checks if the given IP address is valid
            • Monitor the redis connection
            • Bulk ban redis
            • Read files from a log file
            • Filter based on pattern_type
            • Check if the IP address matches the given pattern
            Get all kandi verified functions for this library.

            PyFilter Key Features

            No Key Features are available at this moment for PyFilter.

            PyFilter Examples and Code Snippets

            PyFilter,Configuration:
            Pythondot img1Lines of Code : 73dot img1License : Permissive (MIT)
            copy iconCopy
            {
              "settings": {
                "database": "sqlite",
                "failed_attempts": 5,
                "deny_type": "DROP",
                "ignored_ips": ["127.0.0.1"],
                "request_time": 5,
                "reload_iptables": true,
                "rules": {
                  "ssh": {
                    "log_files": "/var/log/auth.log  
            PyFilter,Installation:
            Pythondot img2Lines of Code : 13dot img2License : Permissive (MIT)
            copy iconCopy
            sudo apt-get update
            sudo apt-get install build-essential
            sudo apt-get install tcl8.5
            wget http://download.redis.io/releases/redis-stable.tar.gz
            tar xzf redis-stable.tar.gz
            cd redis-stable
            make
            make test
            sudo make install
            cd utils
            sudo ./install_serve  
            Time format
            Pythondot img3Lines of Code : 8dot img3License : Permissive (MIT)
            copy iconCopy
            %Y -> Year
            %m -> Month (Month as number form e.g 10 = October)
            %b -> Month (Month as abbreviated name e.g Oct)
            %B -> Month (Month as full name e.g October)
            %d -> Day
            %H -> Hour
            %S -> Second
            %d -> Day within a month (e.g 1 for   

            Community Discussions

            QUESTION

            python-daemon + argparse?
            Asked 2017-Nov-30 at 15:50

            I made a script that takes a few arguments to run. Originally it could be run automatically with the argument 'auto', but I'm trying to daemonize it so it will run the run the script with the specified arguments as a daemon. The problem is that python-daemon and argparse don't seem to get along when it comes to deciding who parses what.

            ...

            ANSWER

            Answered 2017-Nov-30 at 15:50

            Argparse takes arguments from sys.argv per default (see here). It is not surprising that the behaviour you see here is happening, as you just call the parse_args function with the default arguments. You can just pass whatever you want to parse to it, instead of sys.argv.

            See this question for an example.

            So consume whatever you need for python-deamon and then parse the remaining args with argparse.

            Source https://stackoverflow.com/questions/47576716

            QUESTION

            Why doesn't argparse let me add optional arguments in any order?
            Asked 2017-Nov-21 at 02:16

            In the code below, I cannot add the -v and -p arguments after the action (update, blacklist, auto), presumably due to the subparser. How can I make it so that I can add these optional arguments in any order?

            ...

            ANSWER

            Answered 2017-Nov-21 at 01:24

            This is how your tree of parser looks like

            Source https://stackoverflow.com/questions/47403438

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install PyFilter

            You can download it from GitHub.
            You can use PyFilter like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Firewall Libraries

            opensnitch

            by evilsocket

            fail2ban

            by fail2ban

            TheFatRat

            by screetsec

            TheFatRat

            by Screetsec

            ModSecurity

            by SpiderLabs

            Try Top Libraries by Jason2605

            AdminPanel

            by Jason2605PHP

            SteamQuery

            by Jason2605Python

            SCF

            by Jason2605Python

            SQLite-View

            by Jason2605HTML

            simple-http

            by Jason2605Rust