Forum Discussion
KellyS_50017
Nimbostratus
Nov 11, 2009http_to_https http profile rule question
Hopefully a super-easy question about the built-in http class profile rule, http_to_https. A client of ours is saying HP's WebInspect is dinging us with a security flaw when it tries to get into areas we have covered (a virtual server on port 80 with the sole rule of http_to_https) with http_to_https, and it's sort of claiming it's getting through with an http request, to our web server, and the response is over http (with our internal cookie & you can clearly see the F5 cookie) with a 302 status & the https url to go to.
Their complaint is even though we're asking the client to redirect they are in an https-only area, getting an http response.
I really didn't think it worked like this. I thought setting up a port 80 listener with the http_to_https http class rule would immediately bounce the client request back with a 302 & the correct url to go to instead. Is WebInspect right or wrong? Are they really getting to us over http, or is WebInspect combining the original http request, the 302 redirect and the results from the 302 redirect?
- hoolio
Cirrostratus
Hi Kelly - KellyS_50017
Nimbostratus
I'm understanding more, I think. Setting cookies to Secure in our asp.net code wouldn't help, because that only says "only transmit cookies over ssl", right? It doesn't actually help because between the F5 and our web servers, you can only do SSL. - hoolio
Cirrostratus
No cookie should be set in a response generated from LTM unless you explicitly configure it. Nor could the app set a cookie if the request is never load balanced by LTM. I was assuming the client was sending a cookie in the request to the HTTP VIP. - hoolio
Cirrostratus
Was the original Location header value http://something? Or was it just a path like /anon/anon.aspx? If it's the former, that might be the issue that WebInspect is reporting. If it is an http:// reference in the Location header value, you can have LTM rewrite it to HTTPS using the rewrite redirects option on a custom HTTP profile you add to the VIP. - KellyS_50017
Nimbostratus
Nope, the original location header value was /anon/anon.aspx. - hoolio
Cirrostratus
What's VIP stand for, sorry? Virtual IP? What I was calling a listener?
WebInspect seems to be confusing an initial http request with a 302 response (the 2nd 302 response, from our web site) with cookie data to be "insecure".
- KellyS_50017
Nimbostratus
Sure. You've seen the request and response block from WebInspect, here's the text accompanying it, with the url anon'd. - hoolio
Cirrostratus
Okay, that's making a it more sense. WI is reporting that the client is receiving cookies from LTM/the app that do not have the secure flag set. Because there is an HTTP VIP defined that accepts TCP connections (regardless of what it does in terms of HTTP responses), if the client did make a request to the HTTP VIP, it would include the cookies which are not marked as secure by LTM/the app.when HTTP_RESPONSE { Insert a test cookie (remove this when done testing) HTTP::cookie insert name test_cookie value test_value path / Set the secure flag on the test cookie (remove this when done testing) HTTP::cookie secure test_cookie enable Loop through each cookie in the response by name foreach a_cookie [HTTP::cookie names] { log local0. "$a_cookie=[HTTP::cookie value $a_cookie], secure: [HTTP::cookie secure $a_cookie]" Set the secure flag on the cookie. The flag only seems to be set if it's not there already, so no need to check the original state first HTTP::cookie secure $a_cookie enable } }
- KellyS_50017
Nimbostratus
Thanks! - KellyS_50017
Nimbostratus
Thanks Aaron, this took care of it. We passed a lesser scan (that we own) where this was marked low/informational, we're asking the client to rescan us with WebInspect but I have no reason to believe we won't pass.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects