You can configure regular expressions in certain types of match objects for use in App Rules policies. The Match Object Settings page provides a way to configure custom regular expressions.
This article describes how to use Match Object type HTTP URL with custom regular expressions and then to create a matching App Rule policy to block file downloads from a website.
These are the example I use here. These are for blocking downloads of files with extensions PDF and EXE from cnet.com and microsoft.com. You could change the expression to match the website and the file extension you wish to block.
Create Match Object for URLs to be blocked
1. Login to the management interface of the SonicWall UTM appliance
2. Navigate to the Firewall | Match Objects page.
3. Click on Add New Match Object to open the Add/Edit Match Object window.
4. Enter a name for the match object. For example,File Downloads
5. Select HTTP URL under Match Object Type
6. Select Match Type as Regex
7. Set Input Representation as Alphanumeric
8. Under Content, enter the URL with regular expressions of the page you want to block. See examples above.
9. Click on Add after each entry.
10. Click on OK to save.-kA1VN0000000MYY0A2-0EMVN00000EoFCZ.png)
Create App Rules policy
1. Navigate to the Firewall | App Rules page.
2. Enable the check-box Enable App Rules.
3. Click on the Add New Policy button to open the Edit App Control Policy window.
4. Set the App Rules policy with the following values:
5. Click on OK to create this policy.
Testing:
From a host behind the SonicWall, try to download an EXE file from cnet.download.com or a PDF file from microsoft.com. When the request is blocked the webpage will fail to load and the following log messages will be generated in the SonicWall logs.