Forum Discussion
Albert_252822
Aug 22, 2016Nimbostratus
ASM iRule events not working
Hi all,
I activated this irule in my Virtual Server:
when HTTP_REQUEST {
set redirect 0
set requri [HTTP::uri]
}
when ASM_REQUEST_BLOCKING {
set redirect 1
}
when HTTP_RESPONSE {...
Hannes_Rapp
Nimbostratus
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_252822
Aug 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)
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects