Restricting access to a client to only access certain URI and nothing else

I have a URI https://www-uat.corpoint.be/

and then i have this also https://www-uat.corpoint.be/rest/leads/callback*

On firewall we have allowed the public IP which resolve to this URI for any source

Now on F5 I have the following requirement :

I want everybody to access https://www-uat.corpoint.be/

but i want an IP 76.3.3.3 to only access https://www-uat.corpoint.be/rest/leads/callback* and nothing else not even normal URL https://www-uat.corpoint.be/

Dears , Eagerly waiting for a response ; I am a newbie to irules

Hi,

try this:

when HTTP_REQUEST {

if { !([string tolower [HTTP::path]] starts_with "/rest/leads/callback" )
&& ( [IP::addr [IP::client_addr] equals 76.3.3.3/32] ) } {
    log local0. "dropped"
    HTTP::respond 200 content "URL Blocked"
} 
}

You can also used data group if you have multiple URI, it can help you:

Regards