Forum Discussion
ASM iRule events not working
Have not tested, but in theory, this should do what you want:
when ASM_REQUEST_DONE {
if { [ASM::status] equals "blocked" } {
switch -glob [string tolower [HTTP::path]] {
"/url1*" {
ASM::unblock
HTTP::respond 302 Location "https://url1/index" Connection Close
}
"/url2*" {
ASM::unblock
HTTP::respond 302 Location "https://url2/index" Connection Close
}
"/url3*" {
ASM::unblock
HTTP::respond 302 Location "https://url3/index" Connection Close
}
default { }
}
}
}
- Albert_252822Aug 23, 2016Nimbostratus
Hi Hannes, thanks for your help.
I tested this irule replacing my whole irule and it doesn't work. I have the same result, after a violation I see the ASM Default Response Page.
I'm sure I'm missing something but I can't find it. My ASM Security Policy has "Trigger ASM iRule Events" enabled and "ASM iRules Event Mode" in Normal Mode. I also have the Default Response Page configured (code 200 - OK)
- Hannes_RappAug 23, 2016Nimbostratus
I can just recommend to check /var/log/ltm - are there any iRule processing tcl errors? Make sure this iRule has priority by moving it first in the list of order, or use the 'priority' function.
Also note that if possible to invoke a redirect from ASM_REQUEST_BLOCKING event, rather use the sample Stanislas posted. This possibility varies across BigIP versions.
- Albert_252822Aug 23, 2016Nimbostratus
My original irule is not showing any errors on logs. Although is not working properly, there aren't syntax errors:
info: ASM blocking
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com