Forum Discussion
jondyke_46152
Nimbostratus
Jun 26, 2008Access Control Based On IP for specific URL
I am pretty new to irules so any help here would be appeciated. The irule below is the deafult irule for Access control based on IP from the codeshare area. Is it possible to alter this so that it c...
Andy_Herrman_22
Nimbostratus
Jun 30, 2008Small tweak to the iRule to handle case properly:
when HTTP_REQUEST {
if { ( [matchclass [string tolower [HTTP::uri]] starts_with $::securePaths] ) and
! ( [matchclass [IP::client_addr] equals $::trustedAddresses] ) }
{
log local0. "Untrusted IP ([IP::client_addr]) attempting to access secure path ([HTTP::uri])"
discard
} else {
log local0. "Allowing connection from [IP::client_addr] to [HTTP::uri]"
forward
}
}
I have it converting the path to lowercase. This handles people trying to go to:
http://yourdomain.com/TeStInG
or other variants to try and get around your filtering. As long as you always use lowercase when defining entries in the datagroup you'll be good.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
