Change to the correct “Current edited security policy”
Create an iRule with content similar to the following (add/delete fields as needed):
when HTTP_REQUEST {
# Other HTTP values can be added here
set requri “http://[HTTP::host][HTTP::uri]”
}
when ASM_REQUEST_DONE {
set asm_support_id [ASM::support_id]
}
when ASM_REQUEST_BLOCKING {
HTTP::header remove Content-Length
HTTP::header insert header_1 value_1
set client_ip [IP::client_addr]
set response "<html>
<head>
<title>Request Rejected</title>
</head>
<body>
The requested URL was rejected. Please consult with your administrator.<br><br>
Your support ID is: $asm_support_id<br><br><a href=‘javascript:history.back();’>Go Back</a><br><br>
Your URL is: $requri<br><br>
Your client IP is: $client_ip
I think that yes, the only way is using an irule because you need to store the headers that you want to print when the event is triggered using.The custom response page only enables printing an HTML.
I am using version 15.1.5, and configured the security policy with trigger ASM irule events mode
My final goal is to acheive response page with:
1. my logo (taken from web page)
2. support ID
3.The abiltiy to send mail with all details above
This the the current custom block page Iam using, and i want to add the problematic url & path
<!DOCTYPE html>
<html>
<html><head><title>Request Rejected</title></head><body>
<p>
<img src=“https://site.domain.com/files/2018/01/F5_Logo_700x80.gif” border=“1” alt=“xxxx” width=“700” height=“80”>
</p>
<br>
The page was blocked for what seems to be a technical issue.<br><br><b>Please click the following link to notify <a href=“mailto:mail.domain?subject=support ID is: <%TS.request.ID()%>”>
Web Support</a> and make sure to include the affected URL <br><br> Your support ID is: <%TS.request.ID()%></body></html><br><br><br><br> Thank you<br> Web Support
when HTTP_REQUEST {
# Other HTTP values can be added here
set requri “https://[HTTP::host][HTTP::uri]”
}
when ASM_REQUEST_DONE {
set asm_support_id [ASM::support_id]
}
when ASM_REQUEST_BLOCKING {
HTTP::header remove Content-Length
HTTP::header insert header_1 value_1
set client_ip [IP::client_addr]
set response "<html>
<head>
<title>Request Rejected</title>
</head>
<body>
<p>
<img src=‘https://xxx.domain.zz/files/2018/01/F5_Logo_700x80.gif’ border=‘1’ alt=‘Organization’ width=‘700’ height=‘80’> ### Web page with company logo ###
<p>
The page was blocked for what seems to be a technical issue.<br><br>
Please click the following link to notify ## link to notify IT Team by mail, the mail will include support is, src ip, suspicious link##
<a href=‘mailto:mail@domain?subject=support ID is: $asm_support_id&body=The%20page%20was%20blocked%20for%20what%20seems%20to%20be%20a%20technical%20issue%0A%0ASuspicious URL: $requri%0ASource IP: $client_ip%0ASupport ID: $asm_support_id’();>IT Team</a><br><br><br>
<b>Your support ID :</b> $asm_support_id<br><br>
<b>Suspicious URL:</b> $requri<br><br>
<b>Source IP :</b> $client_ip<br><br><br>
Thank you<br> IT Team