Forum Discussion

Preet_pk's avatar
Preet_pk
Icon for Cirrus rankCirrus
Jan 17, 2022

Multiple ASM policy applied on Virtual Server

Hi,

 

We have a F5 design were single Virtual Server (VIP) is pointing to multiple application on back-end via iRule & iRule load balancing is based on HTTP::host (Layer 7)

 

for eg:

 

when HTTP_REQUEST {

   switch [string tolower [HTTP::host]] {

      a.test.ae {

           pool a_test_Pool1}

      b.test.ae {

           pool b_test_Pool1 }

       }

   }

 

We have a requirement to apply ASM policy on specific application (for eg: application "a") - while enforcing ASM policy specific to application "a" & applied on Virtual Server, will application "b" break? if so, please let me know what will be the best approach in this scenario.

 

  • You can apply the ASM policy in your irule when you select the pool. You'll want to enable the policy for the pools that need it and disable it on the pools that dont.

    https://devcentral.f5.com/s/question/0D51T00006i7jvy/apply-asm-policy-through-irule

    Your code should look something like this:

    when HTTP_REQUEST {

       switch [string tolower [HTTP::host]] {

          a.test.ae {

               pool a_test_Pool1

    ASM::enable "/Common/<asm Policy name>"}

          b.test.ae {

               pool b_test_Pool1

    ASM::disable}

           }

       }