Forum Discussion
Jack_Anderson_3
Nimbostratus
Oct 06, 2009URL Whitelist
I'm looking for an irule which will allow a host IP or network to access only specified url's through a proxy server. The LTM is sitting between the client PC's and the squid proxy servers and is doing SNAT on the source IP's.
- hoolio
Cirrostratus
You could potentially do this on LTM, but it might be easier to do on Squid. You could configure LTM to strip out any existing XFF instances and then insert its own X-Forwarded-For header in the HTTP profile and then configure Squid to perform the destination URI (or path) and/or IP based restrictions. To do this, you'd configure a custom HTTP profile with the "header to erase" option as "X-Forwarded-For" and the "Header to Insert" option as "X-Forwarded-For: [IP::client_addr]".when CLIENT_ACCEPTED { Check if client IP address is in the hosts_to_restrict datagroup if {[matchclass [IP::client_addr] equals $::hosts_to_restrict]}{ Client was in datagroup set check_path 1 } else { Client was not in datagroup set check_path 0 } } when HTTP_REQUEST { Check URI if the client IP was in the datagroup if {$check_path}{ Check if path is not in whitelist datagroup if {[matchclass [string tolower [HTTP::path]] equals $::allowed_paths]}{ Drop request? drop Reject TCP connection? reject Send HTTP response? HTTP::respond 401 } } }
- The_Bhattman
Nimbostratus
Another option is to deploy pac files. They can control where the client can go w/o relying on the iRule. The pac file would be processed by the client.
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