• Resolved litemotiv

    (@litemotiv)


    Since REMOTE_ADDR is only available for direct connections and not on proxies, could you perhaps add support for X_FORWARDED_FOR headers? Something like below would work:

    function($user_login, $user)
    {
        $ip = ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') ? $_SERVER['REMOTE_ADDR'] : $_SERVER['X_FORWARDED_FOR'];
        openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_AUTH);
        syslog(LOG_INFO,"Accepted password for $user_login from {$ip}");
    },10,2);

    Thanks. ??

    https://www.ads-software.com/extend/plugins/wp-fail2ban/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Where you add this code ?

    tks i founded

    very useful, I hope this works as intended and can be incorporated into the next plugin version please?

    Plugin Author invisnet

    (@invisnet)

    I’ve just released 2.0.0 which has some *experimental* code to handle this; it’s a little different from what you’ve done but the principle is the same.
    Details are in the readme – let me know how you get on.

    Going to check this out soon! Thanks for following up!

    jsut read the readme and you say:

    so don’t add whitespace or CIDR notations

    but what I need this for is for the CloudFlare IPs and they only specify them in CIDR format => https://www.cloudflare.com/ips

    Any chance you could add CIDR support?

    204.93.240.0/24
    204.93.177.0/24
    199.27.128.0/21
    173.245.48.0/20
    103.21.244.0/22
    103.22.200.0/22
    103.31.4.0/22
    141.101.64.0/18
    108.162.192.0/18
    190.93.240.0/20
    188.114.96.0/20
    197.234.240.0/22
    198.41.128.0/17
    162.158.0.0/15

    Plugin Author invisnet

    (@invisnet)

    Sorry for the delay in mentioning it, but the latest release now has support for CIDR.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Support for X-Forwarded-For’ is closed to new replies.