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

HSTS and secure cookies w/o redirect? #89

Closed
n3bulous opened this issue Jul 27, 2016 · 2 comments
Closed

HSTS and secure cookies w/o redirect? #89

n3bulous opened this issue Jul 27, 2016 · 2 comments

Comments

@n3bulous
Copy link

Apologies if this is the wrong place to ask this question, but I couldn't find an answer on SO or in Issues.

Question not the sensibility, but we are moving to the following network scheme: Load Balancer (ELB, HTTPS) -> Firewall (HTTP) -> ELB (HTTP) -> Rails

We currently have one ELB and it terminates SSL which creates the appropriate header for Rails' force_ssl = true to work properly. The new scheme doesn't provide that header, and the HTTPS redirect is handled by the firewall. We would still like to have HSTS and secure cookies enabled.

After reading through Rails' ssl.rb and ssl-enforcer.rb, it doesn't look possible to avoid the redirect. Have I missed something, is this "impossible", or just stupid (suck it up and put the cert on all the things)?

@tobmatth
Copy link
Owner

tobmatth commented Aug 5, 2016

I'm not sure i got your point and must admit that i have very little experience with ELB, but if rack-ssl-enforcer is not able to determine if the request's scheme is HTTP or HTTPS due to missing headers, you will end up in an infinite redirect loop.

@n3bulous
Copy link
Author

n3bulous commented Aug 6, 2016

Thanks for looking. I was wondering if I'd missed a way to enable HSTS and secure cookies w/o rack-ssl-enforcer detecting HTTPS and whether it would make sense for a PR to accomplish that.

From our research, it looks like the 2nd, internal ELB will not forward the headers, so we've gone w/ placing the SSL certificate on all devices up to and including the internal load balancer. A hassle because one of the devices isn't under our control, but easier than adding a questionable hack to rack.

@n3bulous n3bulous closed this as completed Aug 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants