Forum Discussion
saidshow_251381
Jul 26, 2017Cirrostratus
Geoblock exception based on user agent
Hi,
We have Geo-blocking enabled for one of our apps and want to allow access from a third party tool that has a very specific user agent. Is it possible to allow requests from a geo blocked loc...
samstep
Jul 30, 2017Cirrocumulus
You can do it with an iRule which checks the User-Agent Header to be the one you want to white-list and then unblocks that request using ASM::unblock
Here is a sample iRule (replace 'My Magic User Agent' with User-Agent you need):
when ASM_REQUEST_DONE {
foreach {viol} [ASM::violation names] {
if { $viol eq "VIOLATION_ILLEGAL_GEOLOCATION" } {
if { [HTTP::header "USER-AGENT"] contains "My Magic User Agent" } {
ASM::unblock
}
}
}
}
Hope this helps,
Sam
P.S. Remember to enable 'Trigger ASM iRule Events' in your policy properties!
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