Forum Discussion
Masking cookie names from the server
The following appears to work perfectly, if you just look at the logs. However, the application (obviously OWA in this case) isn't fooled. Because it's encrypted I can't use tcpdump to confirm the headers are correctly being set.
when HTTP_REQUEST {
if { [HTTP::header exists "Cookie"] and [HTTP::header "Cookie"] contains "OWAsessionid" } {
log local0. "Trying to send cookie(s): [HTTP::header "Cookie"]"
set new_cookies [string map {OWAsessionid= sessionid=} [HTTP::header value "Cookie"]]
HTTP::header remove "Cookie"
HTTP::header insert "Cookie" $new_cookies
log local0. "Actually sent cookie(s): [HTTP::header "Cookie"]"
}
}
when HTTP_RESPONSE {
if { [HTTP::header exists "Set-Cookie"] and [HTTP::header "Set-Cookie"] contains "sessionid" } {
log local0. "Trying to set cookie: [HTTP::header value "Set-Cookie"]"
set new_cookies [string map {sessionid= OWAsessionid=} [HTTP::header value "Set-Cookie"]]
HTTP::header remove "Set-Cookie"
HTTP::header insert "Set-Cookie" $new_cookies
log local0. "Actually set: [HTTP::header value "Set-Cookie"]"
}
}
The logging output from this rule:
Dec 9 15:53:23 tmm tmm[2524]: Rule CookieMask2 : Trying to set cookie: sessionid=78bb3b32-ec44-4d2f-a888-52bdd454c9f7; path=/; path=/
Dec 9 15:53:23 tmm tmm[2524]: Rule CookieMask2 : Actually set: OWAsessionid=78bb3b32-ec44-4d2f-a888-52bdd454c9f7; path=/; path=/
Dec 9 15:53:23 tmm tmm[2524]: Rule CookieMask2 : Trying to send cookie(s): BIGipServerPool_Exchange=2689860362.20480.0000; OutlookSession=aacc1677c2f84a18836f5eb3d560dcd1; PBack=0; OWAsessionid=78bb3b32-ec44-4d2f-a888-52bdd454c9f7
Dec 9 15:53:23 tmm tmm[2524]: Rule CookieMask2 : Actually sent cookie(s): BIGipServerPool_Exchange=2689860362.20480.0000; OutlookSession=aacc1677c2f84a18836f5eb3d560dcd1; PBack=0; sessionid=78bb3b32-ec44-4d2f-a888-52bdd454c9f7
Recent Discussions
Related Content
* 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