Forum Discussion
ASM Custom Violation for ICAP Scanning
Hello Folks,
I recently started building ICAP AV Scanning configurations on F5 LTM. Looks like most of it is pretty easy to configure following some docs on support site.But the blocker is, i'm trying to Raise a violation using iRules and ASM custom violations. Please see iRule below
when ADAPT_REQUEST_RESULT {
log local0. "ICAP response is [ADAPT::result]" if { ! ([ADAPT::result] contains "modify") } { set icap_blocked 1 ADAPT::result bypass } else { set icap_blocked 0 } } when ASM_REQUEST_DONE { if { [info exists icap_blocked] && $icap_blocked == 1 } { ASM::raise ICAP log local0. "Raising custom ASM Violation." set icap_blocked 0 } }So far, scanning the files and allowing or blocking the request is working just fine. When it comes to raising a custom violation to the user when a malicious file is uploaded, i'm not seeing any response pages i set on ASM.
Please see the procedure below:
1.Configured AV Scanning following the document(link above) 2.Created a security Policy on ASM with Blocking enforcement mode(Security->Application Security->Security Policies) 3.Created a custom violation under Security->Options->Application security -> Advanced Configuration -> Violation list->User-Defined Violations->create. See below
Now, Created a blocking response page under Security->Application Security->Blocking->Response Pages See below
Response Headers:
HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Connection: closeResponse Body:
Request RejectedThe requested URL was rejected. Please consult with your administrator.
Your support ID is: <%TS.request.ID()%>
After assigning iRule to the ICAP Virtual server, I uploaded a virus file from a web portal that points to ICAP Virtual IP, and its being blocked. But i'm not seeing the response page i created.
Any help is much appreciated! Thanks
I know this is too much information. Just thought it would help someone in future . I appreciate your patience 🙂
are any of the log lines shown?
i do believe you could do this with ASM only, is there a reason you are using both the LTM part and the ASM part?
- P_KAltostratus
I think there is a file size restriction on the using just ASM? So using LTM ICAP for scanning and ASM for raising the violation.
true 10mb but can be increased, how large do you want it to be?
im a little lazy, so how is your virtual server setup? do you use two?
- P_KAltostratus
With the current setup we are able to upload 25Mb files which is fine.
To your question,
you took your iRule from this question?
¬â€
https://devcentral.f5.com/s/feed/0D51T00006i7axmSAA
¬â€
have you walked through all the other things mentioned there? which tmos version?
¬â€
what does the ASM event viewer show? is the custom violation set to block?
¬â€
- P_KAltostratus
Yes i took the iRule from above link and followed different others to configure.
and the event log? doesn't it log a blocked event?
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