How to add an IP address by custom header in iThemes Security

This article has been written before more than 1 years, information might old.

Sometimes happen that you are working on a specific hosting that has a specific architecture so the IP of the bruteforce in the log of iThemes Security have a strange IP address.

iThemes Security look on 3 specific header (cloudflare and standard ones) to find the real IP address but sometimes is not enough.

The plugin offer a specific filter where is possible to add a custom header name where look on it.

add_filter('itsec_filter_remote_addr_headers', function($headers) {
    $headers[] = 'X-Forwarded-For';
    return $headers;
});

With this little bit of code is possible to add the custom ones and have a real IP for the plugin and continue to work.

It is important for the plugin to identify the real IP in that way can block all the request and not consider all the request from a bad IP.

Reference: https://wordpress.org/support/topic/127-0-0-1-as-host-of-brute-force/

 

Leave a Reply

Your email address will not be published. Required fields are marked *

How to add an IP address by custom header in iThemes Security

time to read: 1 min
0