Blocking Upload of Webmail Attachments using Application Firewall

Description

This article describes the method to block uploading of email attachements in webmail. This method uses the HTTP Request Custom Header option in Application Firewall Objects. HTTP Request Custom Header field allows users to configure HTTP request headers and their respective values for Application Firewall to filter traffic. For more info on HTTP Headers refer RFC 2616.

The method we use here is the HTTP Request header "Content-Disposition". The Content-Disposition header field contains the disposition-type and disposition-parm (parameter). The following screen-capture shows the wireshark capture of a webmail attachment upload in gmail.com.

NOTE: Although the solution described here has been tested, there is a possibility that it may affect traffic other than webmail. Client DPI-SSL required, if using HTTPS.

 

Resolution

Here's how to block the upload of email attachements in webmail:

  1. Login to the SonicWall Management GUI.
  2. Go to Firewall > Match Objects.
    • In SonicOS Versions earlier than 5.8.0.0, this menu is located under Application Firewall > Application Objects.
  3. Click on Add New Object and enter the following information:
    • Object Name: Attachment
    • Match Object Type: HTTP Request Custom Header
    • Custom Header Name: Content-Disposition
    • Match Type: Partial Match
    • Input Representation: Alphanumeric
    • Content: filename=

      Image

  4. Go to Firewall > App Rules.
  5. Check the box under Enable App Rules.
  6. Click on Add New Policy and create the following policy:
    • Policy Name: Block Attachment
    • Policy Type: HTTP Client
    • Service: HTTP
    • Match Object: Attachment
    • Action Object: Reset/Drop
    • Connection Side: Client Side
    • Direction: Basic, Both

 Image

 

Related Articles

  • SonicOS 8.1.0 FAQ
    Read More
  • SonicWall GEN8 TZs and GEN8 NSas Settings Migration
    Read More
  • Getting started with SonicWall firewalls
    Read More
not finding your answers?