unblock
18 TopicsASM issue, need to return HTTP 500 to client in certain cases
I've written a script that captures the "Content-Type" header from requests. In the event that ASM blocks the request, I need to respond to the client with one of three types of responses (I'm using the ASM_REQUEST_BLOCKING event): If Content-Type = text/xml then send back a SOAP error with HTTP 200 If Content-Type = application/json then return HTTP 500 All others return the default ASM response with HTTP 200. Cases 1 & 3 are handled, but I can't figure out how to force an HTTP 500 status to be returned to the client. HTTP_RESPONSE doesn't fire when ASM blocks. Thanks for your advice.Solved4KViews0likes6CommentsASM: "Illegal Request"
I have come across a weird problem. A user access was blocked, with a support ID displayed. After searching the event log withe the support ID, I found that there was no learning suggestion for the access request, and I could not "accept" the request: the text shown when having the mouse over the grayed-out button of "Accept" was "there was no violation". I had to configure "never block this IP address" to allow the request through. And the log entry showed that this was an "illegal" request. Is there a way to allow an "illegal" request through in this situation? The IP address based solution is only temporary as the user was on a dynamic address.1.8KViews0likes3CommentsTurn off File type check for a specific URL
Hi, we have some dynamic urls that from time to time will include a fullstop. Is is possible to disable only the illegal file type check for uris that start with "/foo/foo1/"? I would not want to disable ASM entirely, just the illegal file type check. Or if there is another way to deal with this scenario to prevent client selections with fullstop in it from being interpreted as an illegal file type, it would be great to hear how others are working with this type of scenario. Thank you.Solved1.4KViews0likes6CommentsException for GeoBlocked Country. Without Allow-Listing a specific IP
We are geo-blocking users from China, but some users are trying to ship goods and needs to see access certain guidelines regarding the types of goods that are allowed. The security policy that governs access to this application also applies to several other applications. I am concerned that allow-listing the specific IP addresses of those users could potentially open up a security loophole. We are in a bit of pickle and exploring the best way to address this issue without compromising security protocols. Any suggestions would be appriciated. I tinkered and composed this iRule. I am uncertain about the last part... (ignore private.url as I don't want to post it publcily here) when CLIENT_ACCEPTED { # Initialize a variable to hold the block status set blocked_ip 1 } when HTTP_REQUEST { # Check if the request is for the specific full URL and the client is from China if { ([HTTP::host] equals "private.url") and ([HTTP::uri] equals "/substances-search/Substance?lang=en") and ([whereis [IP::client_addr] country] equals "CN") } { # Tentatively allow access, pending the ASM check set blocked_ip 0 } } when ASM_REQUEST_DONE { # Check if the request is blocked by ASM if { [ASM::status] eq "blocked" } { # If it's due to geolocation and the specified conditions are met, unblock if { [ASM::violation names] contains "VIOLATION_ILLEGAL_GEOLOCATION" and $blocked_ip == 0 } { ASM::unblock log local0. "[ASM::violation_data] unblocked for [IP::client_addr]" } else { # For other violations, ensure the request remains blocked set blocked_ip 1 } } } when HTTP_RESPONSE { # If the block status is true, respond with a 403 Forbidden if { $blocked_ip == 1 and [ASM::status] eq "blocked" and ![ASM::violation names] contains "VIOLATION_SQL_INJECTION" } { HTTP::respond 403 content "Access denied" "Content-Type" "text/plain" "Connection" "close" } }Solved985Views0likes2CommentsHow could I exclude Vulnerability scanners from Session Tracking?
I have enabled session tracking on an application and it has quickly blocked my vulnerability scanner. Of course this is "scan interference" and makes the results invalid. The options on the IP Address Exceptions page allow me to "Never Block" the IP , but then I get false results and ASM is not providing any protection. Because I've seen that when blocked by Session Tracking the other violations were still recorded in the logs I thought this may work as an iRule when ASM_REQUEST_DONE { if { ([ASM::violation count] equals 1) && ([ASM::violation names] eq "VIOL_SESSION_AWARENESS") && ([IP::addr [IP::client_addr] equals n.n.n.n]) } { ASM::unblock } } But it didn't, the connections were still blocked when the session tracking count was reached. Can anyone suggest something to try next?Solved922Views0likes6CommentsASM::unblock not working for specific violation
Hello there, I set an iRule for ASM that should unblock a specific violation: when ASM_REQUEST_DONE { set asm_support_id [ASM::support_id] if { $uri starts_with "/my/uri" and [ASM::violation names] contains "VIOL_ENCODING" } then { ASM::unblock } } This rule is not triggered for that specific violation. What am I missing? I would also like to point out that if I remove the second part of the IF and leave just the uri match, the rule triggers just fine. I am 100% sure the violation I am targeting is correct. Any clues on what is wrong with it? Thank you!879Views1like6CommentsCMS causing False Positives
Hello, I am recently seeing many false positives relating to CMS (Kentico EMS) on one of my F5 ASM policies. As it is CMS and marketing department would be editing web sites etc. we are seeing many requests being blocked due to various injection attack signatures. The users, and app developers, are getting frustrated with the amount of false positives. Is there any recommended set up such as which attack signatures to include in the learning and blocking settings for CMS? Trawling through the traffic learning it's hard to determine which attack signature suggestions to disable as difficult to ascertain which as true false positives and which are actual injection attempts. We are running a manual policy.Solved806Views0likes1CommentiRule to allow HTTP Error code through ASM policy
Hello, I have an ASM policy applied to a virtual server. The ASM policy is configured to block HTTP 500 response codes. I would like to write an irule that would allow HTTP 500 to be returned to clients that are in a pre-defined Data group list. when HTTP_RESPONSE { if { [HTTP::status] eq "500" } { if { [class match [IP::client_addr] equals DATA_GROUP_LIST] } { commands to allow HTTP 500 response } } I'm actually trying to figure out if this is even possible. or are response codes all-or-nothing when enforced via an ASM policy? Any help would be greatly appreciated. Thank you. ChrisSolved737Views0likes2Commentsallow one url from blocks geolocation
i have published service from waf and i block urls on all country except KSA and i have one url allowed from aruba i used below i rule but its didn't work hen HTTP_REQUEST { if { ([string tolower [HTTP::uri]] eq "GET /Arabic/MediaCenter/News/Pages/Infectious-Disease-Week.aspx HTTP/1.1") and ([whereis [IP::client_addr] country] ne " Sweden") } { ASM::unblock } else { return } }Solved720Views0likes4Comments