Forum Discussion
Hi Tiyagu,
Can you test this and investigate logs?
when HTTP_REQUEST {
log local0. "referer status: [HTTP::header exists Referer] | clientip: [IP::client_addr] | uri: [HTTP::uri]"
if { [HTTP::header exists "Referer"] and not ([HTTP::header value "Referer"] contains ".abc.com") } {
log local0. "referer header found | uri: [HTTP::uri]"
HTTP::respond 400 content "Bad Request" Content-Type "text/html"
}
}
Thiyagu
Dec 17, 2020Cirrus
Thanks a lot eaa.
As a plan B I have also worked on the below iRULE. Could you please correct me if I' missing something ?
------------------------------------------------
when HTTP_REQUEST {
switch -glob [HTTP::header "Referer"] {
"*.abc.com/*" {
# Allow Request to go through...
}
"" {
HTTP::respond 400 content "Bad Request" Content-Type "text/html"
}
default {
HTTP::respond 400 content "Bad Request" Content-Type "text/html"
}
}
}
------------------------------------------------------------
Thanks a lot in advance
Regards,
Thiyagu