Forum Discussion
JamesR_40280
Nimbostratus
Apr 09, 2008Restricting Access by IP to different web application
We're using a HA pair of ASM-4100 devices to secure a web application. We have a good policy for outside users that restricts access to general areas. However we also have internal staff that need access to administrative areas. We would like to allow those local users based on a class C IP address range (10.1.1.0) to access the site without the policy that is used by other users. I have tried enabling X-forwarded-for on the http class on the Virtual Server, and then attempting to find the local IP in the host with a HTTP Class Profile that will then send them to a less restrictive ASM class, but have not had any success. I'm not sure I'm giving the HTTP Class Profile the right code in the Hosts area. I'm using (regex) X-Forwarded-For:10.1.1*.
I've also used several other combinations of regular expressions and pattern strings with no success.
Is this a reasonable approach to what I'm trying to accomplish? I've seen the iRule samples for IP forwarding to different Virtual Servers, but I want the same virtual server to send traffic to one web application versus another. Also, I'm not sure how to adopt those samples to what we're trying to do.
- hoolio
Cirrostratus
Ideally, matching on the source IP against a list of hosts/networks would be an option on the HTTP class filters. There is an existing 'request for enhancement' asking for this functionality. It would be good to open a case with F5 Support (websupport.f5.com) and ask them to attach your case to the existing request.when HTTP_REQUEST { Insert a test header value to verify it's removed by this rule (remove this after testing) HTTP::header insert name "X-Forwarded-For" value hacked_value Log the current header names log local0. "\[HTTP::header names\]: [HTTP::header names]" Remove all instances of the existing headers while {[HTTP::header exists x-forwarded-for]}{ log local0. "Current value: \[HTTP::header value x-forwarded-for\]: [HTTP::header value x-forwarded-for]" Remove the current header HTTP::header remove x-forwarded-for log local0. "\[HTTP::header names\]: [HTTP::header names]" } Insert the actual client IP address in the header HTTP::header insert name "X-Forwarded-For" value [IP::client_addr] }
- JamesR_40280
Nimbostratus
Worked brilliantly. Thank you very much for your assistance. I will enter a web case to pile on the existing 'request for enhancement'. - hoolio
Cirrostratus
That's good to hear. And thanks for opening a case for the RFE. The more requests F5 gets, the more visibility the CR gets. - Chris_Phillips
Nimbostratus
10 get ltm config request
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