Forum Discussion

Saidur900's avatar
Saidur900
Icon for Nimbostratus rankNimbostratus
Aug 27, 2023

IRULE to restrict a specific url after initiated first session

Dear All

I need help to make an irule for a reason.

A and B both are clients. A is initiated a session from his device. A has an API result with some information with "xxx.com/api/info". After getting the result, the same result link is shared with B, and he is getting the same output. Here I need to restrict user B, if he gets the link, then the connection will drop. 

I suspect it might work if I can detect the device ID and the session ID is mismatched after initiating the traffic.

Can anyone please provide me with a solution to this? It would be very helpful to me.

Thanks in advance.

6 Replies

  • Hello Saidur900 , 

    you can create an iRule or LTM policy has two conditions ( Source ip of user B & uri >> "xxx.com/api/info" ) 
    and take action of dropping. 

    I see that device id is not suitable as it forces you that user A and B must run the injected java script in bigip first response to create device id in bigip. 

    I believe that you need a static identifier for user B such as static ip address for it. 

  • Hi Mohamed Kansoh

    Thanks for your reply.

    Actually, I don't want to restrict any static identifier. I don't know how to do it, but the requirement is, when first Client A, is already served with the URL. Then any other device shouldn't get access with that same URL. Note that, the URL is not static either, it generates some random numbers such as "xxx.com/api/info/ms1672635"

    • Hi Saidur900 , 
      no worries about changing in URI as you can use "starts_with" or "contains" operators if your uri not static. 

      So now your requirement is , 
      you need only one connection in bigip to access this URI and anyother connection requests this uri should be dropped regardless Client A or B , you only need this URI to be accessed onetime for only exclusive connection through bigip , and if this connection fininshed or timeout , it's allowed for any client to access it. 
      So one connection to this URL at a time ? 

      • Saidur900's avatar
        Saidur900
        Icon for Nimbostratus rankNimbostratus

        Hi Kanosh

        Yes, single connection to this url at a time. This url contains sensitive information, so need a solution. I dont understand where to start.