Manage custom response page with Irules
Hello,
I'm trying to manage custom response page following http response code and violations.
I'm using irule in Normal mode for each policy
I don't know why but my rule don't catch anything, I used the example given by F5
First example for http 500 blocked
when ASM_REQUEST_BLOCKING {
set asm_support_id [ASM::support_id]
set client_ip [IP::client_addr]
if {[ASM::violation names] contains "VIOL_HTTP_RESPONSE_STATUS" and {[HTTP::status] == 500 }}
{
log local0. "VIOLATION_500 detected"
set response "<html>
<head>
<title>Request rejected by the server</title>
</head>
<body>
Internal error.Please contact your administrator<br><br>
Your support ID : $asm_support_id
Your ip : $client_ip
</body>
</html>"
ASM::payload replace 0 [ASM::payload length] ""
ASM::payload replace 0 0 $response
}
}
Is there something that miss
Thanks