Forum Discussion

Kuldeep22's avatar
Kuldeep22
Icon for Altostratus rankAltostratus
May 06, 2024

URL

Could you please help to check if any cookies or header can be applied from WAF end for the url https://abc.com.

We need to apply few rules in WAF and application for redirecting certain users to specific server and few to other servers.

4 Replies

  • Could i achieve this by using local traffic

    Could you please help to check if any cookies or header can be applied from WAF end for the url https://abc.com.

    We need to apply few rules in WAF and application for redirecting certain users to specific server and few to other servers.

    • zamroni777's avatar
      zamroni777
      Icon for Cumulonimbus rankCumulonimbus

      you can apply the cookies using irules or local traffic policy assigned to the ltm virtual server related to the asm/waf profile

  • Hi Kuldeep22,

     

    sure, you can do this with iRules:

    when HTTP_REQUEST priority 500 {
        if { [HTTP::cookie exists "Name_of_your_Cookie"] } {
            ASM::disable
            pool name_of_your_pool
        } else {
            ASM::enable "/Common/name_of_your_ASM_policy"
            pool name_of_your_other_pool
        }
        
    }

    This iRule will check if a cookie with the name Name_of_your_Cookie exists. If yes, it will disable ASM and assign a pool. If no, it will enable a specific ASM policy and assign a different pool.
    Of course this is just a suggestion, with iRules the sky is the limit for such use cases.

    Probably you can also do this with Local Traffic Policies. But I don't use them a lot, so I cannot tell you how that would look like.

     

    KR
    Daniel