Loading....

Unified Cloud Edge: Blocking webpages with regex

Unified Cloud Edge (UCE) by default does not have wildcard expressions. So in a URL block list there is no option to block a domain with all extensions. For example with an on premise proxy you would use a wildcard to express anything after i.e.: bbc.*

Rule creation

You can follow these steps in order to create a custom rule:

1. First please create a new List in the “Lists Catalog” for type “Regular expression”:

Call it GlobalBlockRegex and add a new item:

  • bbc.*.

Make sure to save and then Publish changes.

Then load the policy page and add this line in the main Global Block code view:

Add the following inside the brackets:

INCLUDE “Global_Block_Lists_regex”

This creates a new rule inside the “Global Block”, of course you may have chosen to add the custom rule to another rule.

Click on the new rule and copy in the following code:

Global_Block_Lists_regex ON (Web.Request, Web.Response) [enabled="true"]{ //       Global_Block_Lists_regex
RegExJSi.List GlobalBlockList = list_GlobalBlockRegex
// Block all matches
IF GlobalBlockList.Matches (MWG.Url.ToString) THEN {
STRING customBlockPage_Message = "Global Block."
STRING customBlockPage_Reason = "Blocked due to url on block list."
MWG.Block (McAfee_Custom_Block_Page, "Global_Block_Lists_regex", "URL Filtering Policy")
}
}

use custom rule

Feel free to edit the customBlockPage_Message & customBlockPage_Reason.

Summary

In this article we discussed how to block different extensions for URL hosts so we can block bcc.co.uk and bbc.com using one regex match.

 Unified Cloud Edge  
Total 0 Votes:
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Back To Top