17-May-2022 15:14
Guys I really need your help. Im currently working on a request. Lets say i have the below URL
https://abd.com/files/jaskjaskjsakjasjk.jpg
Customers are asking me to disable anything that comes after the /files that has an image extension like jpg, pdf and png, from anyone communicating from the outside, except for internal IPs and Several domain like amazon, twitter, should have access to the above URL.
I had some luck on confguring it on the LTM policies section, but i couldnt match the domain. So is there an irule which will work on this.
18-May-2022 10:19 - edited 18-May-2022 10:20
Hi @mj16othman,
you could use this iRule.
when HTTP_REQUEST {
if { [string tolower [HTTP::host][HTTP::path]] starts_with "abc.com/files" } {
switch -glob [string tolower [HTTP::path]] {
"*.gif" -
"*.jpg" -
"*.jpeg" -
"*.png" {
# Drop if URI ends with a static file type
drop
}
default {
return
}
}
}
}
If you want to filter by source IP, I would do this inside the switch statement with a datagroup matching.
However... how will you get all the IP addresses from Amazon, Twitter and so on?
KR
Daniel