Allowing a user-agent by iRules

Hi All,

I do not want to white-list an IP address as it is dynamic, but this dynamic IP address is pen testing our network.

Thus i want to allow a specific user-agent to be able to bypass the ASM policies for pen testing.

Will the below irule do the job?

when HTTP_REQUEST { if {[HTTP::header “User-Agent”] contains “MyAgent_Allow” } { return } else { drop } }

Regards

Hussein

an update to the iRule: when HTTP_REQUEST { if {[HTTP::header “User-Agent”] contains “MyAgent_Allow” } { asm::disable } else { asm::enable } }

You can use Local Traffic Policies in order to achieve just that, if you want to avoid iRules.

Hi Hussein,

the

{ asm::disable } else { asm::enable }

iRule looks valid to me. So it should work… :wink:

Cheers, Kai

Can i do something like IP whitelising to the user-agent, in order not to disable the ASM.

Please can you update if this worked.. we have a similar situation for a pen testing

when HTTP_REQUEST { if {[HTTP::header “User-Agent”] contains “MyAgent_Allow” } { asm::disable } else { asm::enable } }