iRule to restrict public users to a specific service URI, whilst allowing internal users to access anything they like (along with
Hi All,
First post, and i'm a relative newbie when it comes to iRules, so any assistance would be much appreciated.
I have a single VS that accepts connections from both public customers and internal service users, and i've had a request to stop Public users from accessing anything other than www.test.com/SelfService, whilst allowing internal users access to everything.
On top of the URI filtering/redirects required above, the requester also wants all requests (both public and private) to be redirected to HTTPS.
I thought that something along the lines of the below might work, but the iRule editor bombs out and my test LTM's (running TMOS 11.5.3) also aren't happy, so i'm looking for suggestions on how best to achieve the requirements listed above.
Suggested iRule
when CLIENT_ACCEPTED { if { [class match [IP::client_addr] equals DataGroup_PRIVATE_IP_ADDR] } then { set untrusted_clients 0 } else { set untrusted_clients 1 } } when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals “test.com” } then { set low_uri [string tolower [HTTP::uri]] if { $untrusted_clients } then { HTTP::redirect "https://test.com/SelfService” } else { HTTP::redirect "https://test.com/[HTTP::uri] }
Your assistance would be much appreciated, as currently i'm pulling my hair out with this one.