• Resolved wpmhweb

    (@wppit)


    If I configure Cloudflare on a site, will Jetpack will connect to the website through the Cloudflare IPs or directly to the web server IP address?
    I’m having an issue, after enabling Cloudflare, 24 hours later, I started getting the 521 error from Cloudflare. If I’m lucky to connect to the website, at logon, JetPack will lock me out, showing me an IP from Cloudflare saying that it was my IP address and that IP had security violations.
    I have whitelisted the Cloudflare IPs in UFW and fail2ban, but I’m still getting the same errors.
    One thing I noticed is that a specific range of IPs from Cloudflare 162.158.x.x getting blocked by UFW, but I whitelisted the range in the firewall already.
    The only thing I have found is that long time ago I place a block for xmlrpc.php in the htaccess, but only allowing the IPs from JetPack.
    When I checked the apache error logs, I have found that even though I whitelisted the Cloudflare IPs in the firewall, the htacess is blocking access to the xmlrpc.php from any IP.
    – Is the htaccess file block code could be causing the 162.158.x.x IPs from still getting blocked by the UFW?
    – Why the 162.158.x.x range address are trying to access xmlrpc.php when Cloudflare protects the xmlrpc.php by default?
    – Are the 162.158.x.x IPs coming from Jetpack trying to proxy into the site to connect, but it’s getting blocked?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @wppit,

    Is the htaccess file block code could be causing the 162.158.x.x IPs from still getting blocked by the UFW?

    This is a question best directed at your host. What I can say is that I think UFW is at a lower level than htaccess which would mean that htaccess rules/directives will get applied first.

    Why the 162.158.x.x range address are trying to access xmlrpc.php when Cloudflare protects the xmlrpc.php by default?

    You say the 162.158.x.x ranges are Cloudflare IPs, so it only makes sense that Cloudflare will be able to send requests to your server for the file while still deciding who gets an OK response.

    Are the 162.158.x.x IPs coming from Jetpack trying to proxy into the site to connect, but it’s getting blocked?

    Generally speaking, Cloudflare serves as a proxy (intermediary) server, so Jetpack’s requests will go through Cloudflare (if enabled for your site) before they get to your origin web server.

    Cloudflare shouldn’t block Jetpack by default, but it shouldn’t hurt to whitelist Jetpack’s IPs in Cloudflare, UFW, and htaccess.

    Thread Starter wpmhweb

    (@wppit)

    @ihenetudan I’m removing the htaccess code and see what happens. Is it necessary to whitelist the Cloudflare IPs to Jetpack?
    Also, why would Jetpack lock me out of the site and say that the IP I’m reaching the site has caused security violations? To clarify, the IP that Jetpack shows I’m coming from is one from the 162.158.x.x range. After I disable Cloudflare, then I can login again.
    Thanks,

    • This reply was modified 3 years, 7 months ago by wpmhweb.
    Thread Starter wpmhweb

    (@wppit)

    @ihenetudan So, I wanted to follow up and add that I temporarily removed the htaccess code, but after 2 hours, Jetpack locked me out of the site because it kept saying that my IP address was 162.158.62.132 and it was flagged for potential security violation.
    I have the WP-fail2ban plugin (free version), and the dashboard widget shows login attempts from 162.158.x.x IP range, but it looks like a bot or attacker trying to guess the username and password.
    So, my theory now is that the security is working fine, but Cloudflare and letting the attacks through so, for example, if before, I was getting “attacks” from 1.1.1.1, 2.2.2.2, 3.3.3.3, 4.4.4.4, and 5.5.5.5 from Europe, now Cloudflare proxy these addresses with the 162.158.x.x and now are getting blocked by Jetpack and server firewalls.
    The IPs are not real, I just picked those to write what I wanted to say.
    What do you think?

    Plugin Support lastsplash (a11n)

    (@lastsplash)

    Hi @wppit

    It isn’t uncommon for bots to attempt to access your website, so that may be what is going on here.

    There may be an adjustment that we can make to improve the accuracy of Jetpack’s IP detection. Could you please post your site URL here so that we can have a look?

    If you want it to remain private, you can also contact us via this contact form. If you choose to reach out directly, please include a link to this thread.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Jetpack causing access problems when Cloudflare is enabled, how to fix?’ is closed to new replies.