Bicham
Nov 11, 2015Nimbostratus
ICAP with iRule Response Page without ASM
Hello,
Firstly sorry for my english :-)
We are running Big IP LTM 11.5.1 Build 7.0.167 Hotfix HF7.
We set up Content Adaptation for HTTP request to check files uploaded through one of our website using ICAP.
We follow this https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-implementations-11-5-1/14.htmlunique_1613576295
It is working fine BUT there is always a "but", in case a virus is detected the ICAP servers modify the response to the initial POST with its own response page saying "a virus has been detected bla bla bla"
The web page is ugly so we would like to redirect the end-user to a dedicated and corporate web page of our web site saying " we are sorry but we detect a virus within your upload so your files have been refused"
Within our irule, we used the event "ADAPT_REQUEST_RESULT" to set up a variable to 1 when a virus is found, this working =>
when ADAPT_REQUEST_RESULT {
set ADAPTvar 0
if { ([ADAPT::result request] contains "respond") }{
set ADAPTvar 1
log local0. "ICAP: Check ADAPT VAR: == $ADAPTvar => Virus Found"
}
} else {
set ADAPTvar 0
log local0. "ICAP: Check ADAPT VAR: == $ADAPTvar => Virus NOT Found"
}
}
But we are unable to find a event where to use this variable to send a redirect :-(
The test is simple :
if { [info exists ADAPTvar] && $ADAPTvar == 1} {
log local0. "ICAP: ADAPT VAR Virus Found"
}
The test failed within : HTTP_REQUEST_RELEASE, HTTP_REQUEST_SEND, HTTP_RESPONSE, HTTP_RESPONSE_DATA...
The test is ok within : HTTP_RESPONSE_RELEASE but in this event the redirect is not allowed (HTTP:redirect or HTTP::response).
How could we redirect the POST of the user to a dedicated page within our website if a virus is found using ICAP internal VS ?
Many thanks in advance for any help on this matter: I am stuck for 2 days now...
Regards,
Icham B.