Forum Discussion
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 location when the user agent matches a particular string?
Thank you.
1 Reply
- samstep
Cirrocumulus
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!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
