Forum Discussion
Born_7758
Nimbostratus
Jun 14, 2011Filtering a list of URLs
Hello Everyone, To start off, I'd like to mention that I am pretty new at this F5 business (been reading on it for about 2wks). I am trying to find the best way to filter a lis...
hoolio
Cirrostratus
Jun 14, 2011Hi,
Welcome to the forums. If you want to create a whitelist of allowed URIs, you could add them to a string datagroup (in the GUI under Local Traffic >> iRules >> Datagroup tab >> Create. You could then use the class command to look up the current path against the datagroup. If the requested path isn't in the datagroup, you could send a 200 response with content.
Here is the datagroup as it would appear in the bigip.conf:
class whitelist_paths_class {
{
"/cardPayMatrixSvc/cardPayMatrixSvc.svc"
"/mailSchedulingServices/mailSchedulingService.svc"
}
}
And here is an example iRule to do the lookup:
when RULE_INIT {
set static::block_html {Access denied!}
}
when HTTP_REQUEST {
if { not [class match [HTTP::path] equals whitelist_paths_class]}{
HTTP::respond 200 content $static::block_html
}
}
Aaron
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