Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 

Multiple ASM policy applied on Virtual Server




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:



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

           pool a_test_Pool1} {

           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.



Hi  ,


If ASM policy has set any blocks/drops which matches traffic pattern coming for "application b" then yes, it will disturb that traffic also. So best approach would be applying ASM policy to specific or desired HOST URL only where you want to have it. You can achieve same using LTM policy.


Create LTM policy where under condition you can match HOST that you want to match for enabling ASM policy and then under actions -

ENABLE --> ASM --> Select desired ASM policy


Once you apply above LTM policy on the vServer, ASM policy will get applied to traffic coming for given host only.


Hope it helps!





you can do that using LTM policy then attach many of ASM policies pointing to the specific host name even you are using single VIP





[editors note] moved this thread from a duplicate question.


applying ASM policy at virtual server level means that both application traffic will be seen by WAF:

  • Traffic learning will also show suggestions for in policy tuning
  • When policy is set to blocking state, traffic directed to will also be checked and will trigger protections, resulting in possible blocks.


iRule tool can manage ASM policy assignment.

I remember from installations I've performed, that you require an ASM policy to be applied at virtual server leve, regardless. You need to perform this task before modifying iRule or ASM instructions won't be accepted.


In your scenario, to prevent application to be checked by WAF, I'd just add an ASM::disable string instruction:

when HTTP_REQUEST { switch [string tolower [HTTP::host]] { { pool a_test_Pool1} { ASM::disable pool b_test_Pool1 } } }

Hope this helps


You can also use the current irule with the ASM:Enable command and following the article below:



Still better to use local traffic policy that matches the HTTP hostname and assigns the specific ASM policy as this is more optimal than irules:


You have opened the same question many times, please close the duplicate questions as it not a good example.