Manoranajn_3164
Apr 06, 2017Nimbostratus
Custom Response to disallowed geo location
Hello
So, I have been trying to create an iRule that can enable me to present a custom response in case a user access application from a disallowed geo-location, but its not working. following is the iRule that i have created.
when ASM_REQUEST_BLOCKING
{
set x [ASM::violation_data]
set activeViolation 1
for {set i 0} { $i < 7 } {incr i} {
switch $i {
0 { log local0. "violation=[lindex $x $i]" }
1 { log local0. "support_id=[lindex $x $i]" }
2 { log local0. "web_application=[lindex $x $i]" }
3 { log local0. "severity=[lindex $x $i]" }
4 { log local0. "source_ip=[lindex $x $i]" }
5 { log local0. "attack_type=[lindex $x $i]" }
6 { log local0. "request_status=[lindex $x $i]" }
}}
if {([lindex $x 0] contains "ATTACK_TYPE_OTHER_APPLICATION_ACTIVITY")}
{
log local0. "ATTACK_TYPE_OTHER_APPLICATION_ACTIVITY detected, let's customized reject page"
set response "Request Rejected PageSorry,\
access to this site is restricted."
ASM::payload replace 0 0 ""
ASM::payload replace 0 0 $response
}
}
Can Somebody have a look and let me know what is wrong with this iRule
Thanks Manoranjan