How Does Application Control Work?

Application Control utilizes SonicOS Deep Packet Inspection to scan application layer network traffic as it passes through the gateway and locate content that matches configured applications. When a match is found, these features perform the configured action. When you configure App Control policies, you create global rules that define whether to block or log the application, which users, groups, or IP address ranges to include or exclude, and a schedule for enforcement. Additionally, you can create App Rules policies that define:

The following sections describe the main components of Application Control:

Actions Using Bandwidth Management

Application layer bandwidth management (BWM) allows you to create policies that regulate bandwidth consumption by specific file types within a protocol, while allowing other file types to use unlimited bandwidth. This enables you to distinguish between desirable and undesirable traffic within the same protocol. Application layer bandwidth management is supported for all Application matches, as well as custom App Rules policies using HTTP client, HTTP Server, Custom, and FTP file transfer types. For details about policy types, see App Rules Policy Creation .

If the Bandwidth Management Type on the Firewall Settings > BWM page is set to Global, application layer bandwidth management functionality is supported with eight predefined, default BWM priority levels, available when adding a policy from the Firewall > App Rules page. There is also a customizable Bandwidth Management type action, available when adding a new action from the Firewall > Action Objects page.

Bandwidth management can also be configured from the App Flow Monitor page by selecting a service type application or a signature type application and then clicking the Create Rule button. The Bandwidth Management options available there depend on the enabled priority levels in the Global Priority Queue table on the Firewall Settings > BWM page. The priority levels enabled by default are High, Medium, and Low.

All application bandwidth management is tied in with global bandwidth management, which is configured on the Firewall Settings > BWM page.

Two types of bandwidth management are available: Advanced and Global.

When the type is set to Advanced, bandwidth management can be configured separately for App Rule.
When the type is set to Global, the configured bandwidth management can be applied globally to all interfaces in all zones.

As a best practice, configuring the Global Bandwidth Management settings on the Firewall Settings > BWM page should always be done before configuring any BWM policies.

Changing the Bandwidth Management Type on the Firewall Settings > BWM page from Advanced to Global disables BWM in all Access Rules. However, the default BWM action objects in App Control policies are converted to the global bandwidth management settings.

When you change the Bandwidth Management Type from Global to Advanced, the default BWM actions that are in use in any App Rules policies are automatically converted to Advanced BWM Medium, no matter what level they were set to before the change.

Topics:
Default BWM Actions

When you toggle between Advanced and Global, the default BWM actions are converted to BWM Global-Medium. The firewall does not store your previous priority levels when you switch the type back and forth. You can view the conversions on the Firewall > App Rules page.

Custom BWM Actions

Custom BWM actions behave differently than the default BWM actions. Custom BWM actions are configured by creating action objects on the Firewall > Action Objects page. Custom Bandwidth Management actions, and the policies that use those actions, retain their priority settings whenever the Bandwidth Management Type is toggled between Global and Advanced.

Figure 18 shows the same policy after the global Bandwidth Management Type is set to Global. Only the Priority appears in the tooltip, because no values are set in the Global Priority Queue for guaranteed or maximum bandwidth for level 5.

Figure 18. Custom BWM action in policy with BWM type of global

When the Bandwidth Management Type is set to Global, the Add/Edit Action Object dialog provides the Bandwidth Priority option, but uses the values that are specified in the Priority table on the Firewall Settings > BWM page for Guaranteed Bandwidth and Maximum Bandwidth.

Figure 19 shows the Bandwidth Priority selections in the Add/Edit Action Objects dialog when the global Bandwidth Management Type is set to Global on the Firewall Settings > BWM page.

Figure 19. Add/Edit Action Objects page with BWM type global

NOTE: All priorities are displayed (Realtime - Lowest) regardless of whether they have been configured. Refer to the Firewall Settings > BWM page to determine which priorities are enabled. If the Bandwidth Management Type is set to Global and you select a Bandwidth Priority that is not enabled, the traffic is automatically mapped to the level 4 priority (4 Medium).

Application layer bandwidth management configuration is handled in the same way as Access Rule bandwidth management configuration. Both are tied in with the global bandwidth management settings. However, with Application Control you can specify all content type, which you cannot do with access rules.

For a bandwidth management use case, as an administrator you might want to limit .mp3 and executable file downloads during work hours to no more than 1 Mbps. At the same time, you want to allow downloads of productive file types such as .doc or .pdf up to the maximum available bandwidth, or even give the highest possible priority to downloads of the productive content. As another example, you might want to limit bandwidth for a certain type of peer-to-peer (P2P) traffic, but allow other types of P2P to use unlimited bandwidth. Application layer bandwidth management allows you to create policies to do this.

A number of BWM action options are also available in the predefined, default action list. The BWM action options change depending on the Bandwidth Management Type setting on the Firewall Settings > BWM page. If the Bandwidth Management Type is set to Global, all eight priorities are selectable. If the Bandwidth Management Type is set to Advanced, no priorities are selectable, but the predefined priorities are available when adding a policy.

Table 50 shows predefined default actions that are available when adding a policy.

 

Table 50. Adding a policy: Default actions

Always Available

If BWM Type = Global

If BWM Type = Advanced

Reset / Drop

No Action

Bypass DPI

Packet Monitor

0 – Realtime

1 – Highest

2 – High

3 – Medium High

4 – Medium

5 – Medium Low

6 – Low

7 – Lowest

Advanced BWM Low

Advanced BWM Medium

Advanced BWM High

Bandwidth Management Methods

Bandwidth Management feature can be implemented in two separate ways:

Figure 20. Bandwidth Management: Implementation methods

Per Policy Method – The bandwidth limit specified in a policy is applied individually to each policy

Example: two policies each have an independent limit of 500kb/s, the total possible bandwidth between those two rules is 1000kb/s

Per Action Aggregate Method – The bandwidth limit action is applied (shared) across all policies to which it is applied

Example: two policies share a BWM limit of 500kb/s, limiting the total bandwidth between the two policies to 500kb/s

Actions Using Packet Monitoring

When the predefined Packet Monitor action is selected for a policy, SonicOS captures or mirrors the traffic according to the settings you have configured on the Dashboard > Packet Monitor or System > Packet Monitor page. The default is to create a capture file, which you can view with Wireshark.

After you have configured a policy with the Packet Monitor action, you still need to click Start Capture on the Packet Monitor page to actually capture any packets. After you have captured the desired packets, click Stop Capture.

To control the Packet Monitor action to capture only the packets related to your policy:
1
Click Configure on the Packet Monitor page. The Packet Monitor Configuration dialog displays.
2
Click the Monitor Filter tab.

3
Select Enable Filter based on the firewall/app rule. This option is not selected by default.

In this mode, after you click Start Capture on the Packet Monitor page, packets are not captured until some traffic triggers the App Control policy (or Firewall Access Rule). You can see the Alert message in the Log > View page when the policy is triggered.

This works when Packet Monitor is selected in App Control policies created with the Create Rule button or with the App Rules method using an action object, or in Firewall Access Rules, and allows you to specify configuration or filtering for what to capture or mirror. You can download the capture in different formats and look at it in a Web page, for example.

4

Mirroring

To set up mirroring:
1
Click Configure on the Packet Monitor page. The Packet Monitor Configuration dialog displays.
2
Click the Mirror tab

3
Pick an interface to which to send the mirrored traffic from the Mirror filtered packets to Interface drop-down menu under Local Mirroring Settings.
4
You can also configure one of the Remote settings. This allows you to mirror the application packets to another computer and store everything on the hard disk. For example, you could capture everyone’s MSN Instant Messenger traffic and read the conversations.
5

Create Rule from AppFlow Monitor

The Dashboard > AppFlow Monitor page provides a Create Rule button. If, while viewing the AppFlow Monitor, you see an application that seems suspicious or is using excessive amounts of bandwidth, you can simply select the application in the list, then click Create Rule and configure an App Control policy for it immediately. You can also select multiple applications and then use Create Rule to configure a policy that applies to all of them.

Figure 21 shows the Create Rule pop-up dialog displayed over the Dashboard > AppFlow Monitor page.

Figure 21. Dashboard > AppFlow Monitor page with Create Rule dialog

The Create Rule feature is available from AppFlow Monitor on the list view page setting. The Create Rule button does not display on the pie chart and graphical monitoring views.

You can configure the following types of policies in the Create Rule pop-up dialog:

Block – the application will be completely blocked by the firewall
Bandwidth Manage – choose one of the BWM levels to use Global Bandwidth Management to control the bandwidth used by the application no matter which interface it traverses
Packet Monitor – capture packets from the application for examination and analysis

After you select the desired action for the rule and then click Create Rule within the Create Rule pop-up dialog, an App Control policy is automatically created and added to the App Rules Policies table on the Firewall > App Rules page.

The Create Rule pop-up dialog contains a Configure button next to the Bandwidth Manage section that takes you to the Firewall Settings > BWM page where you can configure the Global Priority Queue. For more information about global bandwidth management and the Firewall Settings > BWM page, see Actions Using Bandwidth Management . The Bandwidth Manage options you see in the Create Rule pop-up dialog reflect the options that are enabled in the Global Priority Queue. The default values are:

BWM Global-High – Guaranteed 30%; Max/Burst 100%
BWM Global-Medium – Guaranteed 50%; Max/Burst 100%
BWM Global-Low – Guaranteed 20%; Max/Burst 100%

App Control Advanced Policy Creation

The configuration method on the Firewall > App Control Advanced page allows granular control of specific categories, applications, or signatures. This includes granular logging control, granular inclusion and exclusion of users, groups, or IP address ranges, and schedule configuration. The settings here are global policies and independent from any custom App Rules policy. The Firewall > App Control Advanced page is shown below.

You can configure the following settings on this page:

While these application control settings are independent from App Rules policies, you can also create application match objects for any of the categories, applications, or signatures available here or on the Firewall > Match Objects page, and use those match objects in an App Rules policy. This allows you to use the wide array of actions and other configuration settings available with Application Control. See Application List Objects for more information about this policy-based user interface for application control.

App Rules Policy Creation

You can use Application Control to create custom App Rules policies to control specific aspects of traffic on your network. A policy is a set of match objects, properties, and specific prevention actions.When you create a policy, you first create a match object, then select and optionally customize an action, then reference these when you create the policy.

In the Firewall > App Rules page, you can access the Policy Settings dialog, shown below for a Policy Type of SMTP Client. The dialog options change depending on the Policy Type you select.

Some examples of policies include:

Disable .exe and .vbs email attachments
Do not allow outgoing email or MS Word attachments with the keywords, Dell SonicWALL Confidential, except from the CEO and CFO

When you create a policy, you select a policy type. Each policy type specifies the values or value types that are valid for the source, destination, match object type, and action fields in the policy. You can further define the policy to include or exclude specific users or groups, select a schedule, turn on logging, and specify the connection side as well as basic or advanced direction types. A basic direction type simply indicates inbound or outbound. An advanced direction type allows zone to zone direction configuration, such as from the LAN to the WAN.

Table 51 describes the characteristics of the available App Rules policy types.

 

Table 51. App rules: Policy types

Policy Type

Description

Valid Source Service / Default

Valid Destination Service / Default

Valid Match Object Type

Valid Action Type

Connection

Side

App Control Content

Policy using dynamic Application Control related objects for any application layer protocol

Any / Any

Any / Any

Application Category List, Application List, Application Signature List

Reset/Drop
No Action
Bypass DPI
Packet Monitor,
BWM Global-*
WAN BWM *

N/A

CFS

Policy for content filtering

N/A

N/A

CFS Category List

CFS Block Page
Packet Monitor
No Action,
BWM Global-*
WAN BWM *

N/A

Custom Policy

Policy using custom objects for any application layer protocol; can be used to create IPS-style custom signatures

Any / Any

Any / Any

Custom Object

Reset/Drop
Bypass DPI
Packet Monitor
No Action,
BWM Global-*
WAN BWM *

Client Side, Server Side, Both

FTP Client

Any FTP command transferred over the FTP control channel

Any / Any

FTP Control / FTP Control

FTP Command, FTP Command + Value, Custom Object

Reset/Drop
Bypass DPI
Packet Monitor
No Action

Client Side

FTP Client File Upload Request

An attempt to upload a file over FTP (STOR command)

Any / Any

FTP Control / FTP Control

Filename, file extension

Reset/Drop
Bypass DPI
Packet Monitor
No Action,
BWM Global-*
WAN BWM *

Client Side

FTP Client File Download Request

An attempt to download a file over FTP (RETR command)

Any / Any

FTP Control / FTP Control

Filename, file extension

Reset/Drop
Bypass DPI
Packet Monitor
No Action,
BWM Global-*
WAN BWM *

Client Side

FTP Data Transfer Policy

Data transferred over the FTP Data channel

Any / Any

Any / Any

File Content Object

Reset/Drop
Bypass DPI
Packet Monitor
No Action

Both

HTTP Client

Policy which is applicable to Web browser traffic or any HTTP request that originates on the client

Any / Any

Any / HTTP (configurable)

HTTP Host, HTTP Cookie, HTTP Referrer, HTTP Request Custom Header, HTTP URI Content, HTTP User Agent, Web Browser, File Name, File Extension Custom Object

Reset/Drop
Bypass DPI
Packet Monitor1
No Action,
BWM Global-*
WAN BWM *

Client Side

HTTP Server

Response originated by an HTTP Server

Any / HTTP (configurable)

Any / Any

ActiveX Class ID, HTTP Set Cookie, HTTP Response, File Content Object, Custom Header, Custom Object

Reset/Drop
Bypass DPI
Packet Monitor
No Action
BWM Global-*
WAN BWM *

Server Side

IPS Content

Policy using dynamic Intrusion Prevention related objects for any application layer protocol

N/A

N/A

IPS Signature Category List, IPS Signature List

Reset/Drop
Bypass DPI
Packet Monitor
No Action,
BWM Global-*
WAN BWM *

N/A

POP3 Client

Policy to inspect traffic generated by a POP3 client; typically useful for a POP3 server admin

Any / Any

POP3 (Retrieve Email) / POP3 (Retrieve Email)

Custom Object

Reset/Drop
Bypass DPI
Packet Monitor
No Action

Client Side

POP3 Server

Policy to inspect email downloaded from a POP3 server to a POP3 client; used for email filtering

POP3 (Retrieve Email) / POP3 (Retrieve Email)

Any / Any

Email Body, Email CC, Email From, Email To, Email Subject, File Name, File Extension, MIME Custom Header

Reset/Drop
Disable E-Mail Attachment - Add Text
Bypass DPI
No action

Server Side

SMTP Client

Policy applies to SMTP traffic that originates on the client

Any / Any

SMTP (Send Email)/ SMTP (Send Email)

Email Body, Email CC, Email From, Email To, Email Size, Email Subject, Custom Object, File Content, File Name, File Extension, MIME Custom Header,

Reset/Drop
Block SMTP E‑Mail Without Reply
Bypass DPI
Packet Monitor
No Action

Client Side


1
Packet Monitor action is not supported for File Name or File Extension Custom Object.

Match Objects

Match objects represent the set of conditions which must be matched in order for actions to take place. This includes the object type, the match type (exact, partial, regex, prefix, or suffix), the input representation (text or hexadecimal), and the actual content to match. Match objects were referred to as application objects in previous releases.

Hexadecimal input representation is used to match binary content such as executable files, while alphanumeric (text) input representation is used to match things like file or email content. You can also use hexadecimal input representation for binary content found in a graphic image. Text input representation could be used to match the same graphic if it contains a certain string in one of its properties fields. Regular expressions (regex) are used to match a pattern rather than a specific string or value, and use alphanumeric input representation.

The File Content match object type provides a way to match a pattern or keyword within a file. This type of match object can only be used with FTP Data Transfer, HTTP Server, or SMTP Client policies.

Table 52 describes the supported match object types.

 

Table 52. Supported match object types

Object Type

Description

Match Types

Negative Matching

Extra Properties

ActiveX ClassID

Class ID of an Active-X component. For example, ClassID of Gator Active-X component is “c1fb8842-5281-45ce-a271-8fd5f117ba5f”

Exact

No

None

Application Category List

Allows specification of application categories, such as Multimedia., P2P, or Social Networking

N/A

No

None

Application List

Allows specification of individual applications within the application category that you select

N/A

No

None

Application Signature List

Allows specification of individual signatures for the application and category that you select

N/A

No

None

CFS Allow/Forbidden List

Allows specification of allowed and forbidden domains for Content Filtering

Exact, Partial, Prefix, Suffix

No

Each URL can contain up to 255 characters.

The cumulative length of all URLs and the separators between them can be up to 8192 characters.

CFS Category List

Allows selection of one or more Content Filtering categories

N/A

No

A list of 64 categories is provided to choose from

Custom Object

Allows specification of an IPS-style custom set of conditions.

Exact

No

There are 4 additional, optional parameters that can be set: offset (describes from what byte in packet payload we should start matching the pattern – starts with 1; helps minimize false positives in matching), depth (describes at what byte in the packet payload we should stop matching the pattern – starts with 1), minimum payload size and maximum payload size.

Email Body

Any content in the body of an email.

Partial

No

None

Email CC (MIME Header)

Any content in the CC MIME Header.

Exact, Partial, Prefix, Suffix

Yes

None

Email From (MIME Header)

Any content in the From MIME Header.

Exact, Partial, Prefix, Suffix

Yes

None

Email Size

Allows specification of the maximum email size that can be sent.

N/A

No

None

Email Subject (MIME Header)

Any content in the Subject MIME Header.

Exact, Partial, Prefix, Suffix

Yes

None

Email To (MIME Header)

Any content in the To MIME Header.

Exact, Partial, Prefix, Suffix

Yes

None

MIME Custom Header

Allows for creation of MIME custom headers.

Exact, Partial, Prefix, Suffix

Yes

A Custom header name needs to be specified.

File Content

Allows specification of a pattern to match in the content of a file. The pattern will be matched even if the file is compressed.

Partial

No

‘Disable attachment’ action should never be applied to this object.

Filename

In cases of email, this is an attachment name. In cases of HTTP, this is a filename of an uploaded attachment to the Web mail account. In cases of FTP, this is a filename of an uploaded or downloaded file.

Exact, Partial, Prefix, Suffix

Yes

None

Filename Extension

In cases of email, this is an attachment filename extension. In cases of HTTP, this is a filename extension of an uploaded attachment to the Web mail account. In cases of FTP, this is a filename extension of an uploaded or downloaded file.

Exact

Yes

None

FTP Command

Allows selection of specific FTP commands.

N/A

No

None

FTP Command + Value

Allows selection of specific FTP commands and their values.

Exact, Partial, Prefix, Suffix

Yes

None

HTTP Cookie Header

Allows specification of a Cookie sent by a browser.

Exact, Partial, Prefix, Suffix

Yes

None

HTTP Host Header

Content found inside of the HTTP Host header. Represents hostname of the destination server in the HTTP request, such as www.google.com.

Exact, Partial, Prefix, Suffix

Yes

None

HTTP Referrer Header

Allows specification of content of a Referrer header sent by a browser – this can be useful to control or keep stats of which Web sites redirected a user to customer’s Web site.

Exact, Partial, Prefix, Suffix

Yes

None

HTTP Request Custom Header

Allows handling of custom HTTP Request headers.

Exact, Partial, Prefix, Suffix

Yes

A Custom header name needs to be specified.

HTTP Response Custom Header

Allows handling of custom HTTP Response headers.

Exact, Partial, Prefix, Suffix

Yes

A Custom header name needs to be specified.

HTTP Set Cookie Header

Set-Cookie headers. Provides a way to disallow certain cookies to be set in a browser.

Exact, Partial, Prefix, Suffix

Yes

None

HTTP URI Content

Any content found inside of the URI in the HTTP request.

Exact, Partial, Prefix, Suffix

No

None

HTTP User-Agent Header

Any content inside of a User-Agent header. For example: User-Agent: Skype.

Exact, Partial, Prefix, Suffix

Yes

None

Web Browser

Allows selection of specific Web browsers (MSIE, Firefox, Safari, Chrome).

N/A

Yes

None

IPS Signature Category List

Allows selection of one or more IPS signature groups. Each group contains multiple pre-defined IPS signatures.

N/A

No

None

IPS Signature List

Allows selection of one or more specific IPS signatures for enhanced granularity.

N/A

No

None

You can see the available types of match objects in a drop-down menu in the Add/Edit Match Object dialog.

In the Add/Edit Match Object dialog, you can add multiple entries to create a list of content elements to match. All content that you provide in a match object is case-insensitive for matching purposes. A hexadecimal representation is used to match binary content. You can use a hex editor or a network protocol analyzer like Wireshark to obtain hex format for binary files. For more information about these tools, see the following sections:

You can use the Load From File button to import content from predefined text files that contain multiple entries for a match object to match. Each entry in the file must be on its own line. The Load From File feature allows you to easily move Application Control settings from one firewall to another.

Multiple entries, either from a text file or entered manually, are displayed in the List area. List entries are matched using the logical OR, so if any item in the list is matched, the action for the policy is executed.

A match object can include a total of no more than 8000 characters. If each element within a match object contains approximately 30 characters, then you can enter about 260 elements. The maximum element size is 8000 bytes.

Topics:
Regular Expressions

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 or to select from predefined regular expressions. The Dell SonicWALL implementation supports reassembly-free regular expression matching on network traffic. This means that no buffering of the input stream is required, and patterns are matched across packet boundaries.

SonicOS provides the following predefined regular expressions:

 

VISA CC

VISA Credit Card Number

US SSN

United States Social Security Number

CANADIAN SIN

Canadian Social Insurance Number

ABA ROUTING NUMBER

American Bankers Association Routing Number

AMEX CC

American Express Credit Card Number

MASTERCARD CC

Mastercard Credit Card Number

DISCOVER CC

Discover Credit Card Number

Policies using regular expressions match the first occurrence of the pattern in network traffic. This enables actions on matches as soon as possible. Because matching is performed on network traffic and not only on human-readable text, the matchable alphabet includes the entire ASCII character set — all 256 characters.

Popular regular expression primitives such as ‘.’, (the any character wildcard), ‘*’, ‘?’, ‘+’, repetition count, alternation, and negation are supported. Though the syntax and semantics are similar to popular regular expression implementations such as Perl, vim, and others, there are some minor differences. For example, beginning (^) and end of line ($) operators are not supported. Also, ‘\z’ refers to the set of non-zero digits, [1-9], not to the end of the string as in PERL. For syntax information, see the Regular Expression Syntax .

One notable difference with the Perl regular expression engine is the lack of back-reference and substitution support. These features are actually extraneous to regular expressions and cannot be accomplished in linear time with respect to the data being examined. Hence, to maintain peak performance, they are not supported. Substitution or translation functionality is not supported because network traffic is only inspected, not modified.

Predefined regular expressions for frequently used patterns such as U.S. social security numbers and VISA credit card numbers can be selected while creating the match object. Users can also write their own expressions in the same match object. Such user provided expressions are parsed, and any that do not parse correctly will cause a syntax error to display at the bottom of the Match Object Settings dialog. After successful parsing, the regular expression is passed to a compiler to create the data structures necessary for scanning network traffic in real time.

Regular expressions are matched efficiently by building a data structure called Deterministic Finite Automaton (DFA). The DFA’s size is dictated by the regular expression provided by the user and is constrained by the memory capacities of the device. A lengthy compilation process for a complex regular expression can consume extensive amounts of memory on the appliance. It may also take up to two minutes to build the DFA, depending on the expressions involved.

To prevent abuse and denial-of-service attacks, along with excessive impact to appliance management responsiveness, the compiler can abort the process and reject regular expressions that cause this data structure to grow too big for the device. An “abuse encountered” error message is displayed at the bottom of the dialog.

Building the DFA for expressions containing large counters consumes more time and memory. Such expressions are more likely to be rejected than those that use indefinite counters such as the ‘*’ and ‘+’ operators.

Also at risk of rejection are expressions containing a large number of characters rather than a character range or class. That is, the expression ‘(a|b|c|d|. . .|z)’ to specify the set of all lower-case letters is more likely to be rejected than the equivalent character class ‘\l’. When a range such as ‘[a-z]’ is used, it is converted internally to ‘\l’. However, a range such as
[d-y]’ or ‘[0-Z]’ cannot be converted to any character class, is long, and may cause the rejection of the expression containing this fragment.

Whenever an expression is rejected, the user may rewrite it in a more efficient manner to avoid rejection using some of the above tips. For syntax information, see the Regular Expression Syntax . For an example discussing how to write a custom regular expression, see Creating a Regular Expression in a Match Object .

Regular Expression Syntax

Table 53 through Table 61 show the syntax used in building regular expressions.

 

Table 53. Regular expression syntax: Single characters

Representation

Definition

.

Any character except ‘\n’. Use /s (stream mode, also known as single-line mode) modifier to match ‘\n’ too.

[xyz]

Character class. Can also give escaped characters. Special characters do not need to be escaped as they do not have special meaning within brackets [ ].

[^xyz]

Negated character class.

\xdd

Hex input. “dd” is the hexadecimal value for the character. Two digits are mandatory. For example, \r is \x0d and not \xd.

[a-z][0-9]

Character range.

 

Table 54. Regular expression syntax: Composites

Representation

Definition

xy

x followed by y

x|y

x or y

(x)

Equivalent to x. Can be used to override precedences.

 

Table 55. Regular expression syntax: Repetitions

Representation

Definition

x*

Zero or more x

x?

Zero or one x

x+

One or more x

x{n, m}

Minimum of n and a maximum of m sequential x’s. All numbered repetitions are expanded. So, making m unreasonably large is ill-advised.

x{n}

Exactly n x’s

x{n,}

Minimum of n x’s

x{,n}

Maximum of n x’s

 

Table 56. Regular expression syntax: Escape sequences

Representation

Definition

\0, \a, \b, \f, \t, \n, \r, \v

‘C’ programming language escape sequences (\0 is the NULL character (ASCII character zero))

\x

Hex-input. \x followed by two hexa-decimal digits denotes the hexa-decimal value for the intended character.

\*, \?, \+, \(, \), \[, \], \{, \}, \\, \/,
\<space>, \#

Escape any special character.

 

Table 57. Regular expression syntax: Perl-like character classes

Representation

Definition

\d, \D

Digits, Non-digits.

\z, \Z

Non-zero digits ([1-9]), All other characters.

\s, \S

White space, Non-white space. Equivalent to [\t\n\f\r]. \v is not included in Perl white spaces.

\w, \W

Word characters, Non-word characters Equivalent to [0-9A-Za-z_].

 

Table 58. Regular expression syntax: Other ASCII character class primitives

If you want...

... then use

 

[:cntrl:]

\c, \C

Control character. [\x00 - \x1F\x7F]

[:digit:]

\d, \D

Digits, Non-Digits. Same as Perl character class.

[:graph:]

\g, \G

Any printable character except space.

[:xdigit:]

\h, \H

Any hexadecimal digit. [a-fA-F0-9]. Note this is different from the Perl \h, which means a horizontal space.

[:lower:]

\l, \L

Any lower case character

[:ascii:]

\p, \P

Positive, Negative ASCII characters. [0x00 – 0x7F], [0x80 – 0xFF]

[:upper:]

\u, \U

Any upper case character

Some of the other popular character classes can be built from the above primitives. The following classes do not have their own short-hand due of the lack of a nice mnemonic for any of the remaining characters used for them.

 

Table 59. Regular expression syntax: Compound character classes

If you want...

... then use

 

[:alnum:]

= [\l\u\d]

The set of all characters and digits.

[:alpha:]

= [\l\u]

The set of all characters.

[:blank:]

= [\t<space>]

The class of blank characters: tab and space.

[:print:]

= [\g<space>]

The class of all printable characters: all graphical characters including space.

[:punct:]

= [^\P\c<space>\d\u\l]

The class of all punctuation characters: no negative ASCII characters, no control characters, no space, no digits, no upper or lower characters.

[:space:]

= [\s\v]

All white space characters. Includes Perl white space and the vertical tab character.

 

Table 60. Regular expression syntax: Modifiers

Representation

Definition

/i

Case-insensitive

/s

Treat input as single-line. Can also be thought of as stream-mode. That is, ‘.’ matches ‘\n’ too.

 

Table 61. Regular expression syntax: Operators in decreasing order of precedence

Operators

Associativity

[ ], [^]

Left to right

()

Left to right

*, +, ?

Left to right

. (Concatenation)

Left to right

|

Left to right

Comments

SonicOS supports comments in regular expressions. Comments are preceded by any number of spaces and a pound sign (#). All text after a space and pound sign is discarded until the end of the expression.

Negative Matching

Negative matching provides an alternate way to specify which content to block. You can enable negative matching in a match object when you want to block everything except a particular type of content. When you use the object in a policy, the policy will execute actions based on absence of the content specified in the match object. Multiple list entries in a negative matching object are matched using the logical AND, meaning that the policy action is executed only when all specified negative matching entries are matched.

Although all App Rules policies are DENY policies, you can simulate an ALLOW policy by using negative matching. For instance, you can allow email .txt attachments and block attachments of all other file types. Or you can allow a few types, and block all others.

Not all match object types can utilize negative matching. For those that can, you will see the Enable Negative Matching checkbox on the Add/Edit Match Object dialog.

Application List Objects

The Firewall > Match Objects page also contains the Add Application List Object button, which opens the Create Match Object dialog. This dialog provides two tabs:

Application – You can create an application filter object on this tab. This screen allows selection of the application category, threat level, type of technology, and attributes. After selections are made, the list of applications matching those criteria is displayed. The Application tab provides another way to create a match object of the Application List type.
Category – You can create a category filter object on this tab. A list of application categories and their descriptions are provided. The Category page offers another way to create a match object of the Application Category List type.
Topics:
Application Filters

The Application tab provides a list of applications for selection. You can control which applications are displayed by selecting one or more application categories, threat levels, and technologies. You can also search for a keyword in all application names by typing it into the Search field near the top right of the display. For example, type in “bittorrent” into the Search field and click the Search icon to find multiple applications with “bittorrent” (not case-sensitive) in the name.

When the application list is reduced to a list that is focused on your preferences, you can select the individual applications for your filter by clicking the Plus icon next to them, and then save your selections as an application filter object with a custom name or an automatically generated name. The image below shows the dialog with all categories, threat levels, and technologies selected, but before any individual applications have been chosen.

As you select the applications for your filter, they appear in the Application Group field on the right. You can edit the list in this field by deleting individual items or by clicking the eraser to delete all items. The image below shows several applications in the Application Group field. The selected applications are also marked with a green checkmark icon in the application list on the left side.

When finished selecting the applications to include, you can type in a name for the object in the Match Object Name field (first, clear the Auto-generate match object name checkbox) and click the Save Application Match Object button. You will see the object name listed on the Firewall > Match Objects page with an object type of Application List. This object can then be selected when creating an App Rules policy.

Match Objects created using the Auto-generate match object name option display a tilde (~) as the first character of the object name.

Category Filters

The Category tab provides a list of application categories for selection. You can select any combination of categories and then save your selections as a category filter object with a custom name. The image below shows the dialog with the description of the IM category displayed.

You can hover your mouse pointer over each category in the list to see a description of it.

To create a custom category filter object:
1
Clear the Auto-generate match object name checkbox.
2
3
4
Click the Save Category Match Object button.

The object name is listed on the Firewall > Match Objects page with an object type of Application Category List. This object can be selected when creating an App Rules policy.

Match Objects created using the Auto-generate match object name option display a tilde (~) as the first character of the object name.

Action Objects

Action Objects define how the App Rules policy reacts to matching events. You can choose a customizable action or select one of the predefined, default actions.

The predefined actions are displayed in the Add/Edit App Control Policy dialog when you add or edit a policy from the Firewall > App Rules page.

A number of BWM action options are also available in the predefined, default action list. The BWM action options change depending on the Bandwidth Management Type setting on the Firewall Settings > BWM page. If the Bandwidth Management Type is set to Global, all eight priorities are selectable. If the Bandwidth Management Type is set to Advanced, no priorities are selectable, but the predefined priorities are available when adding a policy.

Table 62 shows predefined default actions that are available when adding a policy.

 

Table 62. Adding a policy: Default actions

Always Available

If BWM Type = Global

If BWM Type = Advanced

Reset / Drop

No Action

Bypass DPI

Packet Monitor

BWM Global-Realtime

BWM Global-Highest

BWM Global-High

BWM Global-Medium High

BWM Global-Medium

BWM Global-Medium Low

BWM Global-Low

BWM Global-Lowest

Advanced BWM Low

Advanced BWM Medium

Advanced BWM High

 

For more information about BWM actions, see the Actions Using Bandwidth Management .

The customizable actions are displayed in the Add/Edit Action Object dialog when you click Add New Action Object on the Firewall > Action Objects page. See Table 63 for descriptions of these action types as well as the predefined action types.

NOTE: Only the customizable actions are available for editing in the Action Object Settings dialog. The predefined actions cannot be edited or deleted. When you create a policy, the Policy Settings dialog provides a way for you to select from the predefined actions along with any customized actions that you have defined.
 

Table 63. Action Object settings: Action types

Action Type

Description

Predefined or Custom

BWM Global-Realtime

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of zero.

Predefined

BWM Global-Highest

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of one.

Predefined

BWM Global-High

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts (default is 30%) and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of two.

Predefined

BWM Global-Medium High

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of three.

Predefined

BWM Global-Medium

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts (default is 50%) and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of four.

Predefined

BWM Global-Medium Low

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of five.

Predefined

BWM Global-Low

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts (default is 20%) and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of six.

Predefined

BWM Global-Lowest

Manages inbound and outbound bandwidth, can be configured for guaranteed bandwidth in varying amounts and maximum/burst bandwidth usage up to 100% of total available bandwidth, sets a priority of seven.

Predefined

Bypass DPI

Bypasses Deep Packet Inspection components IPS, GAV, Anti-Spyware and Application Control. This action persists for the duration of the entire connection as soon as it is triggered. Special handling is applied to FTP control channels that are never bypassed for Application Control inspection. This action supports proper handling of the FTP data channel. Note that Bypass DPI does not stop filters that are enabled on the Firewall Settings > SSL Control page.

Predefined

No Action

Policies can be specified without any action. This allows “log only” policy types.

Predefined

Packet Monitor

Use the SonicOS Packet Monitor capability to capture the inbound and outbound packets in the session, or if mirroring is configured, to copy the packets to another interface. The capture can be viewed and analyzed with Wireshark.

Predefined

Reset / Drop

For TCP, the connection will be reset. For UDP, the packet will be dropped.

Predefined

Block SMTP Email - Send Error Reply

Blocks SMTP email and notifies the sender with a customized error message.

Custom

Disable Email Attachment - Add Text

Disables attachment inside of an email and adds customized text.

Custom

Email - Add Text

Appends custom text at the end of the email.

Custom

FTP Notification Reply

Sends text back to the client over the FTP control channel without terminating the connection.

Custom

HTTP Block Page

Allows a custom HTTP block page configuration with a choice of colors.

Custom

HTTP Redirect

Provides HTTP Redirect functionality. For example, if someone would like to redirect people to the Google Web site, the customizable part will look like: http://www.google.com If an HTTP Redirect is sent from Application Control to a browser that has a form open, the information in the form will be lost.

Custom

Bandwidth Management

Allows definition of bandwidth management constraints with same semantics as Access Rule BWM policy definition.

Custom

A priority setting of zero is the highest priority. Guaranteed bandwidth for all levels of BWM combined must not exceed 100%.

Email Address Objects

Application Control allows the creation of custom email address lists as email address objects. You can only use email address objects in an SMTP client policy configuration. Email address objects can represent either individual users or the entire domain. You can also create an email address object that represents a group by adding a list of individual addresses to the object. This provides a way to easily include or exclude a group of users when creating an SMTP client policy.

For example, you can create an email address object to represent the support group:

After you define the group in an email address object, you can create an SMTP client policy that includes or excludes the group.

In the screenshot below, the settings exclude the support group from a policy that prevents executable files from being attached to outgoing email. You can use the email address object in either the MAIL FROM or RCPT TO fields of the SMTP client policy. The MAIL FROM field refers to the sender of the email. The RCPT TO field refers to the intended recipient.

Although Application Control cannot extract group members directly from Outlook Exchange or similar applications, you can use the member lists in Outlook to create a text file that lists the group members. Then, when you create an email address object for this group, you can use the Load From File button to import the list from your text file. Be sure that each email address is on a line by itself in the text file.