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

Proxy Server IP header support #722

Merged
merged 4 commits into from Apr 12, 2015

Conversation

jdarwood007
Copy link
Member

This adds support for SMF for handling Proxy Servers, such as a CDN or Reverse Proxy. We can now specify to do nothing, autodetect (SMF default) or only allow a single header to respond. As well we setup allowed IP ranges. The main reason behind this is security and for ease of expandability to other headers that obscure proxy headers use.

I should note that most servers are supposed to handle these securely as it is, but it doesn't hurt for us to be sure as well. This also adds a function to SMF which may be useful in the future, but for now was used for proxy servers that have you use CIDR entries.

Final note is Subs-Charset got pulled in on this. It appears to be line ending differences that need fixed. If needed I can attempt to remove it, otherwise I would just let us pull the changes and fix the line endings to match what we are now forcing with .gitattributes

jdarwood007 added 3 commits October 13, 2013 20:34
Signed-off-by: jdarwood007 <github+smf@sleepycode.com>
Signed-off-by: jdarwood007 <github+smf@sleepycode.com>
Signed-off-by: jdarwood007 <github+smf@sleepycode.com>
@@ -170,6 +170,15 @@ function verifyAgree()
</dl>';
}

echo '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this here? Not the line, but this entire code block..... a seemingly unrelated part of this commit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were doing some testing based on some stuff discussed in the SMF chatroom, and this may be related but it's not part of the feature AFAIK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, I forgot to revert those changes before committing. Just uploaded a commit to revert that.

Signed-off-by: jdarwood007 <github+smf@sleepycode.com>
@Oldiesmann
Copy link
Contributor

Looks good to me. The Subs-Charset thing could be the line-endings, but I've never had that problem on my end (using GitHub For Windows, the "posh-git" thing GH includes or SourceTree/regular git via Mingw), so I have no idea why some people are having that problem but others aren't. I guess it can't hurt to pull it in though.

@Arantor
Copy link
Contributor

Arantor commented Oct 27, 2013

OK, so I changed up Subs-Charset so hopefully this should not happen so much in the future.

@Oldiesmann
Copy link
Contributor

This is showing a merge conflict now.

@Arantor
Copy link
Contributor

Arantor commented Feb 9, 2014

It might be nice to also support http://dev.simplemachines.org/mantis/view.php?id=1564 as part of this, where we show both IP addresses to the user.

@butchs
Copy link
Contributor

butchs commented Jun 14, 2014

Interesting I just did something similar but with an emphasis on spoof detection. I am not sure but I think you may have missed repeated multiple message-header field per RFC2616?

Please note that Cf-Connecting-Ip should be changed to HTTP_CF_CONNECTING_IP since you are using $_SERVER to get the HTTP IP address. Cf-Connecting-Ip was originally used to verify that CF is online.

@live627 live627 mentioned this pull request Apr 2, 2015
@live627 live627 merged commit f8a2577 into SimpleMachines:release-2.1 Apr 12, 2015
@jdarwood007 jdarwood007 deleted the ip-headers-option branch November 1, 2015 22:48
@Gwenwyfar Gwenwyfar added the Proxy label Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants