Apply ASM policy through iRule
I know that I have asked questions about using iRules to apply ASM policies in the past, but I am running into some issues. Just some background, our Load Balancing team is telling us that they need to reduce the amount of VIPs (Virtual Servers) being used and their new plan is to use a single VIP for multiple apps and then use iRules to just send the traffic to the correct pool. This seems to work just fine until I get a request to add an ASM policy to protect the app.
I have setup a lab where I can test some things to learn how the best way to apply these ASM policies to the multiple apps. I am running into an issue now where I get some kind of error when trying to add the ASM::enable "policy name" command to the iRule. I get this when trying to save the iRule:
requires an associated WEBSECURITY profile on the virtual-server
From what I can tell, it wants me to assign an ASM policy to the virtual server and then I am guessing I change which policy gets applied through the iRule. Is this correct or is there something else that I can do to get this working in the iRule?
My concern is that if I need to apply a default ASM policy to the Virtual Server, this will affect all the other apps that are getting directed in the iRule. Any suggestions or knowledge would be great.