I just set up Cloudflare for my site a few days ago. Today, I’ve had several complex and hundreds of brute force attacks on my site. Wordfence keeps blocking the IP addresses or I am doing it manually. I looked them up on Whois and they are all Cloudflare IP addresses. Everytime one gets blocked, a new IP address pops up trying to hack my site. I’m a little confused by this. If Wordfence blocks all these IP addresses from Cloudflare, will it still work on my site properly? Is it just coincidental that the attacks are coming from Cloudflare IPs?
Not a coincidence:
@sdaysman That makes sense. Thank you for sharing this with me!
In WordFence, go to All Options, scroll down to “How does Wordfence get IPs” and select "Use the Cloudflare “CF-Connecting-IP” HTTP header to get a visitor IP. Only use if you’re using Cloudflare."
@Withheld when I saved that setting, I got this notification; " Your ‘How does Wordfence get IPs’ setting is misconfigured. This site is currently using the Cloudflare “CF-Connecting-IP” HTTP header, which should only be used when the site is behind Cloudflare. This site appears to be behind a front-end proxy, so using the X-Real-IP HTTP header will resolve to the correct IPs."
Just under the Cloudflare option, there is “Detected IP(s)” do either Cloudflare or Default options show your current IP?
Yes, both options show a detected IP address but it’s two different IPs.
Go to https://www.bing.com/search?q=what's+my+ip to determine your actual IP.
Then go back to WordFence and check Detected IP(s): again to see which option resolves your IP properly.
My IP matches the “Use the Cloudflare “CF-Connecting-IP” HTTP header to get a visitor IP. Only use if you’re using Cloudflare.” detected IP(s).
That’s what it should be and moving forward, you should see the proper visitor IP’s in those logs.
Does it matter that I’m getting the notification that my site appears to be behind a front-end proxy?
Cloudflare is a proxy. Be sure to follow the guide posted by @sdayman if you encounter the same problem with AWStats or Webalizer.
Okay, great. Thank you for your time and help! I truly appreciate it!