For a webservice we have to give clients access to a specific uri, but only from a specified list of ip adresses. So access to www.site.foo/uri1 only from 1.1.1.1 and 1.1.1.2 and access to www.site.foo/uri2 only from 2.2.2.1 and 2.2.2.2. And that for 106 uris and about 10 ip adresses per uri.
Is there a best practice for this? Using an iRule? Or using an access policy? Any idea is more than welcome.
I think you would have to identify some kind of pattern in order to see if you can have a simplified iRule. As a general suggestion, datagroup containing IP addresses can be used to match on client IP.
If there is only 1 IP or a single network, you can try to leverage the key:value aspect of the datagroup and use something like this “1.1.1.1:=/uri1” i.e., identify the allowed uri based on the matched key (IP Address).
If you know any geographic information of the client IP, you can explore the whereis option in iRule.