Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve IP Address Detection #526

Closed
raamdev opened this issue Mar 21, 2015 · 4 comments
Closed

Improve IP Address Detection #526

raamdev opened this issue Mar 21, 2015 · 4 comments

Comments

@raamdev
Copy link
Contributor

@raamdev raamdev commented Mar 21, 2015

@raamdev writes...

Using CloudFlare results in all requests to s2Member looking like they're coming from the same IP address. What kinds of areas will this affect?

@jaswsinc writes...

If you're running the Cloudflare WordPress plugin this should not be an issue, based on this code that I find the WordPress plugin for Cloudflare.

@raamdev writes...

Will having a server configured with mod_cloudflare (so that visitors' IP addresses are passed through to the web server) be a requirement to using s2Member + CloudFlare? Are there any other issues you can think of?

@jaswsinc writes...

Based on the code that I just reviewed, I don't think mod_cloudflare will be necessary if we implement checks for $_SERVER["HTTP_CF_CONNECTING_IP"] in both s2Member and in ZenCache.


Referencing: wpsharks/comet-cache#418
Referencing: wpsharks/s2member-kb#160


What Needs To Occur Here?

  • Add a new utility class to the s2Member codebase that takes advantage of some of the same functionality we have been adding to our other plugins, like WPKBA's utils-ip.php class file
  • Inspect the entire s2Member codebase for uses of $_SERVER['REMOTE_ADDR'] and update these so that we reference the new utils_ip class members instead.
@raamdev raamdev added the enhancement label Mar 21, 2015
@jaswrks jaswrks changed the title Improve remote client IP address handling on sites using CloudFlare Improve IP Address Detection Mar 26, 2015
@jaswrks
Copy link
Contributor

@jaswrks jaswrks commented Mar 26, 2015

Adding list of items (↑ above) that need to occur.

@raamdev raamdev modified the milestone: Next Release Oct 12, 2016
jaswrks pushed a commit that referenced this issue Nov 11, 2016
jaswsinc
jaswrks pushed a commit to wpsharks/s2member-pro that referenced this issue Nov 11, 2016
jaswsinc
jaswrks pushed a commit to wpsharks/s2member-pro that referenced this issue Nov 11, 2016
jaswrks pushed a commit that referenced this issue Nov 11, 2016
jaswrks pushed a commit that referenced this issue Nov 11, 2016
jaswsinc
@jaswrks
Copy link
Contributor

@jaswrks jaswrks commented Nov 11, 2016

Next Release Changelog:

  • IP Detection: This release improves s2Member's ability to determine the current user's IP address. s2Member now searches through HTTP_CF_CONNECTING_IP, HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, HTTP_X_FORWARDED, HTTP_X_CLUSTER_CLIENT_IP, HTTP_FORWARDED_FOR, HTTP_FORWARDED, HTTP_VIA, and REMOTE_ADDR (in that order) to locate the first valid public IP address. Either IPv4 or IPv6. Among other things, this improves s2Member's compatibility with sites using CloudFlare. See also: issue #526 if you'd like additional details.
jaswrks pushed a commit that referenced this issue Nov 11, 2016
jaswsinc
@renzms
Copy link
Contributor

@renzms renzms commented Nov 22, 2016

@jaswsinc / @raamdev

Confirmed Working 👍

Steps Taken

Using test sites running Cloudflare and tested with IP restrictions

  • Installed s2Member Pro v161117-RC and enabled Brute Force IP/Login Restrictions
  • After failed Max attempts from specific IP, tried different test user login on same IP to make sure IP restriction is enabled.
  • Used different IP and logged in successfully using previously blocked test user login
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Nov 29, 2016

s2Member v161129 has been released and includes changes from this GitHub Issue. See the v161129 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#526).

@raamdev raamdev closed this Nov 29, 2016
@wpsharks wpsharks locked and limited conversation to collaborators Nov 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.