Forum Discussion
URL access based on IP\LDAP
Im new to F5 ASM so I apologize for my ignorance in advance. Is it possible to create an IRule to allow access to a webpage based on IP adresses and\ or LDAP group?
I see this as an example but not sure how to add multiple IP addresses and I dont want a redirect. Any help is appreciated.
when HTTP_REQUEST { if { ([HTTP::uri] starts_with "/admin") and ([matchclass [IP::remote_addr] equals $$IPAddressDataGroup]) } { HTTP::redirect "https://foo.com/admin/index/index/" } else { HTTP::redirect "https://foo.com/login/index/login/" } }
- Chris_Miller
Altostratus
It's definitely possible. In that example, you're using a data group. You can add addresses to a data group from the config utility through Local Traffic Manager > iRules > Data Groups. - tacobell_112236
Nimbostratus
Actually I want to limit access via ASM not LTM and only to a web site . - Chris_Miller
Altostratus
As far as blocking by IP goes, I've seen most people do so via LTM iRules...I'll see whether there's an option in ASM but don't recall seeing one. Any reason you're trying to avoid using LTM? - hoolio
Cirrostratus
I don't think current versions of ASM allow you to restrict access by client IP, subnet or GeoIP region, etc. I'm pretty sure there is at least one request for enhancement related to this type of functionality. You could open a case with F5 Support and have your request added to the existing RFE(s). - hoolio
Cirrostratus
Note that I like the second option better as ASM can normalize URI encoding attacks much better than we can with an iRule. This is particularly relevant if the web app is IIS based: - tacobell_112236
Nimbostratus
No its not using IIS...but after thinking about it - why not just use the LTM as you suggested...
- Chris_Miller
Altostratus
You have a great start! - tacobell_14395
Nimbostratus
Sorry for the delay...basically i need to redirect certain externally accessible sites to internal network only. And if you are not part of the IP adress redirect you to home page. This needs to be done at F5 level... So question is how do I add multiple sites to check???
- hoolio
Cirrostratus
You can add multiple URI checks using a switch statement. - tacobell_112236
Nimbostratus
I read it and I said "que??"..............care to send me what I have posted (example) so I can comprehend please??
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