Forum Discussion

Moinul_Rony's avatar
Moinul_Rony
Icon for Altostratus rankAltostratus
May 15, 2014

How do I create a custom HTTP response on ASM default respond call

I have enabled "Trigger ASM iRule Events" in the ASM policy properties.

 

Now I want to create a iRule that intercepts default response on a ASM blocking response and responds a different HTTP:status in place of the default 200 OK.

 

Is there anyway I can do that on "ASM_REQUEST_BLOCKING" event via the header replacement.

 

I want to insert the original HTTP status in place of the default reponse page status

 

3 Replies

  • You can change default responce page and it's status via: Security/Application Security/Blocking /Response Pages/Default Response Page/Custom Response

     

    • Moinul_Rony's avatar
      Moinul_Rony
      Icon for Altostratus rankAltostratus
      Thanks Vitaliy, What I require here is to customize the response of HTTP 200 OK and replace this with the original HTTP response code returned from the server. Such as 403 .. Can we manipulate the default response HTTP 200 OK.. From "request log" I can see each default response have a Response "N/A" .
  • Actually, Vitaliy is absolutely correct. Under Security - Application Security - Blocking - Response Pages, select "Custom Response" as the Response Type and change the HTTP status code and headers in the Response Headers block. Example:

     

    HTTP/1.1 403 Forbidden
    Cache-Control: no-cache
    Pragma: no-cache
    Connection: close

    You can leave the Response Body section as is, or modify as required.