Support » Plugin: IP Geo Block » White list of IP addresses or ranges?

  • Resolved Fabiano

    (@fabianoengler)


    Hi there,

    I was wondering if there is way to configure some IP addresses or ranges to be always accepted.

    On my configuration, US country is blocked but I have WordFence plugin and its scanner won’t work because the scan depends on the WordFence’s servers, which are in US range.

    US is a constant source of attacks and malware for me, my site have no English version and I have no business in US, hence I really would like to keep US blocked, but I also wanted for the WordFence scanner to work. WordFence servers have a fixed list of IP addresses, hence if I could whitelist those IPs I would be to achieve the desired configuration.

    As a matter of fact, I am white listing only my own country, so all others are blocked. Now, I have to also white list US, which creates an unnecessary exposure for me.

    If that’s not possible currently, it is a feature that could be incorporated in the future. If that’s to happen, I have some other complimentary suggestions that seems to fit together:

    – If a white list of IP addresses is to be added, perhaps a black list could also be useful. I.e., allowing my country but black listing a list of known bad IPs. Even further, besides manual black listing, perhaps the plugin could also get lists of known bad IPs from the internet (ex.: iThemes Security plugin gets a list of bad IPs from HackRepair.com).

    – Instead of blocking only some specific parts of WP, perhaps IP Geo Block plugin could offer an option to block the whole site as well. (ex.: iQ Block Country does that and offers an option to customize the response, if want to put a “friendly” page saying this website is not accessible from your country).

    – If blocking of the whole site is possible, it may create a problem with search engine crawlers. A nice feature some plugins have is the detection of such crawlers and selective while list of them. I believe a simple check as referrer, reverse dns lookup and then forward dns lookup (to confirm it resolves to the same IP and the reverse was not faked) should be more than enough to believe the bots are from the search engines they claim to be. As an illustration, an analysis of the attacks I am under constantly shows that most malicious requests I received pretend to be from Bing crawler, but they all fail on such reverse dns validation.

    Those are my two cents, thanks a lot for your time and effort in putting such a nice plugin in place for us. Keep up the good work!

    For example, I am trying to block US co

    https://wordpress.org/plugins/ip-geo-block/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi Fabiano,

    Thank you very much for your good suggestions and deep insights.

    I had checked some functionalities of WordFence combined with this plugin, but sorry for not full functionalities. Concerning the WordFence Scanner, I didn’t know about the option “Start all scans remotely“. This may request to the “wp-admin/admin-ajax.php” with some queries to kick off the source code scanning.

    I already have a function which verifies the white list or the black list of IP addresses for IPv4 and IPv6 with certain range. But I don’t have decided to release it yet. For now, I’d like to ask you to try to add the following codes into your “functions.php” to accept the WF Ajax signature.

    function my_permitted_ajax( $validate ) {
        $whitelist = array(
            'wordfence_doScan',
            'wordfence_testAjax',
    //      'wordfence_logHuman',
    //      'wordfence_perfLog',
        );
    
        if ( isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], $ whitelist ) )
            $validate['result'] = 'passed';
    
        return $validate;
    }
    if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
        add_filter( 'ip-geo-block-admin', 'my_permitted_ajax' );

    And speaking about “an option to block the whole site”, I’d like to focus the “security enhancement” for the time being, not “content restriction by region“. As a security plugin, it provides the functionality which blocks any malicious requests to the php files in the WP site, while any services on the public facing pages would not be blocked. But I think the current protection ratio of this plugin against the malicious access is not sufficient. So I should dedicate to do more work to reach my ideal state, which is “WordPerss in the clean room”. Currently, this is my basic concept and goal for this plugin.

    Again, thank you for giving me a chance to think about the future of this plugin. More suggestions or discussions will be appreciated.

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Additional comment about a “human friendly page”. It’s also available in this plugin. Please copy your “404.php” to “403.php” in your theme directory and add the proper messages!

    Fabiano

    (@fabianoengler)

    Thanks for the quick and kind response!

    Looking forward the next release!

    Plugin Author tokkonopapa

    (@tokkonopapa)

    I got it!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘White list of IP addresses or ranges?’ is closed to new replies.