How To Block HTTP Downloads Or Uploads Of Specific File Extensions on SonicOSX 7.0?
08/31/2020 6 People found this article helpful 186,632 Views
At times it may be necessary to block entire File Extensions from entering or leaving your network. Blocking file extensions from emails and other communication is a common practice to help prevent CryptoLocker attacks, leaking sensitive company data, and other intrusions or violation of network policy. The SonicWall can block downloads for any File Extension going over HTTP, FTP, and other unencrypted Protocols.
CAUTION: By default the SonicWall cannot block File Extensions over HTTPS or other Encrypted Protocols. This is because the SonicWall cannot examine encrypted payloads, to get around this DPI-SSL is required as a Feature on the SonicWall. Please refer to KB: How to create a Decryption Policy on SonicOSX 7.0? for details on creating Decryption policy.
We would need to create the following to block HTTP Downloads Or Uploads Of Specific File Extensions on SonicOSX 7.0.
- Creating a Match Pattern
- Creating a Custom Match object
- Creating Security Policies
Creating a Match pattern:
- Navigate to Object | Match Objects | Match Patterns tab and click on the Add button to add a new match pattern.
- Provide an appropriate name to the object and select the following details:
Match Object Type: HTTP URI Content
Match Type: Partial Match
Input Representation: Alphanumeric
- Add all File Extensions that you would like to block (".ZIP", ".RAR" and ".EXE" in this example). Use the + symbol to add multiple extensions one by one. Click on Save.
Creating a Custom Match object:
- Navigate to Object | Match Objects | Custom Match tab and click on the Add button to add a new custom match object.
- Provide an appropriate policy name to the object and select the following details:
Policy Type: HTTP Client Request
Match Object Included: Select the match pattern added earlier
Direction: Basic with drop down selected to Both as we want this for both uploads and downloads
- Leave other fields on default and click on OK.
Creating a Security Policies:
Security Policy ties together the Keyword list object, Security Rule Action so that we know what action needs to be taken for a specific match. Before an HTTP/HTTPS connection can be made, the end machine would need to perform DNS resolution of the URL. Since we have an implicit deny rule, DNS traffic needs to be allowed as well.
To create the DNS related Security Policy
- Navigate to Policy | Rules and Policies | Security policy tab and click on Top at the bottom of the screen. This adds the new Policy at the top of the list. You might need to adjust its priority based on other rules you have.
- Mention a relevant name and in the Source/Destination tab, you can select many fields like source/destination zones, address, services, and also user, geolocation settings. Select the destination Port/Services as 'DNS(Name Service)'.
- Under App/URL/Custom Match tab leave everything on defaults.
- Select the Default Profile as the Security rule action. Make sure that the Action is set to Allow and the policy is in enable state. Click on Add.
NOTE: This policy can also be created using the DNS protocol application signature, DNS service is used in this example.
To create the block file extension related Security Policy
- Navigate to Policy | Rules and Policies | Security policy tab and click on Bottom at the bottom of the screen. This adds the new Policy at the bottom of the list. You might need to adjust its priority based on other rules you have.
Mention a relevant name and in the Source/Destination tab, you can select many fields like source/destination zones, address, services and also user, geo-location settings.
Under App/URL/Custom Match, use the radio button for 'Match Operation' as OR. Also, select the pencil icon to add a new Custom Match Group.
- Give a relevant name to the group. Click on custom match object created and use the right arrow to add it to the group.
- Under Security rule action tab, select Default action. Make sure that the Action is set to Deny and the policy is in enable state. Click on Add.
EXAMPLE: Let us assume that we are visiting putty.org and trying to download the putty software which is an EXE file. Since putty.org is an HTTPS website, I would need Decryption policy created to scan through the HTTPS payload and perform block actions as configured in this security policy.
- We are going to click on the link shown on their website which is an EXE file.
- The certificate of this website is signed by the firewall which shows that the decryption policy is in effect.
- Once we click on EXE download link, the following block page shows up with information on the security policy blocking this kind of traffic.