VRI_341747
Apr 05, 2018Nimbostratus
Access Control to URI based on IP with logging
I found a script to block access to a URI based on IP address list and modified it to allow multiple URI. I need to some way add logging so I can see what IP addresses are getting blocked. If anyone has a better script, I'm open to suggestions. I'm very new to iRules so any help is much appreciated.
Here's the script
when HTTP_REQUEST {
if { [class match [HTTP::uri]] equals ibp-uri } then {
if { [class match [IP::client_addr] equals ifbyphone] } then {
Let the request pass...
} else {
HTTP::respond 403 content "Access Denied"
}
} else {
Let the request pass...
}
}