Fortigate Security Profiles 5.2
Fortigate Security Profiles 5.2
Page 3
Table of Contents
Change Log....................................................................................................... 3
Security Profiles overview ............................................................................. 12
Traffic inspection ................................................................................................... 12
IPS signatures .................................................................................................. 12
Suspicious traffic attributes ............................................................................. 13
Application control ........................................................................................... 13
Content inspection and filtering............................................................................. 13
AntiVirus ........................................................................................................... 14
FortiGuard Web Filtering.................................................................................. 14
Email filter ........................................................................................................ 14
DLP .................................................................................................................. 15
Security Profiles components................................................................................ 15
AntiVirus ........................................................................................................... 15
Intrusion Protection System (IPS) .................................................................... 15
Web filtering ..................................................................................................... 15
Email filtering.................................................................................................... 16
Data Leak Prevention (DLP) ............................................................................. 16
Application Control .......................................................................................... 16
ICAP ................................................................................................................. 16
Security Profiles/lists/sensors................................................................................ 16
AntiVirus .......................................................................................................... 18
Antivirus concepts ................................................................................................. 18
Malware Threats .............................................................................................. 18
Scanning Modes .............................................................................................. 20
Antivirus scanning order .................................................................................. 21
Antivirus databases.......................................................................................... 24
Antivirus techniques......................................................................................... 24
FortiGuard Sandbox ........................................................................................ 26
Client Comforting............................................................................................. 26
Oversized files and emails ............................................................................... 27
Archive scan depth .......................................................................................... 28
Scan buffer size ............................................................................................... 28
Windows file sharing (CIFS) ............................................................................. 29
Enabling AntiVirus scanning .................................................................................. 30
Testing your antivirus configuration....................................................................... 32
Page 4
Example Scenarios ................................................................................................ 32
Configuring simple default antivirus profile...................................................... 32
Setting up a basic proxy-based Antivirus profile for email traffic .................... 34
Adding the profile to a policy ........................................................................... 36
Block files larger than 8 MB ............................................................................. 37
Web filter ......................................................................................................... 38
Web filter concepts................................................................................................ 38
Different ways of controlling access ................................................................ 40
Order of web filtering ....................................................................................... 40
Inspections Modes ................................................................................................ 40
Proxy ................................................................................................................ 40
Flow-based ...................................................................................................... 40
DNS.................................................................................................................. 41
FortiGuard Web Filtering Service........................................................................... 41
FortiGuard Web Filter and your FortiGate unit................................................. 42
FortiGuard Web Filter usage quotas................................................................ 44
Overriding FortiGuard website categorization ....................................................... 44
The different methods of override.................................................................... 44
Using Alternate Categories .............................................................................. 45
Using Alternate Profiles.................................................................................... 46
SafeSearch ............................................................................................................ 50
Search Keywords............................................................................................. 50
YouTube Education Filter ...................................................................................... 50
Enabling YouTube Education Filter in CLI ....................................................... 51
Static URL Filter..................................................................................................... 51
URL Filter actions............................................................................................. 52
Status............................................................................................................... 54
Configuring a URL filter.................................................................................... 54
Referrer URL .................................................................................................... 54
Web content filter................................................................................................... 55
General configuration steps............................................................................. 55
Creating a web filter content list ...................................................................... 56
How content is evaluated ................................................................................ 56
Enabling the web content filter and setting the content threshold .................. 57
Table of Contents Page 5 FortiOS Handbook Handbook v5 Security Profiles for FortiOS 5.2
Advanced web filter configurations ....................................................................... 57
Allow websites when a rating error occurs ...................................................... 57
ActiveX filter ..................................................................................................... 58
Block HTTP redirects by rating ........................................................................ 58
Block Invalid URLs........................................................................................... 58
Cookie filter ...................................................................................................... 58
Provide Details for Blocked HTTP 4xx and 5xx Errors .................................... 58
HTTP POST action........................................................................................... 58
Java applet filter............................................................................................... 59
Rate Images by URL ........................................................................................ 59
Rate URLs by Domain and IP Address ............................................................ 59
Web resume download block .......................................................................... 59
Restrict Google account usage to specific domains ....................................... 60
Configuring Web Filter Profiles .............................................................................. 60
Enabling FortiGuard Web Filter........................................................................ 60
General configuration steps............................................................................. 60
Configuring FortiGuard Web Filter settings ..................................................... 60
To configure the FortiGuard Web Filter categories.......................................... 61
Configuring FortiGuard Category Quotas ........................................................ 61
Configure Allowed Blocked Overrides ............................................................. 62
Configure Search Engine Section .................................................................... 62
Configure Static URL Filter .............................................................................. 62
Configure Rating Options ................................................................................ 63
Configure Proxy Options.................................................................................. 63
Web filtering example ............................................................................................ 64
Web filtering is particularly important for protecting school-aged children. There
are legal issues associated with improper web filtering as well as a moral
responsibility not to allow children to view inappropriate material. The key is to
design a web filtering system in such a way that students and staff do not fall
under the same web filter profile in the FortiGate configuration. This is
important because the staff may need to access websites that are off-limits to
the [Link] district........................................................................... 64
Application control ......................................................................................... 68
Application control concepts ................................................................................. 68
Application Control Actions ................................................................................... 69
Allow ................................................................................................................ 69
Monitor............................................................................................................. 69
Block ................................................................................................................ 69
Reset ................................................................................................................ 69
Traffic Shaping................................................................................................. 69
View Signatures ............................................................................................... 70
Application considerations .................................................................................... 70
IM applications................................................................................................. 70
Skype ............................................................................................................... 70
SPDY................................................................................................................ 71
Table of Contents Page 6 FortiOS Handbook Handbook v5 Security Profiles for FortiOS 5.2
Working with other FortiOS components .............................................................. 71
WAN Optimization............................................................................................ 71
Application traffic shaping ..................................................................................... 71
Direction of traffic shaping............................................................................... 71
Shaper re-use .................................................................................................. 72
Application control monitor ................................................................................... 72
Enable application control ..................................................................................... 73
General configuration steps............................................................................. 73
Creating an application sensor ........................................................................ 73
Adding applications to an application sensor.................................................. 73
Creating a New Custom Application Signature ............................................... 75
Enabling application traffic shaping................................................................. 75
Messages in response to blocked applications............................................... 75
Application control examples .......................................................................... 75
Blocking all instant messaging ........................................................................ 75
Allowing only software updates ....................................................................... 76
Intrusion protection........................................................................................ 78
IPS concepts.......................................................................................................... 78
Anomaly-based defense .................................................................................. 78
Signature-based defense................................................................................. 78
Enable IPS scanning .............................................................................................. 80
General configuration steps............................................................................. 80
Creating an IPS sensor .................................................................................... 80
Adding an IPS filter to a sensor ....................................................................... 81
Updating predefined IPS signatures ................................................................ 84
Viewing and searching predefined IPS signatures .......................................... 84
IPS processing in an HA cluster ............................................................................ 84
Active-passive.................................................................................................. 84
Active-active .................................................................................................... 85
Configure IPS options............................................................................................ 85
Hardware Acceleration..................................................................................... 85
Extended IPS Database. .................................................................................. 85
Configuring the IPS engine algorithm .............................................................. 86
Configuring the IPS engine-count.................................................................... 86
Configuring fail-open ....................................................................................... 86
Configuring the session count accuracy ......................................................... 86
Configuring the IPS buffer size ........................................................................ 87
Configuring protocol decoders ........................................................................ 87
Configuring security processing modules ....................................................... 87
IPS signature rate count threshold .................................................................. 88
Enable IPS packet logging..................................................................................... 88
Table of Contents Page 7 FortiOS Handbook Handbook v5 Security Profiles for FortiOS 5.2
IPS examples ......................................................................................................... 89
Configuring basic IPS protection ..................................................................... 89
Using IPS to protect your web server .............................................................. 90
Create and test a packet logging IPS sensor .................................................. 92
Configuring a Fortinet Security Processing module ........................................ 93
IPS Sensor ....................................................................................................... 94
Custom Application & IPS Signatures .......................................................... 96
Creating a custom IPS signature ..................................................................... 96
Custom signature syntax and keywords.......................................................... 96
Creating a custom signature to block access to [Link] .................... 102
Creating a custom signature to block the SMTP “vrfy” command................ 104
Email filter ..................................................................................................... 106
Email filter concepts ............................................................................................ 106
Inspection Modes ................................................................................................ 106
Proxy .............................................................................................................. 106
Flow-based .................................................................................................... 106
Email filter techniques.......................................................................................... 107
Black white list ............................................................................................... 107
Banned word check ....................................................................................... 108
DNS-based Blackhole List (DNSBL) .............................................................. 109
FortiGuard-Antispam Service. ....................................................................... 109
Trusted IP Addresses..................................................................................... 110
MIME header.................................................................................................. 110
HELO DNS lookup ......................................................................................... 110
Return email DNS check................................................................................ 110
Order of spam filtering ......................................................................................... 110
Order of SMTP and SMTPS spam filtering .................................................... 111
Order of IMAP, POP3, IMAPS and POP3S spam filtering ............................. 111
Spam actions ....................................................................................................... 111
Discard .......................................................................................................... 111
Pass ............................................................................................................... 111
Tag................................................................................................................. 112
Email traffic types to inspect ............................................................................... 112
Configuring an Email Filters ................................................................................. 112
Spam detection by protocol .......................................................................... 112
FortiGuard Spam Filtering.............................................................................. 113
Local Spam Filtering ...................................................................................... 113
Email filter examples ............................................................................................ 114
Configuring simple antispam protection........................................................ 114
Blocking email from a user ............................................................................ 115
Table of Contents Page 8 FortiOS Handbook Handbook v5 Security Profiles for FortiOS 5.2
Data leak prevention .................................................................................... 116
Data leak prevention concepts ............................................................................ 116
DLP sensor..................................................................................................... 116
DLP filter ........................................................................................................ 116
DLP Filter Actions .......................................................................................... 117
Preconfigured sensors ................................................................................... 117
DLP document fingerprinting ......................................................................... 118
Fingerprinting ................................................................................................. 118
File size .......................................................................................................... 120
DLP filtering by specific file types.................................................................. 120
Watermarking................................................................................................. 120
Regular expression ........................................................................................ 122
Encrypted....................................................................................................... 122
Examining specific services ........................................................................... 122
DLP archiving....................................................................................................... 122
Enable data leak prevention ................................................................................ 123
General configuration steps........................................................................... 123
Creating/editing a DLP sensor............................................................................. 124
Adding filters to a DLP sensor ....................................................................... 124
DLP examples...................................................................................................... 126
Blocking content with credit card numbers ................................................... 126
Blocking emails larger than 15 MB and logging emails from 5 MB to 15 MB 127
Selective blocking based on a finger print..................................................... 128
ICAP ............................................................................................................... 132
The Protocol ........................................................................................................ 132
Offloading using ICAP.......................................................................................... 133
Configuration Settings ......................................................................................... 133
Servers ........................................................................................................... 133
Profiles ........................................................................................................... 134
Example ICAP sequence ..................................................................................... 134
Example Scenario ................................................................................................ 135
Other Security Profiles considerations ...................................................... 137
Security Profiles and Virtual domains (VDOMs)................................................... 137
Conserve mode.................................................................................................... 137
The AV proxy.................................................................................................. 137
Entering and exiting conserve mode ............................................................. 137
Conserve mode effects.................................................................................. 138
Configuring the av-failopen command .......................................................... 139
SSL content scanning and inspection ................................................................. 139
Setting up certificates to avoid client warnings ............................................. 140
Exceptions ..................................................................................................... 141
Configuring packet logging options............................................................... 141
Using wildcards and Perl regular expressions..................................................... 142
Table of Contents Page 9 FortiOS Handbook Handbook v5 Security Profiles for FortiOS 5.2
............................................................................................................................. 145
Index .............................................................................................................. 146
Table of Contents Page 10 FortiOS Handbook Handbook v5 Security Profiles for FortiOS 5.2
Chapter 1 Security Profiles
Page 11
Security Profiles overview
Ranging from the FortiGate®-30 series for small businesses to the FortiGate-5000 series for
large enterprises, service providers and carriers, the FortiGate line combines a number of
security features to protect your network from threats. As a whole, these features, when
included in a single Fortinet security appliance, are referred to as Security Profiles. The Security
Profiles features your FortiGate model includes are:
• AntiVirus
• Intrusion Prevention System (IPS)
• Web filtering
• E-mail filtering, including protection against spam and grayware
• Data Leak Prevention (DLP)
• Application Control
• ICAP
Firewall policies limit access, and while this and similar features are a vital part of securing your
network, they are not covered in this document.
The following topics are included in this section:
• Traffic inspection
• Content inspection and filtering
• Security Profiles components
• Security Profiles/lists/sensors
Traffic inspection
When the FortiGate unit examines network traffic one packet at a time for IPS signatures, it is
performing traffic analysis. This is unlike content analysis where the traffic is buffered until files,
email messages, web pages, and other files are assembled and examined as a whole.
DoS policies use traffic analysis by keeping track of the type and quantity of packets, as well as
their source and destination addresses.
Application control uses traffic analysis to determine which application generated the packet.
Although traffic inspection doesn’t involve taking packets and assembling files they are
carrying, the packets themselves can be split into fragments as they pass from network to
network. These fragments are reassembled by the FortiGate unit before examination.
No two networks are the same and few recommendations apply to all networks. This topic
offers suggestions on how you can use the FortiGate unit to help secure your network against
content threats.
IPS signatures
IPS signatures can detect malicious network traffic. For example, the Code Red worm attacked
a vulnerability in the Microsoft IIS web server. Your FortiGate’s IPS system can detect traffic
attempting to exploit this vulnerability. IPS may also detect when infected systems
communicate with servers to receive instructions.
Page 12
IPS recommendations
• Enable IPS scanning at the network edge for all services.
• Use FortiClient endpoint IPS scanning for protection against threats that get into your
network.
• Subscribe to FortiGuard IPS Updates and configure your FortiGate unit to receive push
updates. This will ensure you receive new IPS signatures as soon as they are available.
• Your FortiGate unit includes IPS signatures written to protect specific software titles from
DoS attacks. Enable the signatures for the software you have installed and set the signature
action to Block.
• You can view these signatures by going to Security Profiles > Intrusion Protection and
selecting the [View IPS Signatures] link.
• Because it is critical to guard against attacks on services that you make available to the
public, configure IPS signatures to block matching signatures. For example, if you have a
web server, configure the action of web server signatures to Block.
Application control
While applications can often be blocked by the ports they use, application control allows
convenient management of all supported applications, including those that do not use set
ports.
When the FortiGate unit buffers the packets containing files, email messages, web pages, and
other similar files for reassembly before examining them, it is performing content inspection.
Traffic inspection, on the other hand, is accomplished by the FortiGate unit examining individual
packets of network traffic as they are received.
No two networks are the same and few recommendations apply to all networks. This topic
offers suggestions on how you can use the FortiGate unit to help secure your network against
content threats. Be sure to understand the effects of the changes before using the suggestions.
AntiVirus recommendations
• Enable antivirus scanning at the network edge for all services.
• Use FortiClient endpoint antivirus scanning for protection against threats that get into your
network.
• Subscribe to FortiGuard AntiVirus Updates and configure your FortiGate unit to receive push
updates. This will ensure you receive new antivirus signatures as soon as they are available.
• Enable the Extended Virus Database if your FortiGate unit supports it.
• Examine antivirus logs periodically. Take particular notice of repeated detections. For
example, repeated virus detection in SMTP traffic could indicate a system on your network is
infected and is attempting to contact other systems to spread the infection using a mass
mailer.
• The builtin-patterns file filter list contains nearly 20 file patterns. Many of the represented
files can be executed or opened with a double-click. If any of these file patterns are not
received as a part of your normal traffic, blocking them may help protect your network. This
also saves resources since files blocked in this way do not need to be scanned for viruses.
• To conserve system resources, avoid scanning email messages twice. Scan messages as
they enter and leave your network or when clients send and retrieve them, rather than both.
Email filter
Spam is a common means by which attacks are delivered. Users often open email attachments
they should not, and infect their own machine. The FortiGate email filter can detect harmful
spam and mark it, alerting the user to the potential danger.
DLP
Most security features on the FortiGate unit are designed to keep unwanted traffic out of your
network while DLP can help you keep sensitive information from leaving your network. For
example, credit card numbers and social security numbers can be detected by DLP sensors.
DLP recommendations
• Rules related to HTTP posts can be created, but if the requirement is to block all HTTP
posts, a better solution is to use application control or the HTTP POST Action option in the
web filter profile.
• While DLP can detect sensitive data, it is more efficient to block unnecessary
communication channels than to use DLP to examine it. If you don’t use instant messaging
or peer-to-peer communication in your organization, for example, use application control to
block them entirely.
AntiVirus
Your FortiGate unit stores a virus signature database that can identify more than 15,000
individual viruses. FortiGate models that support additional virus databases are able to identify
hundreds of thousands of viruses. With a FortiGuard AntiVirus subscription, the signature
databases are updated whenever a new threat is discovered.
AntiVirus also includes file filtering. When you specify files by type or by file name, the FortiGate
unit will stop the matching files from reaching your users.
FortiGate units with a hard drive or configured to use a FortiAnalyzer unit can store infected and
blocked files for that you can examine later.
Web filtering
Web filtering includes a number of features you can use to protect or limit your users’ activity on
the web.
FortiGuard Web Filtering is a subscription service that allows you to limit access to web sites.
More than 60 million web sites and two billion web pages are rated by category. You can
choose to allow or block each of the 77 categories.
URL filtering can block your network users from access to URLs that you specify.
Email filtering
FortiGuard AntiSpam is a subscription service that includes an IP address black list, a URL
black list, and an email checksum database. These resources are updated whenever new spam
messages are received, so you do not need to maintain any lists or databases to ensure
accurate spam detection.
You can use your own IP address lists and email address lists to allow or deny addresses,
based on your own needs and circumstances.
Application Control
Although you can block the use of some applications by blocking the ports they use for
communications, many applications do not use standard ports to communicate. Application
control can detect the network traffic of more than 1000 applications, improving your control
over application communication.
ICAP
This module allows for the offloading of certain processes to a separate server so that your
FortiGate firewall can optimize its resources and maintain the best level of performance
possible.
Security Profiles/lists/sensors
A profile is a group of settings that you can apply to one or more firewall policies. Each Security
Profile feature is enabled and configured in a profile, list, or sensor. These are then selected in a
security policy and the settings apply to all traffic matching the policy. For example, if you create
an antivirus profile that enables antivirus scanning of HTTP traffic, and select the antivirus
profile in the security policy that allows your users to access the World Wide Web, all of their
web browsing traffic will be scanned for viruses.
Because you can use profiles in more than one security policy, you can configure one profile for
the traffic types handled by a set of firewall policies requiring identical protection levels and
types, rather than repeatedly configuring those same profile settings for each individual security
policy.
For example, while traffic between trusted and untrusted networks might need strict protection,
traffic between trusted internal addresses might need moderate protection. To provide the
different levels of protection, you might configure two separate sets of profiles: one for traffic
between trusted networks, and one for traffic between trusted and untrusted networks.
This section describes how to configure the antivirus options. From an antivirus profile you can
configure the FortiGate unit to apply antivirus protection to HTTP, FTP, IMAP, POP3, SMTP, and
NNTP sessions. If your FortiGate unit supports SSL content scanning and inspection, you can
also configure antivirus protection for HTTPS, IMAPS, POP3S, SMTPS, and FTPS sessions.
In many cases you can just customize the default antivirus profile and apply it to the security
policy that accepts the traffic to be virus scanned. You can also create custom antivirus profiles
if want to apply different types of virus protection to different traffic.
The following topics are included in this section:
• Antivirus concepts
• Enabling AntiVirus scanning
• Testing your antivirus configuration
• Example Scenarios
Antivirus concepts
The word “antivirus” refers to a group of features that are designed to prevent unwanted and
potentially malicious files from entering your network. These features all work in different ways,
which include checking for a file size, name, or type, or for the presence of a virus or grayware
signature.
The antivirus scanning routines your FortiGate unit uses are designed to share access to the
network traffic. This way, each individual feature does not have to examine the network traffic as
a separate operation, and the overhead is reduced significantly. For example, if you enable file
filtering and virus scanning, the resources used to complete these tasks are only slightly greater
than enabling virus scanning alone. Two features do not require twice the resources.
Antivirus scanning examines files for viruses, worms, trojans, and other malware. The antivirus
scan engine has a database of virus signatures it uses to identify infections. If the scanner finds
a signature in a file, it determines that the file is infected and takes the appropriate action.
Malware Threats
Viruses
Viruses are self replicating code that install copies of themselves into other programs, data files
for boot sectors of storage devices. Virus can often carry a “payload” which performs some
undesirable function. These functions can include but are not limited to:
• Stealing drive space
• Stealing cpu cycles
• Accessing private information
• Corrupting data
• Digital defacement or vandalism
• Spamming contact lists
Page 18
Worms
A worm is a piece of standalone computer code that replicates itself in order to spread to other
computers. It normally uses a computer network to spread itself, using security vulnerabilities
on the target computer or network to propagate. Unlike a virus, it does not attach itself to an
existing file. Even is there is no payload, worms consume resources such as bandwidth and
storage space just through their act of replication.
Trojan horses
A Trojan horse, or Trojan is malware that is defined by its delivery method. Through the use of
social engineering, or some other method, the code is installed on a system by a valid user of
the system and like the original Trojan horse there is something more than advertised within the
software. Trojans, unlike worms or viruses are generally non-self-replicating. The most common
payload of a Trojan is the setting up of a “back door” control mechanism to the system that it is
installed on.
Ransomware
Ransomware is a type of malware that, as the name implies, hold the system ransom until
payment of some kind is made. It does this by restricting access to the legitimate owner of the
system either by encrypting files or locking the system. Usually, a message of some kind is
displayed with the demands. Upon payment a utility or key is sent to the user to unlock the
system.
Scareware
Scareware comes in two main flavours; the first tries to convince the user that his computer is
infected with some non-existent malware, scaring the user into purchasing the author’s virus
removal utility. The utility is nonfunctional or some additional form of malware.
The second form tries to convince the user that the computer has been or is being used for an
illegal act such as being part of a bot net or storing child pornography. Again, the objective is to
scare the user into paying to cure something that is not really there.
Spyware
Spyware is used by its authors to collect information about the user and its computer without
the users knowledge. The end result can be as benign as being better able to target adds, to as
criminal as key loggers designed to record account ids and passwords of bank accounts and
forward them off to the authors.
Adware
Adware is not malware per se. It is merely any software that produces advertisements in order
to generate revenue for its author. While a lot of people find this inconvenient or irritating it is not
malware. As such it is not blocked by the antivirus software for being malware. This doesn’t
mean that software that has adware built into it will not be block if it does have malware in it.
Botnets
A botnet is a network of Internet connected computers that have been covertly usurped to
forward transmissions to other computers on the Internet on behalf of a “master”. These
transmission can be merely annoying such as spam or they can critically impact a target as
when used to launch a Distributed Denial of Service attack.
Any such computer is referred to as a zombie - in effect, a computer "robot" or "bot" that serves
the wishes of some master spam or virus originator. Most computers compromised in this way
are home-based.
Phishing
Phishing is a social engineering technique that is used to obtain sensitive and confidential
information by masquerading as a communication from a trusted entity such as a well known
institution, company or website. Usually, the malware is not in the communication itself but in
the links within the communication.
Grayware
Grayware programs are unsolicited software programs installed on computers, often without
the user’s consent or knowledge. Grayware programs are generally considered an annoyance,
but they can also cause system performance problems or be used for malicious purposes.
Scanning Modes
FortiOS has two different mode of scanning for malware. The reasons for the different modes
are performance and granularity. In just about everything relating to security there is a constant
balancing act going on. As you increase the level of security and comprehensiveness, there is
by necessity a decrease in either convenience or performance, sometimes both. The increase in
processing to scan for more threats requires more resources; resources that are a finite supply
on the hardware. Granularity can sometimes be used to mitigate performance impact by
scanning for a smaller subset of traffic but this is only recommended when that smaller subset
of traffic is the only traffic going through the firewall.
If the traffic on the device is slight then the impact on the performance will hardly be noticeable,
but it the unit is working close to capacity in terms of traffic and there are a lot of files coming
through then there might be a noticeable decline in the performance.
While both modes offer significant security, Proxy-based is weighted towards being more
thorough and easily configurable, while Flow-based is designed to optimize performance.
Proxy
The most thorough scan requires that the FortiGate unit have the whole file for the scanning
procedure. To achieve this, the antivirus proxy buffers the file as it arrives. Once the
transmission is complete, the virus scanner examines the file. If no infection is present, it is sent
to the destination. If an infection is present, a replacement message is set to the destination.
During the buffering and scanning procedure, the client must wait. With a default configuration,
the file is released to the client only after it is scanned. You can enable client comforting in the
Proxy Options profile to feed the client a trickle of data to prevent them from thinking the
transfer is stalled, and possibly cancelling the download.
Buffering the entire file allows the FortiGate unit to eliminate the danger of missing an infection
due to fragmentation because the file is reassembled before examination. Archives can also be
expanded and the contents scanned, even if archives are nested.
Since the FortiGate unit has a limited amount of memory, files larger than a certain size do not fit
within the memory buffer. The default buffer size is 10 MB. You can use the uncompsizelimit CLI
command to adjust the size of this memory buffer.
Files larger than the buffer are passed to the destination without scanning. You can use the
Oversize File/Email setting to block files larger than the antivirus buffer if allowing files that are
too large to be scanned is an unacceptable security risk.
File filtering includes file pattern and file type scans which are applied at different stages in the
antivirus process.
If a file fails any of the tasks of the antivirus scan, no further scans are performed. For example,
if the file [Link] is recognized as a blocked file pattern, the FortiGate unit will send the
end user a replacement message, and delete or quarantine the file. The unit will not perform
virus scan, grayware, heuristics, and file type scans because the previous checks have already
determined that the file is a threat and have dealt with it.
File filtering includes file pattern and file type scans which are applied at different stages in the
antivirus process.
Extended Includes the normal database in addition to recent viruses that are no-longer
active. These viruses may have been spreading within the last year but have
since nearly or completely disappeared.
Extreme Includes the extended database in addition to a large collection of ‘zoo’ viruses.
These are viruses that have not spread in a long time and are largely dormant
today. Some zoo viruses may rely on operating systems and hardware that are no
longer widely used.
If your FortiGate unit supports extended, extreme, or flow-based virus database definitions, you
can select the virus database most suited to your needs.
If you require the most comprehensive antivirus protection, enable the extended virus database.
The additional coverage comes at a cost, however, because the extra processing requires
additional resources.
Antivirus techniques
The first three antivirus features work in sequence to efficiently scan incoming files and offer
your network optimum antivirus protection. The first two features have specific functions, the
third, heuristics, protects against new, or previously unknown virus threats.
To ensure that your system is providing the most protection available, all virus definitions and
signatures are updated regularly through the FortiGuard antivirus services.
The Botnet protection looks for links to malware rather than malware itself.
Virus scan
If the file passes the file pattern scan, the FortiGate unit applies a virus scan to it. The virus
definitions are kept up-to-date through the FortiGuard Distribution Network (FDN).
Grayware
If the file passes the virus scan, it can be checked for grayware.
Heuristics
After an incoming file has passed the grayware scan, it is subjected to the heuristics scan. The
FortiGate heuristic antivirus engine, if enabled, performs tests on the file to detect virus-like
behavior or known virus indicators. In this way, heuristic scanning may detect new viruses, but
may also produce some false positive results. You configure heuristics from the CLI.
To set heuristics, enter the following in the CLI:
config antivirus heuristic
set mode {pass |block |disable}
end
• “block” enables heuristics and any files determined to be malware are blocked from
entering the network.
• “pass” enables heuristics but any files determined to be malware are still allowed to pass
through to the recipient.
• “disable” turns off heuristics.
FortiGuard Antivirus
The FortiGuard Antivirus services are included in the regular FortiGuard subscription and
include automatic updates of antivirus engines and definitions as well as a DNS black list
(DNSBL) through the FortiGuard Distribution Network (FDN).
Current information about your subscription and version numbers can be found at System >
Config > FortiGuard. This page will also allow the configuration of connections to the FortiGuard
Center and how often to check for updates to the antivirus files.
Botnet protection
Protection from having your system being controlled by a botnet is achieved by detecting and
blocking connection attempts to known botnets. This feature also includes connections to
known phishing sites. The antivirus database includes a constantly updated database of known
command and control (C&C) sites that Botnet clients attempt to connect to, as well as a
database of phishing URLs.
To enable Botnet and phishing protection in an antivirus profile check the check box next to
Detect Connection to Botnet C&C Servers
The Botnet protection feature is available for both proxy and flow-based antivirus profiles.
FortiGuard Sandbox
Not every piece of malware has a signature yet. This is especially true of new malware and new
variations on existing malware. FortiOS can upload suspicious files to FortiGuard Sandbox
where the file will be executed and the resulting behavior analyzed for risk. If the file exhibits
risky behavior or is found to contain a virus, a new virus signature is created and added to the
FortiGuard antivirus signature database. The next time your FortiGate unit updates its antivirus
database it will have the new signature.
A file is considered suspicious if it does not contain a known virus and if it has some suspicious
characteristics. The suspicious characteristics can change depending on the current threat
climate and other factors. Fortinet optimizes how files are uploaded as required.
To configure an Antivirus profile to enable the use of the FortiGuard Sandbox check the check
box next to:
Send Files to FortiGuard Sandbox for Inspection (Requires FortiCloud account)
Sending files to the FortiGuard Sandbox does not block files that it uploads. Instead they are
used to improve how quickly new threats can be discovered and signatures created for them
and added to the FortiGuard antivirus database.
The Advanced Threat Protection dashboard widget shows the number of files that your
FortiGate unit has uploaded or submitted to FortiGuard Sandbox.
Client Comforting
When proxy-based antivirus scanning is enabled, the FortiGate unit buffers files as they are
downloaded. Once the entire file is captured, the FortiGate unit scans it. If no infection is found,
the file is sent along to the client. The client initiates the file transfer and nothing happens until
the FortiGate finds the file clean, and releases it. Users can be impatient, and if the file is large
or the download slow, they may cancel the download, not realizing that the transfer is in
progress.
Client comforting can send unscanned and therefore potentially infected content to the client.
You should only enable client comforting if you are prepared to accept this risk. Keeping the
client comforting interval high and the amount low will reduce the amount of potentially infected
data that is downloaded.
Client comforting is available for HTTP and FTP traffic. If your FortiGate unit supports SSL
content scanning and inspection, you can also configure client comforting for HTTPS and FTPS
traffic.
Antivirus scanning is configured in an antivirus profile, but it is enabled in a firewall policy. Once
the use of an antivirus profile is enabled and selected in one or more firewall policies, all the
traffic controlled by those firewall policies will be scanned according to the settings in that
profile.
In the Feature section found by going to System > Config > Features, you can enable or disable
2 aspects of the Antivirus Profile.
1. Antivirus will determine if the option to use Antivirus profiles is available.
2. Multiple Security Profiles will determine if you can configure any Antivirus profiles beyond
the default profile.
The Feature section can sometimes be misunderstood as to its actual effect. The enabling or
disabling of a feature in this section refers to its visibility within the GUI, not whether or not the
feature’s functionality will work. If you were to disable the Antivirus Profile feature it would
disappear from the GUI but not the CLI and configuration file. Since the functionality of the
FortiGate unit is based on the contents of the config file any profile referred to by the policy in
the configuration will be acted upon. The Feature section is primarily for keeping the GUI clean
and uncluttered by features that are not being used by the administrators.
As the use of antivirus these days is practically a minimum standard for security protection the
question left to decide is whether or not you wish to use multiple profiles in your configuration.
Antivirus profiles
From Security Profiles > Antivirus you can edit existing profiles or create and configure new
antivirus profiles that can then be applied to firewall policies. A profile is specific configuration
information that defines how the traffic within a firewall policy is examined and what action may
be taken based on the examination.
You can create multiple antivirus profiles for different antivirus scanning requirements. For
example, you create an antivirus profile that specifies only virus scanning for POP3 which you
then apply to the out-going firewall policy that is designed for users getting their email from the
mail server. You can also choose specific protocols, such as HTTP, that will be scanned and if
blocked, archived by the unit. This option is available only in the CLI.
Whether the mode of the antivirus detection is proxy-based or flow-based is also set within the
profile.
You have configured your FortiGate unit to stop viruses, but you’d like to confirm your settings
are correct. Even if you have a real virus, it would be dangerous to use for this purpose. An
incorrect configuration will allow the virus to infect your network.
To solve this problem, the European Institute of Computer Anti-virus Research has developed a
test file that allows you to test your antivirus configuration. The EICAR test file is not a virus. It
can not infect computers, nor can it spread or cause any damage. It’s a very small file that
contains a sequence of characters. Your FortiGate unit recognizes the EICAR test file as a virus
so you can safely test your FortiGate unit antivirus configuration.
Go to [Link] to download the test file ([Link]) or
the test file in a ZIP archive ([Link]).
If the antivirus profile applied to the security policy that allows you access to the Web is
configured to scan HTTP traffic for viruses, any attempt to download the test file will be
blocked. This indicates that you are protected.
Example Scenarios
Name default
• Block checked
HTTP checked
SMTP checked
POP3 checked
IMAP checked
MAPI checked
FTP checked
NNTP checked
3. Select Apply
4. Enable grayware scanning
config antivirus settings
set grayware enable
end
Name email-av
• Block checked
HTTP checked
SMTP checked
POP3 checked
IMAP checked
MAPI checked
FTP checked
NNTP checked
3. Select Apply
This section describes FortiGate web filtering for HTTP traffic. The three main parts of the web
filtering function, the Web Content Filter, the URL Filter, and the FortiGuard Web Filtering
Service interact with each other to provide maximum control over what the Internet user can
view as well as protection to your network from many Internet content threats. Web Content
Filter blocks web pages containing words or patterns that you specify. URL filtering uses URLs
and URL patterns to block or exempt web pages from specific sources. FortiGuard Web
Filtering provides many additional categories you can use to filter web [Link] following
topics are included in this section:
• Web filter concepts
• Inspections Modes
• FortiGuard Web Filtering Service
• Overriding FortiGuard website categorization
• SafeSearch
• YouTube Education Filter
• Static URL Filter
• Web content filter
• Advanced web filter configurations
• Configuring Web Filter Profiles
• Web filtering example
Web filtering is a means of controlling the content that an Internet user is able to view. With the
popularity of web applications, the need to monitor and control web access is becoming a key
component of secure content management systems that employ antivirus, web filtering, and
messaging security. Important reasons for controlling web content include:
• lost productivity because employees are accessing the web for non-business reasons
• network congestion — when valuable bandwidth is used for non-business purposes,
legitimate business applications suffer
• loss or exposure of confidential information through chat sites, non-approved email
systems, instant messaging, and peer-to-peer file sharing
• increased exposure to web-based threats as employees surf non-business-related web sites
• legal liability when employees access/download inappropriate and offensive material
• copyright infringement caused by employees downloading and/or distributing copyrighted
material.
As the number and severity of threats increase on the World Wide Web, the risk potential
increases within a company's network as well. Casual non-business related web surfing has
caused many businesses countless hours of legal litigation as hostile environments have been
created by employees who download and view offensive content. Web-based attacks and
Page 38
threats are also becoming increasingly sophisticated. Threats and web-based applications that
cause additional problems for corporations include:
• spyware/grayware
• phishing
• pharming
• instant messaging
• peer-to-peer file sharing
• streaming media
• blended network attacks.
Spyware, also known as grayware, is a type of computer program that attaches itself to a user’s
operating system. It does this without the user’s consent or knowledge. It usually ends up on a
computer because of something the user does such as clicking on a button in a pop-up
window. Spyware can track the user’s Internet usage, cause unwanted pop-up windows, and
even direct the user to a host web site. For further information, visit the FortiGuard Center.
Some of the most common ways of grayware infection include:
• downloading shareware, freeware, or other forms of file-sharing services
• clicking on pop-up advertising
• visiting legitimate web sites infected with grayware.
Phishing is the term used to describe attacks that use web technology to trick users into
revealing personal or financial information. Phishing attacks use web sites and email that claim
to be from legitimate financial institutions to trick the viewer into believing that they are
legitimate. Although phishing is initiated by spam email, getting the user to access the
attacker’s web site is always the next step.
Pharming is a next generation threat that is designed to identify and extract financial, and other
key pieces of information for identity theft. Pharming is much more dangerous than phishing
because it is designed to be completely hidden from the end user. Unlike phishing attacks that
send out spam email requiring the user to click to a fraudulent URL, pharming attacks require
no action from the user outside of their regular web surfing activities. Pharming attacks succeed
by redirecting users from legitimate web sites to similar fraudulent web sites that have been
created to look and feel like the authentic web site.
Instant messaging presents a number of problems. Instant messaging can be used to infect
computers with spyware and viruses. Phishing attacks can be made using instant messaging.
There is also a danger that employees may use instant messaging to release sensitive
information to an outsider.
Peer-to-peer (P2P) networks are used for file sharing. Such files may contain viruses.
Peer-to-peer applications take up valuable network resources and may lower employee
productivity but also have legal implications with the downloading of copyrighted or sensitive
company material.
Streaming media is a method of delivering multimedia, usually in the form of audio or video to
Internet users. Viewing streaming media impacts legitimate business by using valuable
bandwidth.
Blended network threats are rising and the sophistication of network threats is increasing with
each new attack. Attackers learn from each previous successful attack and enhance and
update attack code to become more dangerous and fast spreading. Blended attacks use a
combination of methods to spread and cause damage. Using virus or network worm techniques
combined with known system vulnerabilities, blended threats can quickly spread through email,
web sites, and Trojan applications. Examples of blended threats include Nimda, Code Red,
Slammer, and Blaster. Blended attacks can be designed to perform different types of attacks,
Inspections Modes
Proxy
Proxy-based inspection involves buffering the traffic and examining it as a whole before
determining an action. The process of having the whole of the data to analyze allow this process
to include more points of data to analyze than the flow-based or DNS methods.
The advantage of a proxy-based method is that the inspection can be more thorough than the
other methods, resulting in fewer false positive or negative results in the analysis of the data.
Flow-based
The Flow-based inspection method examines the file as it passes through the FortiGate unit
without any buffering. As each packet of the traffic arrives it is process and forwarded without
waiting for the complete file or web page, etc.
DNS
The DNS inspection method uses the same categories as the FortiGuard Service. It is
lightweight in terms of resource usage because it doesn't involve any proxy-based or
flow-based inspection.
A DNS request is typically the first part of any new session to a new website. This inspection
method takes advantage of that and places the results of the categorization of websites right on
the FortiGuard DNS servers. When the FortiGate resolves a URL, in addition to the IP address of
the website it also receives a domain rating.
In the same way that the flow-based inspection method had fewer filters and points of analysis
than the proxy-based inspection method, DNS has fewer settings still. All of its inspection is
based on the IP address, the domain name and the rating provided by the FortiGuard DNS
server.
If the DNS mode is chosen, the additional setting of a DNS action must be chosen. The options
are:
• Block - The traffic will be blocked and the session dropped.
• Redirect - The session will be redirected to a message page indicating to the user what is
happening.
FortiGuard Web Filter is a managed web filtering solution available by subscription from
Fortinet. FortiGuard Web Filter enhances the web filtering features supplied with your FortiGate
unit by sorting billions of web pages into a wide range of categories users can allow or block.
The FortiGate unit accesses the nearest FortiGuard Web Filter Service Point to determine the
category of a requested web page, and then applies the security policy configured for that user
or interface.
FortiGuard Web Filter includes over 45 million individual ratings of web sites that apply to more
than two billion pages. Pages are sorted and rated into several dozen categories administrators
can allow or block. Categories may be added or updated as the Internet evolves. To make
configuration simpler, you can also choose to allow or block entire groups of categories.
Blocked pages are replaced with a message indicating that the page is not accessible
according to the Internet usage policy.
FortiGuard Web Filter ratings are performed by a combination of proprietary methods including
text analysis, exploitation of the web structure, and human raters. Users can notify the
FortiGuard Web Filter Service Points if they feel a web page is not categorized correctly, so that
the service can update the categories in a timely fashion.
Before you begin to use the FortiGuard Web Filter options you should verify that you have a
valid subscription to the service for your FortiGate firewall.
Is the URL
Query FortiGuard Deny access to the classification set
Start
for URL category URL and stop any to block or
and classification running quota timer allow?
User attempts to Block Allow
load a URL
Block Yes
No
No
Is the URL Is
category set FortiGuard Quota Allow access
to block or exempt for the to the URL
allow? Category?
Allow Yes
Block
No
Allow
Is there a Is the URL Is Is there any Yes
classification classification set FortiGuard Quota time remaining Start the category
for this URL? to block or enabled for the for this category timer and allow
allow? Category? quota? access to the URL
Yes Yes
No Block No No
No
Is Is Is Yes
Is there any
Allow access to the FortiGuard Quota FortiGuard Quota FortiGuard Quota Start the classification
time remaining
URL and stop any enabled for the exempt for the enabled for the timer and allow
for this classification
running quota timer category group? category group? classification? access to the URL
No No No Yes quota?
Yes Yes No
Yes
The use of FortiGuard Web Filter quotas requires that users authenticate to gain web access.
The quotas are ignored if applied to a security policy in which user authentication is not
required.
When a user first attempts to access a URL, they’re prompted to authenticate with the FortiGate
unit. When they provide their user name and password, the FortiGate unit recognizes them,
determines their quota allowances, and monitors their web use. The category and classification
of each page they visit is checked and FortiGate unit adjusts the user’s remaining available
quota for the category or classification.
Editing the web filter profile resets the quota timers for all users.
Quota hierarchy
You can apply quotas to categories and category groups. Only one quota per user can be active
at any one time. The one used depends on how you configure the FortiGuard Web Filter.
When a user visits a URL, the FortiGate unit queries the FortiGuard servers for the category of
the URL. From highest to lowest, the relative priority of the quotas are:
1. Category
2. Category group
In most things there is an exception to the rule. When it comes to the rules about who is allowed
to go to which websites in spite of the rules or in this case, policies, it seems that there are more
exceptions than to most rules. There are numerous valid reasons and scenarios for exceptions
so it follows that there needs to be a way to accommodate this exceptions.
It is usually recommended that you choose a category that you know will be addressed in
existing Webfilter profiles so that you will not need to engage in further configuration.
The Concept
When a Web filter profile is overridden it does not necessarily remove all control and restrictions
that were previously imposed by the Web Filter. The idea is to replace a restrictive filter with a
different one. In practice, it makes sense that this will likely be a profile that is less restrictive the
Identity or Address
In either case what these override features do is, for specified users, user groups or IP
addresses, allow sites blocked by Web Filtering profiles to be overridden for a specified length
of time. The drawback of this method of override is that it takes more planning and preparation
than the rating override method. The advantage is that once this has been set up, this method
requires very little in the way of administrative overhead to maintain.
When planning to use the alternative profile approach keep in mind the following: In Boolean
terms, one of the following "AND" conditions has to be met before overriding the Web Filter is
possible
Based on the IP address:
• The Web Filter profile must be specified as allowing overrides
• AND the user's computer is one of the IP addresses specified
• AND the time is within the expiration time frame.
While the conditions are fewer for this situation there is less control over who has the ability to
bypass the filtering configured for the site. All someone has to do is get on a computers that is
allowed to override the Web Filter and they have access.
Based on user group:
• The Web Filter profile must be specified as allowing overrides
• AND the policy the traffic is going through must be identity based
• AND the user's credentials matches the identity credentials specified
• AND the time is within the expiration time frame.
This method is the one most likely to be used as it gives more control in that the user has to
have the correct credential and more versatile because the user can use the feature from any
computer that uses the correct policy to get out on the Internet.
Settings
When using an alternate profile approach to Web Filter overrides the following settings are used
to determine authentication and outcome. Not every setting is used in both methods but
enough of them are common to describe them collectively.
Apply to Group(s)
This is found in the Allow Blocked Overrides configuration. Individual users can not be selected.
You can select one or more of the User Groups that are recognized my the FortiGate unit,
Original Profile
This is found in the Administrative Override configuration. In the Allow Blocked Overrides
setting the configuration is right inside the profile so there was no need to specify which profile
was the original one, but the Administrative Override setup is done separately from the profiles
themselves.
Duration Mode
This option is available only in the “Allow Blocked Overrides" variation. The Administrative
Override sets a specified time frame that is always used for that override. The available options
from the drop down menu are:
Constant
Using this setting will mean that what ever is set as the duration will be the length of time
that the override will be in effect. If the Duration variable is set to 15 minutes the length of the
override will always be 15 minutes. The option will be visible in the Override message page
but the setting will be greyed out.
Ask
Using this setting will give the person the option of setting the duration to the override when
it is engaged. The duration time which is greyed out if the Constant setting is used will be
dark and editable. The user can set the duration in terms of Day, Hours and or Minutes.
Duration
Duration is on of the areas where the two variations takes a different approach, on two aspects
of the setting. As already indicated the “Administrative Override” only uses a static time frame
there is no option for the user to select on the fly how long it will last. The other way in which the
two variation differ is that the “Allow Blocked Overrides” starts the clock when the user logs in
with his credentials. For example, if the duration is 1 hour and John initiates an override at 2:00
p.m. on January 1, at the end of that hour he will revert back to using the original profile but he
can go back and re-authenticate and start the process over again. The Administrative override
variation starts the clock from when the override was configured, which is why is shows an
expiration date and time when your are configuring it.
This option, which is available when the Duration Mode is set to Constant is the time in minutes
that the override will last when engaged by the user.
When setting up a constant duration in the Web Based Interface, minutes is the only option for
units of time. To set a longer time frame or to use the units of hours or days you can use the CLI.
config webfilter profile
edit <name of webfilter profile>
config override
set ovrd-dur <###d##h##m>
end
When configuring the duration you don't have to set a value for a unit you are not using. If you
are not using days or hours you can use
set ovrd-dur 30m
instead of
set ovrd-dur 0d0h30m
However, each of the units of time variable has their own maximum level
###d cannot be more than 364
##h cannot be more than 23
##m cannot be more than 59
SafeSearch
SafeSearch is a feature of popular search sites that prevents explicit web sites and images from
appearing in search results. Although SafeSearch is a useful tool, especially in educational
environments, the resourceful user may be able to simply turn it off. Enabling SafeSearch for the
supported search sites enforces its use by rewriting the search URL to include the code to
indicate the use of the SafeSearch feature. For example, on a Google search it would mean
adding the string “&safe=active” to the URL in the search.
The search sites supported are:
• Google
• Yahoo
• Bing
• Yandex
Search Keywords
There is also the capability to log the search keywords used in the search engines.
YouTube for Schools is a way to access educational videos from inside a school network. This
YouTube feature gives schools the ability to access a broad set of educational videos on
YouTube EDU and to select the specific videos that are accessible from within the school
network.
Before this feature can be used an account has to be set up for the school with YouTube. Once
the account is set up a unique ID will be provided. This ID becomes part of the filter that is used
to all access to the educational content of YouTube for use in schools even if YouTube is
blocked by the policy.
More details can be found by going to [Link]
You can allow or block access to specific URLs by adding them to the Web Site Filter list. You
add the URLs by using patterns containing text and regular expressions. The FortiGate unit
allows or blocks web pages matching any specified URLs or patterns and displays a
replacement message instead.
URL blocking does not block access to other services that users can access with a web
browser. For example, URL blocking does not block access to ftp:// [Link]. Instead,
use firewall policies to deny ftp connections.
When adding a URL to the URL filter list, follow these rules:
• Type a top-level URL or IP address to control access to all pages on a web site. For
example, [Link] or [Link] controls access to all pages at this
web site.
• Enter a top-level URL followed by the path and file name to control access to a single page
on a web site. For example, [Link]/[Link] or
[Link]/[Link] controls access to the news page on this web site.
• To control access to all pages with a URL that ends with [Link], add [Link]
to the filter list. For example, adding [Link] controls access to [Link],
[Link], [Link], and so on.
• Control access to all URLs that match patterns using text and regular expressions (or
wildcard characters). For example, example.* matches [Link], [Link],
[Link] and so on.
URLs with an action set to exempt or monitor are not scanned for viruses. If users on the
network download files through the FortiGate unit from a trusted web site, add the URL of this
web site to the URL filter list with an action to pass it so the FortiGate unit does not virus scan
files downloaded from this URL.
URL formats
When adding a URL to the URL filter list, follow these rules:
If virtual domains are enabled on the unit, web filtering features are configured globally. To
access these features, select Global Configuration on the main menu.
Block
Attempts to access any URLs matching the URL pattern are denied. The user will be presented
with a replacement message.
Allow
Any attempt to access a URL that matches a URL pattern with an allow action is permitted. The
traffic is passed to the remaining antivirus proxy operations, including FortiGuard Web Filter,
web content filter, web script filters, and antivirus scanning.
Allow is the default action. If a URL does not appear in the URL list, it is permitted.
Monitor
Traffic to, and reply traffic from, sites matching a URL pattern with a monitor be allowed through
in the same way as the “Allow” action. The difference with the Monitor action being that a log
message will be generated each time a matching traffic session is established. The requests will
Exempt
Exempt allows trusted traffic to bypass the antivirus proxy operations, but it functions slightly
differently. In general, if you’re not certain that you need to use the Exempt action, use Monitor.
HTTP 1.1 connections are persistent unless declared otherwise. This means the connections
will remain in place until closed or the connection times out. When a client loads a web page,
the client opens a connection to the web server. If the client follows a link to another page on
the same site before the connection times out, the same connection is used to request and
receive the page data.
When you add a URL pattern to a URL filter list and apply the Exempt action, traffic sent to and
replies traffic from sites matching the URL pattern will bypass all antivirus proxy operations. The
connection itself inherits the exemption. This means that all subsequent reuse of the existing
connection will also bypass all antivirus proxy operations. When the connection times out, the
exemption is cancelled.
For example, consider a URL filter list that includes [Link]/files configured with the
Exempt action. A user opens a web browser and downloads a file from the URL
[Link]/[Link]. This URL does not match the URL pattern so it is scanned for
viruses. The user then downloads [Link]/files/[Link] and since this URL
does match the pattern, the connection itself inherits the exempt action. The user then
downloads [Link]/[Link]. Although this URL does not match the exempt URL
pattern, a previously visited URL did, and since the connection inherited the exempt action and
was re-used to download a file, the file is not scanned.
If the user next goes to an entirely different server, like [Link]/photos, the connection
to the current server cannot be reused. A new connection to [Link] is established. This
connection is not exempt. Unless the user goes back to [Link] before the connection to
that server times out, the server will close the connection. If the user returns after the
connection is closed, a new connection to [Link] is created and it is not exempt until the
user visits a URL that matches the URL pattern.
Web servers typically have short time-out periods. A browser will download multiple
components of a web page as quickly as possible by opening multiple connections. A web
page that includes three photos will load more quickly if the browser opens four connections to
the server and downloads the page and the three photos at the same time. A short time-out
period on the connections will close the connections faster, allowing the server to avoid
unnecessarily allocating resources for a long period. The HTTP session time-out is set by the
server and will vary with the server software, version, and configuration.
Using the Exempt action can have unintended consequences in certain circumstances. You
have a web site at [Link] and since you control the site, you trust the contents and
configure [Link] as exempt. But [Link] is hosted on a shared server with a
dozen other different sites, each with a unique domain name. Because of the shared hosting,
they also share the same IP address. If you visit [Link], your connection your site
becomes exempt from any antivirus proxy operations. Visits to any of the 12 other sites on the
same server will reuse the same connection and the data you receive is exempt from scanned.
Use of the Exempt action is not suitable for configuration in which connections through the
FortiGate unit use an external proxy. For example, you use [Link] for all outgoing
web access. Also, as in the first example, URL filter list that includes a URL pattern of
[Link]/files configured with the Exempt action. Users are protected by the antivirus
protection of the FortiGate unit until a user visits a URL that matches the of
[Link]/files URL pattern. The pattern is configured with the Exempt action so the
connection to the server inherits the exemption. With a proxy however, the connection is from
Status
The Web Site Filter has the option to either enable or disable individual web sites in the list. This
allows for the temporary removal of the actions against a site so that it can be later reengaged
without having to rewrite the configuration.
Referrer URL
A new variable has been added to the Static URL Filter, referrer-host. If a referrer is
specified, the hostname in the referer field of the HTTP require will be compared for any entry
that contains the matching URL. If the referer matches, then the specified action will be
performed by proxy.
You can control web content by blocking access to web pages containing specific words or
patterns. This helps to prevent access to pages with questionable material. You can also add
words, phrases, patterns, wild cards and Perl regular expressions to match content on web
pages. You can add multiple web content filter lists and then select the best web content filter
list for each web filter profile.
Enabling web content filtering involves three separate parts of the FortiGate configuration.
• The security policy allows certain network traffic based on the sender, receiver, interface,
traffic type, and time of day.
• The web filter profile specifies what sort of web filtering is applied.
• The web content filter list contains blocked and exempt patterns.
The web content filter feature scans the content of every web page that is accepted by a
security policy. The system administrator can specify banned words and phrases and attach a
numerical value, or score, to the importance of those words and phrases. When the web
content filter scan detects banned content, it adds the scores of banned words and phrases in
the page. If the sum is higher than a threshold set in the web filter profile, the FortiGate unit
blocks the page.
Enabling the web content filter and setting the content threshold
When you enable the web content filter, the web filter will block any web pages when the sum of
scores for banned content on that page exceeds the content block threshold. The threshold will
be disregarded for any exemptions within the web filter list.
Cookie filter
Enable to filter cookies from web traffic. Web sites using cookies may not function properly with
this enabled.
FortiGuard Web Filter ratings for IP addresses are not updated as quickly as ratings for URLs.
This can sometimes cause the FortiGate unit to allow access to sites that should be blocked, or
to block sites that should be allowed.
An example of how this would work would be if a URL’s rating based on the domain name
indicated that it belonged in the category Lingerie and Swimsuit, which is allowed but the
category assigned to the IP address was Pornography which has an action of Block, because
the Pornography category has a higher weight the effective action is Block.
In older versions of FortiOS there was a character limitation for the URL of 2048 bytes or
approximately 321 characters. If the URL you were trying to reach was longer the URL sent to
FortiGuard would be truncated and the service would be unable to categorize the site. Starting
in version 5 of the firmware the parsed URL has been increase to 4Kilobytes, effectively
doubling the length of a URL capable of being categorized.
If you look at your logs carefully, you may notice that not every URL connection in the log shows
a category. They are left blank. If you take one of those URL and enter it in the FortiGuard
website designed to show the category for a URL it will successfully categorize it.
The reason for this is that to optimize speed throughput and reduce the load on the FortiGuard
servers the FortiGate does not determine a category rating on scripts and CSS files.
To enable the web content filter and set the content block threshold
1. Go to the Edit Web Filter Profile window.
2
3
4
5.
Web filtering is particularly important for protecting school-aged children. There are legal issues
associated with improper web filtering as well as a moral responsibility not to allow children to view
inappropriate material. The key is to design a web filtering system in such a way that students and staff
do not fall under the same web filter profile in the FortiGate configuration. This is important because the
staff may need to access websites that are off-limits to the [Link] district
The background for this scenario is a school district with more than 2300 students and 500
faculty and staff in a preschool, three elementary schools, a middle school, a high school, and a
continuing education center. Each elementary school has a computer lab and the high school
has three computer labs with connections to the Internet. Such easy access to the Internet
ensures that every student touches a computer every day.
With such a diverse group of Internet users, it was not possible for the school district to set
different Internet access levels. This meant that faculty and staff were unable to view websites
Using the application control Security Profile feature, your FortiGate unit can detect and take
action against network traffic depending on the application generating the traffic. Based on
FortiGate Intrusion Protection protocol decoders, application control is a user-friendly and
powerful way to use Intrusion Protection features to log and manage the behavior of application
traffic passing through the FortiGate unit. Application control uses IPS protocol decoders that
can analyze network traffic to detect application traffic even if the traffic uses non-standard
ports or protocols.
The FortiGate unit can recognize the network traffic generated by a large number of
applications. You can create application control sensors that specify the action to take with the
traffic of the applications you need to manage and the network on which they are active, and
then add application control sensors to the firewall policies that control the network traffic you
need to monitor.
Fortinet is constantly increasing the list of applications that application control can detect by
adding applications to the FortiGuard Application Control Database. Because intrusion
protection protocol decoders are used for application control, the application control database
is part of the FortiGuard Intrusion Protection System Database and both of these databases
have the same version number.
You can find the version of the application control database that is installed on your unit, by
going to the License Information dashboard widget and find IPS Definitions version.
You can go to the FortiGuard Application Control List to see the complete list of applications
supported by FortiGuard. This web page lists all of the supported applications. You can select
any application name to see details about the application.
If you enable virtual domains (VDOMs) on the Fortinet unit, you need to configure application
control separately for each virtual domain.
The following topics are included in this section:
• Application control concepts
• Application considerations
• Application traffic shaping
• Application control monitor
• Enable application control
• Application control examples
You can control network traffic generally by the source or destination address, or by the port,
the quantity or similar attributes of the traffic itself in the security policy. If you want to control
the flow of traffic from a specific application, these methods may not be sufficient to precisely
define the traffic. To address this problem, the application control feature examines the traffic
itself for signatures unique to the application generating it. Application control does not require
knowledge of any server addresses or ports. The FortiGate unit includes signatures for over
1000 applications, services, and protocols.
Updated and new application signatures are delivered to your FortiGate unit as part of your
FortiGuard Application Control Service subscription. Fortinet is constantly increasing the
Page 68
number of applications that application control can detect by adding applications to the
FortiGuard Application Control Database. Because intrusion protection protocol decoders are
used for application control, the application control database is part of the FortiGuard Intrusion
Protection System Database and both of these databases have the same version number.
To view the version of the application control database installed on your FortiGate unit, go to the
License Information dashboard widget and find the IPS Definitions version.
To see the complete list of applications supported by FortiGuard Application Control go to the
FortiGuard Application Control List. This web page lists all of the supported applications. You
can select any application name to see details about the application.
Allow
This action allows the targeted traffic to continue on through the FortiGate unit.
Monitor
This action allows the targeted traffic to continue on through the FortiGate unit but logs the
traffic for analysis.
Block
This action prevents all traffic from reaching the application and logs all occurrences.
Reset
This action resets the session or connection between the FortiGate and the initiating node.
Traffic Shaping
This action presents a number of default traffic shaping options:
• guarantee-100kbps
• high-priority
• low-priority
• medium-priority
• shared-1M-pipe
Application considerations
Some applications behave differently from most others. You should be aware of these
differences before using application control to regulate their use.
IM applications
The Application Control function for a number of IM application is not in the Web Based
Manager, in the CLI of the FortiGate unit. These applications are:
• AIM
• ICQ
• MSN
• Yahoo
These applications are controlled by either permitting or denying the users from logging in to the
service. Individual IM accounts are configured as to whether or not they are permitted and then
there is a global policy for how to action unknown users, by the application, and whether to add
the user to the black list or the white list.
The configuration details for these settings can be found in the CLI Reference guide under the
heading of imp2p.
Skype
Based on the NAT firewall type, Skype takes advantage of several NAT firewall traversal
methods, such as STUN (Simple Traversal of UDP through NAT), ICE (Interactive Connectivity
Establishment) and TURN (Traversal Using Relay NAT), to make the connection.
The Skype client may try to log in with either UDP or TCP, on different ports, especially
well-known service ports, such as HTTP (80) and HTTPS (443), because these ports are
normally allowed in firewall settings. A client who has previously logged in successfully could
start with the known good approach, then fall back on another approach if the known one fails.
SPDY
SPDY (pronounced speedy, it’s a trademarked name not an acronym) is a networking protocol
developed to increase the speed and security of HTML traffic. It was developed primarily by
Google. The Application Control engine recognizes this protocol and its required SSL/TLS
component within Application Control sensors. It is counted as part of application traffic for
Google and other sources that use the protocol.
Application Control is not just a module that is inserted in to the OS and works independently of
all of the other components.
WAN Optimization
There is a feature that enables both IPS and Application Control on both non-HTTP WANOpt
traffic and HTTP-tunneled traffic through HTTP CONNECT. The basic idea is that it hooks a
scan connection to a port so that traffic will be redirected to the IPS engine before forwarding to
a different module.
You can apply traffic shaping for application list entries you configure to pass. Traffic shaping
enables you to limit or guarantee the bandwidth available to the application or applications
specified in an application list entry. You can also prioritize traffic by using traffic shaping.
You can create or edit traffic shapers by going to Policy & Objects > Objects > Traffic Shapers.
Per-IP traffic shapers are not available for use in application traffic [Link] more information
about traffic shaping, see “Traffic shaping methods” on page 2116.
Shaper re-use
Shapers are created independently of firewall policies and application sensors so you are free to
reuse the same shapers in multiple list entries and policies. Shared shapers can be configured
to apply separately to each security policy or across all policies. This means that if a shaper is
configured to guaranteed 1000 KB/s bandwidth, each security policy using the shaper will have
its own 1000 KB/s reserved, or all of the policies using the shaper will share a pool if 1000 KB/s,
depending on how it is configured.
The same thing happens when a shaper is used in application sensors. If an application sensor
using a shaper is applied to two separate policies, how the bandwidth is limited or guaranteed
depends on whether the shaper is set to apply separately to each policy or across all policies. In
fact, if a shaper is applied directly to one security policy, and it is also included in an application
sensor that is applied to another security policy, the same issue occurs. How the bandwidth is
limited or guaranteed depends on the shaper configuration.
If a shaper is used more than once within a single application sensor, all of the applications
using the shaper are restricted to the maximum bandwidth or share the same guaranteed
bandwidth.
For example, you want to limit the bandwidth used by Skype and Facebook chat to no more
than 100 KB/s. Create a shaper, enable Maximum Bandwidth, and enter 100. Then create an
application sensor with an entry for Skype and another entry for Facebook chat. Apply the
shaper to each entry and select the application sensor in the security policy that allows your
users to access both services.
This configuration uses the same shaper for each entry, so Skype and Facebook chat traffic are
limited to no more than 100 KB/s in total. That is, traffic from both applications is added and the
total is limited to 100 KB/s. If you want to limit Skype traffic to 100 KB/s and Facebook chat
traffic to 100 KB/s, you must use separate shapers for each application control entry.
The application monitor enables you to gain an insight into the applications generating traffic on
your network. When monitor is enabled in an application sensor entry and the list is selected in
a security policy, all the detected traffic required to populate the selected charts is logged to the
Because the application monitor relies on a SQL database, the feature is available only on
FortiGate units with an internal hard drive.
While the monitor charts are similar to the top application usage dashboard widget, it offers
several advantages. The widget data is stored in memory so when you restart the FortiGate unit,
the data is cleared. Application monitor data is stored on the hard drive and restarting the
system does not affect old monitor data.
Application monitor allows you to choose to compile data for any or all of three charts: top ten
applications by bandwidth use, top ten media users by bandwidth, and top ten P2P users by
bandwidth. Further, there is a chart of each type for the traffic handled by each security policy
with application monitor enabled. The top application usage dashboard widget shows only the
bandwidth used by the top applications since the last system restart.
Application control examines your network traffic for traffic generated by the applications you
want it to control.
You will notice that there are some differences in the naming convention between the Web
Based Interface and the CLI. For instance the Action in the CLI is “pass” and the Action in the
Web Based Manager is “Monitor”.
The FortiGate Intrusion Protection system combines signature detection and prevention with
low latency and excellent reliability. With intrusion protection, you can create multiple IPS
sensors, each containing a complete configuration based on signatures. Then, you can apply
any IPS sensor to any security policy.
This section describes how to configure the FortiGate Intrusion Protection settings.
If you enable virtual domains (VDOMs) on the FortiGate unit, intrusion protection is configured
separately for each virtual domain.
The following topics are included:
• IPS concepts
• Enable IPS scanning
• Configure IPS options
• Enable IPS packet logging
• IPS examples
IPS concepts
The FortiGate intrusion protection system protects your network from outside attacks. Your
FortiGate unit has two techniques to deal with these attacks: anomaly- and signature-based
defense.
Anomaly-based defense
Anomaly-based defense is used when network traffic itself is used as a weapon. A host can be
flooded with far more traffic than it can handle, making the host inaccessible. The most
common example is the denial of service (DoS) attack, in which an attacker directs a large
number of computers to attempt normal access of the target system. If enough access
attempts are made, the target is overwhelmed and unable to service genuine users. The
attacker does not gain access to the target system, but it is not accessible to anyone else.
The FortiGate DoS feature will block traffic above a certain threshold from the attacker and
allow connections from other legitimate users. The DoS policy configuration information can be
found in the Firewall Handbook.
Signature-based defense
Signature-based defense is used against known attacks or vulnerability exploits. These often
involve an attacker attempting to gain access to your network. The attacker must communicate
with the host in an attempt to gain access and this communication will include particular
commands or sequences of commands and variables. The IPS signatures include these
command sequences, allowing the FortiGate unit to detect and stop the attack.
Signatures
IPS signatures are the basis of signature-based intrusion protection. Every attack can be
reduced to a particular string of commands or a sequence of commands and variables.
Page 78
Signatures include this information so your FortiGate unit knows what to look for in network
traffic.
Signatures also include characteristics about the attack they describe. These characteristics
include the network protocol in which the attack will appear, the vulnerable operating system,
and the vulnerable application.
To view the complete list of signatures, go to Security Profiles > Intrusion Protection > IPS
Signatures. This will include the predefined signatures and any custom signatures that you may
have created.
Protocol decoders
Before examining network traffic for attacks, the IPS engine uses protocol decoders to identify
each protocol appearing in the traffic. Attacks are protocol-specific, so your FortiGate unit
conserves resources by looking for attacks only in the protocols used to transmit them. For
example, the FortiGate unit will only examine HTTP traffic for the presence of a signature
describing an HTTP attack.
IPS engine
Once the protocol decoders separate the network traffic by protocol, the IPS engine examines
the network traffic for the attack signatures.
IPS sensors
The IPS engine does not examine network traffic for all signatures, however. You must first
create an IPS sensor and specify which signatures are included. Add signatures to sensors
individually using signature entries, or in groups using IPS filters.
To view the IPS sensors, go to Security Profiles > Intrusion Protection > IPS Sensor.
IPS filters
IPS sensors contain one or more IPS filters. A filter is a collection of signature attributes that you
specify. The signatures that have all of the attributes specified in a filter are included in the IPS
filter.
For example, if your FortiGate unit protects a Linux server running the Apache web server
software, you could create a new filter to protect it. By setting OS to Linux, and Application to
Apache, the filter will include only the signatures that apply to both Linux and Apache. If you
wanted to scan for all the Linux signatures and all the Apache signatures, you would create two
filters, one for each.
To view the filters in an IPS sensor, go to Security Profiles > Intrusion Protection > IPS Sensor,
select the IPS sensor containing the filters you want to view, and choose Edit.
Policies
To use an IPS sensor, you must select it in a security policy or an interface policy. An IPS sensor
that it not selected in a policy will have no effect on network traffic.
Enabling IPS scanning involves two separate parts of the FortiGate unit:
• The security policy allows certain network traffic based on the sender, receiver, interface,
traffic type, and time of day. Firewall policies can also be used to deny traffic, but those
policies do not apply to IPS scanning.
• The IPS sensor contains filters, signature entries, or both. These specify which signatures
are included in the IPS sensor.
When IPS is enabled, an IPS sensor is selected in a security policy, and all network traffic
matching the policy will be checked for the signatures in the IPS sensor.
Advanced
Application
Refers to the vendor or type of application affected by the attack.
The options include:.
CGI_app Cisco HP
This list can be expanded to include more options by selecting the [show more...] link. The
additional options include:
ASP_app CA DB2
IM Ipswitch MailEnable
Protocol
Refers to the protocol that is the vector for the attack.
The options include:
This list can be expanded to include more options by selecting the [show more...] link. The
additional options include:
BO DCERPC DHCP
DNP3 H323 IM
Other
Action Description
Signature Default All predefined signatures have an Action attribute that is set to Pass
or Drop. This means that if a signature included in the filter has an
Action setting of Pass, traffic matching the signature will be detected
and then allowed to continue to its destination. Select Accept
signature defaults use the default action for each included signature.
Note: to see what the default for a signature is, go to the IPS
Signatures page and enable the column Action, then find the row
with the signature name in it.
Monitor All Select Monitor all to pass all traffic matching the signatures included
in the filter, regardless of their default Action setting.
Block All Select Block all to drop traffic matching any the signatures included
in the filter.
Quarantine The quarantine based on the attacker’s IP Address - Traffic from the
Attacker’s IP address is refused until the expiration time from the
trigger is reached.
2. Expires (time frame that the quarantine will be in effect):
• 5 Minute(s)
• 30 Minutes(s)
• 1 Hour(s)
• 1 Day(s)
• 1 Week(s)
• 1 Month(s)
7 Select OK.
The filter is created and added to the filter list.
Searching manually
Signatures are displayed in a paged list, with 50 signatures per page. The bottom of the screen
shows the current page and the total number of pages. You can enter a page number and press
enter, to skip directly to that page. Previous Page and Next Page buttons move you through the
list, one page at a time. The First Page and Last Page button take you to the beginning or end of
the list.
Applying filters
You can enter criteria for one of more columns, and only the signatures matching all the
conditions you specify will be listed.
To apply filters
1. Go to Security Profiles > Intrusion Protection. Select [View IPS Signatures].
2. Select column by which to filter.
3. Select the funnel/filter icon and enter the value or values to filter by.
4. Use additional columns as needed to refine search.
The available options vary by column. For example, Enable allows you to choose between two
options, while OS has multiple options, and you may select multiple items together. Filtering by
name allows you to enter a text string and all signature names containing the string will be
displayed.
IPS processing in an HA cluster is no different than with a single FortiGate unit, from the point of
view of the network user. The difference appears when a secondary unit takes over from the
primary, and what happens depends on the HA mode.
Active-passive
In an active-passive HA cluster, the primary unit processes all traffic just as it would in a
stand-alone configuration. Should the primary unit fail, a secondary unit will assume the role of
Active-active
The fail-over process in an active-active cluster is similar to an active-passive cluster. When the
primary unit fails, a secondary unit takes over and traffic processing continues. The
load-balancing schedule used to distribute sessions to the cluster members is used by the new
primary unit to redistribute sessions among the remaining subordinate units. If session pick-up
is not enabled, the sessions active on the failed primary are lost, and the sessions redistributed
among the secondary units may also be lost. If session pick-up is enabled, all sessions are
handled according to their last-known state.
For more information about HA options and settings, see “High Availability” on page 1105.
There are a number of CLI commands that influence how IPS functions.
Hardware Acceleration
In order to provide control over the hardware’s processing of IPS there are commands to
configure and control the hardware acceleration of IPS. There are two settings that can be
chosen, one for the network processor and one for the content processor.
Network processor acceleration can be disabled or set to enable basic acceleration.
Content processor acceleration can be disabled or set to either basic or advanced acceleration.
These Settings are only found in the CLI:
config ips global
set np-accel-mode {none | basic}
set cp-accel-mode {none | basic | advanced}
end
Configuring fail-open
If the IPS engine fails for any reason, it will fail open by default. This applies for inspection of all
the protocols inspected by FortiOS IPS protocol decoders, including but not limited to HTTP,
HTTPS, FTP, SMTP, POP3, IMAP, etc. This means that traffic continues to flow without IPS
scanning. If IPS protection is more important to your network than the uninterrupted flow if
network traffic, you can disable this behavior using the fail-open CLI command:
config ips global
set fail-open {enable | disable}
end
The default setting is enable.
Packet logging saves the network packets containing the traffic matching an IPS signature to
the attack log. The FortiGate unit will save the logged packets to wherever the logs are
configured to be stored, whether memory, internal hard drive, a FortiAnalyzer unit, or the
FortiGuard Analysis and Management Service.
You can enable packet logging in the filters. Use caution in enabling packet logging in a filter.
Filters configured with few restrictions can contain thousands of signatures, potentially resulting
in a flood of saved packets. This would take up a great deal of space, require time to sort
through, and consume considerable system resources to process. Packet logging is designed
as a focused diagnostic tool and is best used with a narrow scope.
Although logging to multiple FortiAnalyzer units is supported, packet logs are not sent to the
secondary and tertiary FortiAnalyzer units. Only the primary unit receives packet logs.
IPS examples
Internal Network
Po
rt 1
Po
rt 2
Ex
ter
na
l
Main Firewall
Web Server
Create an entry
1. Select the Create New.
2. For Sensor Type choose Specify Signatures.
3. Rather than search through the signature list, use the name filter by selecting the search icon
over the header of the Signature column.
4. Enter EICAR in the Search field.
5. Highlight the [Link] signature by clicking on it.
6. Select Block All as the Action.
7. Enable Packet Logging.
8. Select OK to save the IPS sensor.
You are returned to the IPS sensor list. The EICAR test sensor appears in the list.
Add the IPS sensor to the security policy allowing Internet access
1. Go to Policy > Policy > IPv4.
2. Select the security policy that allows you to access the Internet.
3. Select the Edit icon.
4. Turn ON Log Allowed Traffic.
a. Select All Sessions
5. Enable the IPS option.
6. Choose EICAR test from the available IPS sensors.
7. Select OK.
With the IPS sensor configured and selected in the security policy, the FortiGate unit blocks any
attempt to download the EICAR test file.
Assumptions
As shown in other examples and network diagrams throughout this document, the Example
Corporation has a pair of FortiGate-620B units in an HA cluster. To simplify this example, the
cluster is replaced with a single FortiGate-620B.
An ASM-CE4 is installed in the FortiGate-620B.
The network is configured as shown in Figure 5.
Network configuration
The Example Corporation network needs minimal changes to incorporate the ASM-CE4.
Interface amc-sw1/1 of the ASM-CE4 is connected to the Internet and interface amc-sw1/1 is
connected to the web server.
Since the main office network is connected to port2 and the Internet is connected to port1, a
switch is installed to allow both port1 and amc-sw1/1 to be connected to the Internet.
Internal network
Web server
[Link]
Switch
Internet
The switch used to connect port1 and amc-sw1/1 to the Internet must be able to handle any
SYN flood, all of the legitimate traffic to the web site, and all of the traffic to and from the
Example Corporation internal network. If the switch can not handle the bandwidth, or if the
connection to the service provider can not provide the required bandwidth, traffic will be lost.
IPS Sensor
You can group signatures into IPS sensors for easy selection when applying to firewall policies.
You can define signatures for specific types of traffic in separate IPS sensors, and then select
those sensors in profiles designed to handle that type of traffic. For example, you can specify all
Page 96
Table 2: Valid syntax for custom signature fields
KEYWORD Each keyword must start with a pair The keyword is used to identify
of dashes (--), and consist of a string a parameter. See “Custom
of 1 to 19 characters. signature keywords” on page 98
for tables of supported
Normally, keywords are an English
keywords.
word or English words connected by
an underscore (_). Keywords are case
insensitive.
VALUE Double quotes (") must be used The value is set specifically for a
around the value if it contains a space parameter identified by a
and/or a semicolon (;). keyword.
If the value is NULL, the space
between the KEYWORD and VALUE
can be omitted.
Values are case sensitive.
Note: If double quotes are used for
quoting the value, the double quotes
are not considered as part of the
value string.
--name <name_str>; Enter the name of the rule. A rule name must be unique. If
you are using VDOMs, custom signatures appear only in the
VDOM in which you create them. You can use the same rule
name for signatures in different VDOMs.
The name you assign must be a string greater than 0 and
less than 64 characters in length.
Example:
--name "Buffer_Overflow";
Fortinet Technologies Inc. Page 100 Security Profiles for FortiOS 5.2
Table 7: Other keywords
Fortinet Technologies Inc. Page 101 Security Profiles for FortiOS 5.2
Table 7: Other keywords (continued)
Fortinet Technologies Inc. Page 102 Security Profiles for FortiOS 5.2
2. Choose a name for the custom signature
Every custom signature requires a name, so it is a good practice to assign a name before
adding any other keywords.
Use the --name keyword to assign the custom signature a name. The name value follows
the keyword after a space. Enclose the name value in double-quotes:
F-SBID( --name "[Link]"; )
The signature, as it appears here, will not do anything if you try to use it. It has a name, but
does not look for any patterns in network traffic. You must specify a pattern that the
FortiGate unit will search for.
3. Add a signature pattern
Use the --pattern keyword to specify what the FortiGate unit will search for:
F-SBID( --name "[Link]"; --pattern "[Link]"; )
The signature will now detect the [Link] URL appearing in network traffic. The
custom signature should only detect the URL in HTTP traffic, however. Any other traffic with
the URL should be allowed to pass. For example, an email message to or from [Link]
should not be stopped.
4. Specify the service
Use the --service keyword to limit the effect of the custom signature to only the HTTP
protocol.
F-SBID( --name "[Link]"; --pattern "[Link]";
--service HTTP; )
The FortiGate unit will limit its search for the pattern to the HTTP protocol. Even though the
HTTP protocol uses only TCP traffic, the FortiGate will search for HTTP protocol
communication in TCP, UDP, and ICMP traffic. This is a waste of system resources that you
can avoid by limiting the search further, as shown below.
5. Specify the traffic type.
Use the --protocol tcp keyword to limit the effect of the custom
signature to only TCP traffic. This will save system resources by not
unnecessarily scanning UDP and ICMP traffic.
F-SBID( --name "[Link]"; --pattern "[Link]";
--service HTTP; --protocol tcp; )
The FortiGate unit will limit its search for the pattern to TCP traffic and ignore UDP and ICMP
network traffic.
6. Ignore case sensitivity
By default, patterns are case sensitive. If a user directed his or her browser to [Link],
the custom signature would not recognize the URL as a match.
Use the --no_case keyword to make the pattern matching case insensitive.
F-SBID( --name "[Link]"; --pattern "[Link]";
--service HTTP; --no_case; )
Unlike all of the other keywords in this example, the --no_case keyword has no value. Only
the keyword is required.
7. Limit pattern scans to only traffic sent from the client
The --flow command can be used to further limit the network traffic being scanned to only
that send by the client or by the server.
F-SBID( --name "[Link]"; --pattern "[Link]";
--service HTTP; --no_case; --flow from_client; )
Web servers do not contact clients until clients first open a communication session.
Therefore, using the --flow from_client command will force the FortiGate to ignore all
Fortinet Technologies Inc. Page 103 Security Profiles for FortiOS 5.2
traffic from the server. Since the majority of HTTP traffic flows from the server to the client,
this will save considerable system resources and still maintain protection.
8. Specify the context
When the client browser tries to contact [Link], a DNS is first consulted to get the
[Link] server IP address. The IP address is then specified in the URL field of the
HTTP communication. The domain name will still appear in the host field, so this custom
signature will not function without the --context host keyword/value pair.
F-SBID( --name "[Link]"; --pattern "[Link]";
--service HTTP; --no_case; --flow from_client;
--context host; )
Fortinet Technologies Inc. Page 104 Security Profiles for FortiOS 5.2
4. Specify the service
Use the --service keyword to limit the effect of the custom signature to only the HTTP
protocol.
F-SBID( --name "[Link]"; --pattern "vrfy";
--service SMTP; )
The FortiGate unit will limit its search for the pattern to the SMTP protocol.
Even though the SMTP protocol uses only TCP traffic, the FortiGate will search for SMTP
protocol communication in TCP, UDP, and ICMP traffic. This is a waste of system resources
that you can avoid by limiting the search further, as shown below.
5. Specify the traffic type.
Use the --protocol tcp keyword to limit the effect of the custom
signature to only TCP traffic. This will save system resources by not
unnecessarily scanning UDP and ICMP traffic.
F-SBID( --name "[Link]"; --pattern "vrfy";
--service SMTP; --protocol tcp; )
The FortiGate unit will limit its search for the pattern to TCP traffic and ignore the pattern in
UDP and ICMP network traffic.
6. Ignore case sensitivity
By default, patterns are case sensitive. If a user directed his or her browser to [Link],
the custom signature would not recognize the URL as a match.
Use the --no_case keyword to make the pattern matching case insensitive.
F-SBID( --name "[Link]"; --pattern "vrfy";
--service SMTP; --no_case; )
Unlike all of the other keywords in this example, the --no_case keyword has no value. Only
the keyword is required.
7. Specify the context
The SMTP vrfy command will appear in the SMTP header. The --context host
keyword/value pair allows you to limit the pattern search to only the header.
F-SBID( --name "[Link]"; --pattern "vrfy";
--service SMTP; --no_case; --context header; )
Fortinet Technologies Inc. Page 105 Security Profiles for FortiOS 5.2
Email filter
This section describes how to configure FortiGate email filtering for IMAP, POP3, and SMTP
email. Email filtering includes both spam filtering and filtering for any words or files you want to
disallow in email messages. If your FortiGate unit supports SSL content scanning and
inspection, you can also configure spam filtering for IMAPS, POP3S, and SMTPS email traffic.
The following topics are included in this section:
• Email filter concepts
• Inspection Modes
• Email filter techniques
• Order of spam filtering
• Spam actions
• Email traffic types to inspect
• Configuring an Email Filters
• Email filter examples
You can configure the FortiGate unit to manage unsolicited commercial email by detecting and
identifying spam messages from known or suspected spam servers.
The FortiGuard Antispam Service uses both a sender IP reputation database and a spam
signature database, along with sophisticated spam filtering tools, to detect and block a wide
range of spam messages. Using FortiGuard Antispam email filter profile settings, you can
enable IP address checking, URL checking, email checksum checking, and spam submission.
Updates to the IP reputation and spam signature databases are provided continuously via the
global FortiGuard Distribution Network.
From the FortiGuard Antispam Service page in the FortiGuard Center, you can find out whether
an IP address is blacklisted in the FortiGuard antispam IP reputation database, or whether a
URL or email address is in the signature database.
Inspection Modes
The processing of the traffic for email inspection can be done by either the Proxy mode or the
Flow-based mode.
Proxy
This mode of inspection takes the entire email message and places it in memory before
scanning the entire message for spam indicators.
Flow-based
This mode of inspection scans the message traffic as it comes in. Each packet is scanned as it
comes into the FortiGate. It gets forwarded to its destination without waiting for any of the other
packets that are part of the message to arrive.
Page 106
Email filter techniques
The FortiGate unit has a number of techniques available to help detect spam. Some use the
FortiGuard Antispam Service and require a subscription. The remainder use your DNS servers
or use lists that you must maintain.
Pattern
The pattern field is for entering the identifying information that will enable the filter to correctly
identify the email messages.
• If the type is IP/Netmask the filter will be an IP address with a subnet mask.
• If the type is Email Wildcard the filter will be an email address with a wildcard symbol in
place of the variable characters. For example *.[Link] or fred@*.com.
• If the type is Email Regular Expression, regular expression can be used to create a more
granular filter for email addresses. For example,
^[_a-z0-9-]+(\.[_a-z0-9-]+)*@(example|xmple|examp).(com|org|net) could be used filter
based on a number of combinations of email domain names.
Action
• Mark as Spam
If this is the selected action, the email will be allowed through but it will be tagged with an
indicator that clearly marks the email as spam.
• Mark as Clear
If this is the selected action, the email will be allowed to go through to its destination on the
assumption that the message is not spam.
• Mark as Reject
If this is the selected action, the email will be dropped at the before reaching its destination.
Fortinet Technologies Inc. Page 107 Security Profiles for FortiOS 5.2
Status
Indicates whether this particular list is enabled or disabled
Fortinet Technologies Inc. Page 108 Security Profiles for FortiOS 5.2
Banned Pattern Assigned Score Comment
word type score added to
pattern the sum
for the
entire
page
In this example, the message is treated as spam if the banned word threshold is set to 60 or
less.
FortiGuard-Antispam Service.
Fortinet Technologies Inc. Page 109 Security Profiles for FortiOS 5.2
Detect phishing URLs in email
When you enable FortiGuard phishing URL detection, your FortiGate unit will submit all URL
hyperlinks appearing in the email message body to the FortiGuard service for checking. If a URL
exists in the FortiGuard URL phishing list, your FortiGate unit will remove the hyperlink from the
message. The URL will remain in place, but it will no longer be a selectable hyperlink.
Trusted IP Addresses
A list if IP addresses that are trusted by the FortiGate is created. Any email traffic coming in from
these IP address will be considered to be non-spammers.
If the FortiGate unit sits behind a company’s Mail Transfer Units, it may be unnecessary to
check email IP addresses because they are internal and trusted. The only IP addresses that
need to be checked are those from outside of the company. In some cases, external IP
addresses may be added to the list if it is known that they are not sources of spam.
MIME header
This feature filters by the MIME header. MIME header settings are configured in a separate part
of the command tree but MIME header filtering is enabled within each profile.
The FortiGate unit checks for spam using various filtering techniques. The order in which the
FortiGate unit uses these filters depends on the mail protocol used.
Filters requiring a query to a server and a reply (FortiGuard Antispam Service and
DNSBL/ORDBL) are run simultaneously. To avoid delays, queries are sent while other filters are
running. The first reply to trigger a spam action takes effect as soon as the reply is received.
Fortinet Technologies Inc. Page 110 Security Profiles for FortiOS 5.2
Each spam filter passes the email to the next if no matches or problems are found. If the action
in the filter is Mark as Spam, the FortiGate unit tags the email as spam according to the settings
in the email filter profile.
For SMTP and SMTPS, if the action is discard, the email message is discarded or dropped.
If the action in the filter is Mark as Clear, the email is exempt from any remaining filters. If the
action in the filter is Mark as Reject, the email session is dropped. Rejected SMTP or SMTPS
email messages are substituted with a configurable replacement message.
Spam actions
When spam is detected, the FortiGate unit will deal with it according to the Spam Action setting
in the email filter profile. Note that POP3S, IMAPS and SMTPS spam filtering is available only on
FortiGate units that support SSL content scanning and inspection. POP3, IMAP, POP3S and
IMAPS mail can only be tagged. SMTP and SMTPS mail can be set to Discard or Tagged:
Discard
When the spam action is set to Discard, messages detected as spam are deleted. No
notification is sent to the sender or recipient.
Pass
When the spam action is set to pass, message the spam filter is disabled for this message.
Fortinet Technologies Inc. Page 111 Security Profiles for FortiOS 5.2
Tag
When the spam action is set to Tagged, messages detected as spam are labelled and delivered
normally. The text used for the label is set in the Tag Format field and the label is placed in the
subject or the message header, as set with the Tag Location option.
The FortiGate unit examines IMAP, POP3, and SMTP email traffic. If your FortiGate unit
supports content inspection, it can also examine IMAPS, POP3S, and SMTPS traffic. The
options that you will see in the profile window are IMAP, POP3 and SMTP.
FortiGuard email filtering techniques us FortiGuard services to detect the presence of spam
among your email. A FortiGuard subscription is required to use the FortiGuard email filters. To
enable email filtering an email filter needs to be created and then the filter needs to be
associated with a security policy.
The filter can be created as follows:
• Go to Security Profiles > Email Filter.
• Select the Create New icon (a plus symbol in a circle in the upper right hand corner).
• Select the List icon (a page symbol in the upper right hand corner) and in the new window
select Create New.
An existing filter can be edited as follows:
• Go to Security Profiles > Email Filter.
• Select the filter that you wish to edit from the drop down menu in the upper right corner.
• Select the List icon (a page symbol in the upper right hand corner) and select the filter
that you wish to edit from the list.
Once you are in the proper Edit Email Filter Profile window, you can enter a name in the Name
field if it’s a new filter.
The Comments field is for a description or other information that will assist in understanding the
function or purpose of the this particular filter.
Using the radio buttons for the Inspection Mode field, select either Proxy or Flow-based.
Before any of the other features or options of the filter appear the check box next to Enable
Spam Detection and Filtering must be checked.
Fortinet Technologies Inc. Page 112 Security Profiles for FortiOS 5.2
Spam Action
For the client protocols, IMAP and POP3 the options are:
• Tag - This action will insert a tag into the email somewhere so that when the recipients
view the email they will be warned that it is likely a spam.
• Pass - This action will allow any emails marked as spam to pass through without change.
If this option is chosen, the Tag comments will be greyed out.
For the transfer protocol, SMTP, the options are:
• Tag - This action will insert a tag into the email somewhere so that when the recipients
view the email they will be warned that it is likely a spam.
• Discard - The action will drop the email before it reaches its destination.
• Pass - This action will allow any emails marked as spam to pass through without change.
If this option is chosen, the Tag comments will be greyed out.
Tag Location
• Subject - The contents of the Tag Format will be inserted into the subject line. The subject
line is the most commonly used.
• MIME - The contents of the Tag Format will be inserted in with the MIME header.
Tag Format
The contents of this field will be entered into the tag location specified. The most common tag is
something along the lines of [Spam] or **SPAM**
Fortinet Technologies Inc. Page 113 Security Profiles for FortiOS 5.2
Email filter examples
Fortinet Technologies Inc. Page 114 Security Profiles for FortiOS 5.2
To select the email filter profile in a security policy — CLI
config firewall policy
edit 1
set utm-status enable
set profile-protocol-options default
set spamfilter-profile basic_emailfilter
end
IMAP, POP3, and SMTP email traffic handled by the security policy you modified will be
scanned for spam. Spam messages have the text “Spam” added to their subject lines. A small
office may have only one security policy configured. If you have multiple policies, consider
enabling spam scanning for all of them.
Fortinet Technologies Inc. Page 115 Security Profiles for FortiOS 5.2
Data leak prevention
The FortiGate data leak prevention (DLP) system allows you to prevent sensitive data from
leaving your network. When you define sensitive data patterns, data matching these patterns
will be blocked, or logged and allowed, when passing through the FortiGate unit. You configure
the DLP system by creating individual filters based on file type, file size, a regular expression, an
advanced rule, or a compound rule, in a DLP sensor and assign the sensor to a security policy.
Although the primary use of the DLP feature is to stop sensitive data from leaving your network,
it can also be used to prevent unwanted data from entering your network and to archive some
or all of the content passing through the FortiGate unit.
This section describes how to configure the DLP settings.
The following topics are included:
• Data leak prevention concepts
• DLP archiving
• Enable data leak prevention
• Creating/editing a DLP sensor
• DLP examples
Data leak prevention examines network traffic for data patterns you specify. You define
whatever patterns you want the FortiGate unit to look for in network traffic. The DLP feature is
broken down into a number of parts.
DLP sensor
A DLP sensor is a package of filters. To use DLP, you must enable it in a security policy and
select the DLP sensor to use. The traffic controlled by the security policy will be searched for
the patterns defined in the filters contained in the DLP sensor. Matching traffic will be passed or
blocked according to how you configured the filters.
DLP filter
Each DLP sensor has one or more filters configured within it. Filters can examine traffic for
known files using DLP fingerprints, for files of a particular type or name, for files larger than a
specified size, for data matching a specified regular expression, or for traffic matching an
advanced rule or compound rule.
You can configure the action taken when a match is detected. The actions include:
• None
• Log Only
• Block
• Quarantine IP address
Log Only is enabled by default.
Page 116
DLP Filter Actions
None
No action is taken if filter even if filter is triggered
Log Only
The FortiGate unit will take no action on network traffic matching a rule with this action. The
filter match is logged, however. Other matching filters in the same sensor may still operate on
matching traffic.
Block
Traffic matching a filter with the block action will not be delivered. The matching message or
download is replaced with the data leak prevention replacement message.
Preconfigured sensors
A number of preconfigured sensors are provided with your FortiGate unit. These can be edited
or added to more closely match your needs.
Fortinet Technologies Inc. Page 117 Security Profiles for FortiOS 5.2
Some of the preconfigured sensors with filters ready to go are:
• Credit-Card - This sensor logs the traffic, both files and messages, that contain credit card
numbers in the formates used by American Express, MasterCard and Visa.
• SSN-Sensor - This sensor logs the traffic, both files and messages, that contain Social
Security Numbers with the exception of those that are WebEx invitation emails.
These rules affect only unencrypted traffic types. If you are using a FortiGate unit that can
decrypt and examine encrypted traffic, you can enable those traffic types in these rules to
extend their functionality if required.
Before using the rules, examine them closely to ensure you understand how they will affect the
traffic on your network.
Fingerprinting
Fingerprint scanning allows you to create a library of files for the FortiGate unit to examine. It will
create checksum fingerprints so each file can be easily identified. Then, when files appear in
network traffic, the FortiGate will generate a checksum fingerprint and compare it to those in the
fingerprint database. A match triggers the configured action.
You must configure a document source or uploaded documents to the FortiGate unit for
fingerprint scanning to work.
Fingerprinted Documents
The FortiGate unit must have access to the documents for which it generates fingerprints. One
method is to manually upload documents to be fingerprinted directly to the FortiGate unit. The
other is to allow the FortiGate unit to access a network share that contains the documents to be
fingerprinted.
If only a few documents are to be fingerprinted, a manual upload may be the easiest solution. If
many documents require fingerprinting, or if the fingerprinted documents are frequently revised,
using a network share makes user access easier to manage.
Fortinet Technologies Inc. Page 118 Security Profiles for FortiOS 5.2
Fingerprinting by document source
Server Type This refers to the type of server share that is being accessed. The
default is Windows Share but this will also work on Samba shares.
User Name Enter the user name of the account the FortiGate unit uses to access
the server network share.
Password Enter the password for the account being used to access the network
share.
Filename Pattern You may enter a filename pattern to restrict fingerprinting to only those
files that match the pattern. To fingerprint all files, enter an asterisk (“*”).
Sensitivity Level Select a sensitivity level. The sensitivity is a tag for your reference that is
included in the log files. It does not change how fingerprinting works.
Scan Periodically To have the files on the document source scanned on a regular basis,
select this option. This is useful if files are added or changed regularly.
Once selected, you can choose Daily, Weekly, or Monthly update
options.
The Hour and Min fields are for determining, in a 24 hour clock, the time
that the source shares will be scanned.
Fingerprint files in By default, only the files in the specified path are fingerprinted. Files in
subdirectories subdirectories are ignored. Select this option to fingerprint files in
subdirectories of the specified path.
Remove fingerprints Select this option to retain the fingerprints of files deleted from the
for deleted files document source. If this option is disabled, fingerprints for deleted files
will be removed when the document source is rescanned.
Keep previous Select this option to retain the fingerprints of previous revisions of
fingerprints for updated files. If this option is disabled, fingerprints for previous version
modified files of files will be deleted when a new fingerprint is generated.
4. Select OK.
Fingerprinting manually by document
Fortinet Technologies Inc. Page 119 Security Profiles for FortiOS 5.2
3. Use the Browse feature for the File field to select the file to be fingerprinted. The selection
will be limited to network resources
4. Choose a Sensitivity level. The default choices are Critical, Private and Warning, but more
can be added in the CLI.
5. If the file is an archive containing other files, select Process files inside archive if you also
want the individual files inside the archive to have fingerprints generated in addition to the
archive itself.
6. Select OK.
The file is uploaded and a fingerprint generated.
File size
This filter-type checks for files exceeding a configured size. All files larger than the specified size
are subject to the configured action. The value of the field is measured in Kilobytes.
File filter does not detect files within archives. You can use file filter to block or allow the
archives themselves, but not the contents of the archives.
Watermarking
Watermarking is essentially marking files with a digital pattern to mark the file as being
proprietary to a specific company. Fortinet has a utility that will apply a digital watermark to files.
The utility adds a small (approx. 100 byte) pattern to the file that is recognised by the DLP
Watermark filter. the pattern is invisible to the end user.
When watermarking a file it should be verified that the pattern matches up to a category found
on the FortiGate firewall. For example, if you are going to watermark a file with the sensitivity
level of “Secret” you should verify that “Secret” is a sensitivity level that has been assigned in
the FortiGate unit.
Fortinet Technologies Inc. Page 120 Security Profiles for FortiOS 5.2
Watermark Sensitivity
If you are using watermarking on your files you can use this filter to check for watermarks that
correspond to sensitivity categories that you have set up.
The Corporate Identifier is to make sure that you are only blocking watermarks that your
company has place on the files, not watermarks with the same name by other companies.
Software Versions
Before planning on using watermarking software it is always best to verify that the software will
work with your OS. Currently, the only utility available to watermark files is within the
FortiExplorer software and that is only available for the Windows operating system. There was
an older version of software that is for Linux and is Command line only, but is has been
discontinued.
File types
The Watermark tool does not work with every file type. The following file types are supported by
the watermark tool:
• .txt
• .pdf
• .doc
• .xls
• .ppt
• .docx
• .pptx
• .xlsx
Currently the DLP only works with Fortinet’s watermarking software.
Fortinet Technologies Inc. Page 121 Security Profiles for FortiOS 5.2
source directory then the watermarked version of the file will be place there and the
unaltered original will be left in the source directory.
3. Select Apply Watermark to start the process.
Regular expression
The FortiGate unit checks network traffic for the regular expression specified in a regular
expression filter. The regular expression library used by Fortinet is a variation of a library called
PCRE (Perl Compatible Regular Expressions). A number of these filters can be added to a
sensor making a sort of ‘dictionary’ subset within the sensor.
Some other, more limited DLP implementations, use a list of words in a text file to define what
words are searched for. While the format used here is slightly different than what some people
are used to, the resulting effect is similar. Each Regular Expression filter can be thought of as a
more versatile word to be searched against. In this dictionary (or sensor), the list of words is not
limited to just predefined words. It can include expressions that can accommodate complex
variations on those words and even target phrases. Another advantage of the individual filter
model of this dictionary over the list is that each word can be assigned its own action, making
this implementation much more granular.
Encrypted
This filter is a binary one. If the file going through the policy is encrypted the action is triggered.
DLP archiving
DLP is typically used to prevent sensitive information from getting out of your company
network, but it can also be used to record network use. This is called DLP archiving. The DLP
engine examines email, FTP, IM, NNTP, and web traffic. Enabling archiving for rules when you
add them to sensors directs the FortiGate unit to record all occurrences of these traffic types
when they are detected by the sensor.
Since the archive setting is configured for each rule in a sensor, you can have a single sensor
that archives only the things you want.
You can archive Email, FTP, HTTP, IM, and session control content:
• Email content includes IMAP, POP3, and SMTP sessions. Email content can also include
email messages tagged as spam by Email filtering. If your unit supports SSL content
scanning and inspection, Email content can also include IMAPS, POP3S, and SMTPS
sessions.
• HTTP content includes HTTP sessions. If your unit supports SSL content scanning and
inspection HTTP content can also include HTTPS sessions.
• IM content includes AIM, ICQ, MSN, and Yahoo! sessions.
DLP archiving comes in two forms: Summary Only, and Full.
Fortinet Technologies Inc. Page 122 Security Profiles for FortiOS 5.2
Summary archiving records information about the supported traffic types. For example, when
an email message is detected, the sender, recipient, message subject, and total size are
recorded. When a user accesses the Web, every URL the user visits recorded. The result is a
summary of all activity the sensor detected.
For more detailed records, full archiving is necessary. When an email message is detected, the
message itself, including any attachments, is archived. When a user accesses the Web, every
page the user visits is archived. Far more detailed than a summary, full DLP archives require
more storage space and processing.
Because both types of DLP archiving require additional resources, DLP archives are saved to a
FortiAnalyzer unit or the FortiGuard Analysis and Management Service (subscription required).
You can use DLP archiving to collect and view historical logs that have been archived to a
FortiAnalyzer unit or the FortiGuard Analysis and Management Service. DLP archiving is
available for FortiAnalyzer when you add a FortiAnalyzer unit to the Fortinet configuration. The
FortiGuard Analysis server becomes available when you subscribe to the FortiGuard Analysis
and Management Service.
Two sample DLP sensors are provided with DLP archiving capabilities enabled. If you select the
Content_Summary sensor in a security policy, it will save a summary DLP archive of all traffic
the security policy handles. Similarly, the Content_Archive sensor will save a full DLP archive
of all traffic handled the security policy you apply it to. These two sensors are configured to
detect all traffic of the supported types and archive them.
DLP archiving is set in the CLI only.
To set the archive to Full
config dlp sensor
edit <name of sensor>
set full-archive-proto smtp pop3 imap http ftp nntp aim icq msn
yahoo mapi
end
To set the archive to Summary Only
config dlp sensor
edit <name of sensor>
set summary-proto smtp pop3 imap http ftp nntp aim icq msn yahoo
mapi
end
DLP examines your network traffic for data patterns you specify. The FortiGate unit then
performs an action based on the which pattern is found and a configuration set for each filter
trigger.
Fortinet Technologies Inc. Page 123 Security Profiles for FortiOS 5.2
2. Add one or more filters to the DLP sensor.
Each filter searches for a specific data pattern. When a pattern in the active DLP sensor
appears in the traffic, the FortiGate unit takes the action configured in the matching filter.
Because the order of filters within a sensor cannot be changed, you must configure DLP in
sequence.
3. Add the DLP sensor to one or more firewall policies that control the traffic to be examined.
DLP sensors are collections of filters. You must also specify an action for the filter when you
create it in a sensor. Once a DLP sensor is configured, you can select it a security policy profile.
Any traffic handled by the security policy will be examined according to the DLP sensor
configuration.
Fortinet Technologies Inc. Page 124 Security Profiles for FortiOS 5.2
• [radio button] Regular Expression [input field]
Examine the following Services:
Web Access
• HTTP-POST
Email
• [check box] SMTP
• [check box] POP3
• [check box] IMAP
• [check box] MAPI
Others
• [check box] NNTP
Action [from drop down menu]
• None
• Log Only,
• Block
• Quarantine IP address
Files filter will have these options:
• [radio button] Containing: drop down menu including: Credit Card # or SSN
• [radio button] File Size >= [ ]KB
• [radio button] Specify File Types
File Types: [“Click to add...”drop down menu of File extensions]
File Name Patterns:[“Click to add...”drop down menu]
• [radio button] File Finger Print: [drop down menu]
• [radio button] Watermark Sensitivity: [drop down menu] and Corporate Identifier [id
field]
• [radio button] Regular Expression [input field]
• [radio button] Encrypted
Examine the following Services:
Web Access
• [check box] HTTP-POST
• [check box] HTTP-GET
Email
• [check box] SMTP
• [check box] POP3
• [check box] IMAP
• [check box] MAPI
Others
• [check box] FTP
• [check box] NNTP
Action [from drop down menu]
• None
• Log Only,
• Block
• Quarantine IP address
6. Select OK.
Fortinet Technologies Inc. Page 125 Security Profiles for FortiOS 5.2
7. Repeat Steps 6 and 7 for each filter.
8. Select Apply to confirm the settings of the sensor.
If you have configured DLP to block IP addresses and if the FortiGate unit receives sessions
that have passed through a NAT device, all traffic from that NAT device — not just traffic from
individual users — could be blocked. You can avoid this problem by implementing
authentication.
To view or modify the replacement message text, go to System > Config > Replacement
Message.
DLP examples
Filter Messages
Fortinet Technologies Inc. Page 126 Security Profiles for FortiOS 5.2
4. Create/edit the first filter. Use the following settings:
Filter
Filter Files
Name large_emails
Comment <optional>
Once the Sensor has been created, a new filter will need to be added.
3. Create the filter to block the emails over 15 MB. In the filters table select Create New.
Use the following values
Filter
Filter Messages
Fortinet Technologies Inc. Page 127 Security Profiles for FortiOS 5.2
4. Create the filter to log emails between 5 MB and 10 MB. In the filters table select Create
New.
Use the following values
Filter
Filter Messages
Fortinet Technologies Inc. Page 128 Security Profiles for FortiOS 5.2
1. Add a new Sensitivity Level by running the following commands in the CLI
config dlp fp-sensitivity
edit copyrighted
end
2. Apply files to the fingerprint database
a. Go to Security Profiles > Advanced > DLP Fingerprint.
b. In the Document Sources section select Create New
Use the following field values
Name copyrighted_material
Password ******
Path books/copyrighted/
Sensitivity copyrighted
Advanced
Two Sensors need to be created. One for blocking the transmission of copyrighted material and
a second for allowing the passing of copyrighted material under specific circumstances.
Fortinet Technologies Inc. Page 129 Security Profiles for FortiOS 5.2
3. Create the first DLP Sensor
• Go to Security Profile > Data Leak Prevention.
• Create a new sensor.
Use the following field values:
Name block_copyrighted
Comment <optional>
Filter Files
Name allow_copyrighted
Comment <optional>
Filter Files
Fortinet Technologies Inc. Page 130 Security Profiles for FortiOS 5.2
5. Create a policy to allow transmission of copyrighted material.
a. Go to Policy & Objects > Policy > IPv4
b. Select Create New
c. Use the following values in the Policy:
Schedule always
Service all
Action ACCEPT
This policy should be place as close to the beginning of the list of policies so the it is among the
first tested against.
6. Create a policy to block transmission of copyrighted material.
This will in effect be the default template for all following policies in that they will have to use
the DLP profile that blocks the transmission of the copyrighted material.
a. Go to Policy & Objects > Policy > IPv4
b. Select Create New or Edit an existing policy.
c. Use the following values in the Policy:
The fields should include what ever values you need to accomplish your requirements are
but each policy should include the DLP sensor block_copyrighted or if a different DLP
configuration is required it should include a filter that blocks copyrighted fingerprinted file.
If you need to create a policy that is identity based make sure that there is an Authentication
rule for the group employees that uses the DLP sensor that blocks copyrighted material.
Fortinet Technologies Inc. Page 131 Security Profiles for FortiOS 5.2
ICAP
ICAP is the acronym for Internet Content Adaptation Protocol The purpose of the feature is to
off load work that would normally take place on the firewall to a separate server specifically set
up for the specialized processing of the incoming traffic. This takes some of the resource strain
off of the FortiGate firewall leaving it to concentrate its resources on things that only it can do.
Off-loading value-added services from Web servers to ICAP servers allows those same web
servers to be scaled according to raw HTTP throughput versus having to handle these extra
tasks.
ICAP servers are focused on a specific function, for example:
• Ad insertion
• Virus scanning
• Content translation
• HTTP header or URL manipulation
• Language translation
• Content filtering
ICAP does not appear by default in the web-based manager. You must enable it in System >
Admin > Settings to display ICAP in the web-based manager.
The Protocol
The protocol is a lightweight member of the TCP/IP suite of protocols. It is an Application layer
protocol and its specifications are set out in RFC 3507. The default TCP that is assigned to it is
1344. Its purpose is to support HTTP content adaptation by providing simple object-based
content vectoring for HTTP services. ICAP is usually used to implement virus scanning and
content filters in transparent HTTP proxy caches. Content Adaptation refers to performing the
particular value added service, or content manipulation, for an associated client
request/response.
Essentially it allows an ICAP client, in this case the FortiGate firewall, to pass HTTP messages
to an ICAP server like a remote procedure call for the purposes of some sort of transformation
or other processing adaptation. Once the ICAP server has finished processing the content, the
modified content is sent back to the client.
The messages going back and forth between the client and server are typically HTTP requests
or HTTP responses. While ICAP is a request/response protocol similar in semantics and usage
Page 132
to HTTP/1.1 it is not HTTP nor does it run over HTTP, as such it cannot be treated as if it were
HTTP. For instance ICAP messages can not be forwarded by HTTP surrogates.
If you enable ICAP in a security policy, HTTP traffic intercepted by the policy is transferred to an
ICAP server in the ICAP profile added to the policy. Responses from the ICAP server are
returned to the FortiGate unit which forwards them to an HTTP client or server.
You can offload HTTP responses or HTTP requests (or both) to the same or different ICAP
servers.
If the FortiGate unit supports HTTPS inspection, HTTPS traffic intercepted by a policy that
includes an ICAP profile is also offloaded to the ICAP server in the same way as HTTP traffic.
When configuring ICAP on the FortiGate unit, you must configure an ICAP profile that contains
the ICAP server information; this profile is then applied to a security policy.
Configuration Settings
Servers
Go to Security Profiles > Advanced > ICAP Servers
The available settings to be configured regarding the server are
• Name
• IP Type (in the GUI) or IP address version (in the CLI)
The options for this field in the GUI are 2 radio buttons labelled “IPv4” and “IPv4”. In the CLI
the approach is slightly different. There is a field “ip-version” that can be set to “4” or “6”.
• IP Address
Depending on whether you’ve set the IP version to 4 or 6 will determine the format that the
content of this field will be set into. In the GUI it looks like the same field with a different
format but in the CLI it is actually 2 different fields named “ip-address” and ip6-address.
• Port
1344 is default TCP port used for the ICAP traffic. The range can be from 1 to 65535.
Maximum Connections
This value refers to the maximum number of concurrent connections that can be made to the
ICAP server. The default setting is 100. This setting can only be configured in the CLI.
The syntax is:
config icap server
edit <icap_server_name>
set max-connections <integer>
end
Fortinet Technologies Inc. Page 133 Security Profiles for FortiOS 5.2
Profiles
Name
Just like any other profile each of the ICAP profiles needs to be assigned a name.
This example is for an ICAP server performing web URL filtering on HTTP requests
1. A user opens a web browser and sends an HTTP request to connect to a web server.
2. The FortiGate unit intercepts the HTTP request and forwards it to an ICAP server.
3. The ICAP server receives the request and determines if the request is for URL that should be
blocked or allowed.
• If the URL should be blocked the ICAP server sends a response to the FortiGate unit. The
FortiGate unit returns this response to the user’s web browser. This response could be a
message informing the user that their request was blocked.
• If the URL should be allowed the ICAP server sends a request to the FortiGate unit. The
FortiGate unit forwards the request to the web server that the user originally attempted to
connect to.
• When configuring ICAP on the FortiGate unit, you must configure an ICAP profile that
contains the ICAP server information; this profile is then applied to a security policy.
Fortinet Technologies Inc. Page 134 Security Profiles for FortiOS 5.2
Example Scenario
Name content-filtration-server4
IP Type IPv4
IP Address [Link]
Port 1344
Name Prop-Content-Filtration
Server content-filtration-server4
Path /proprietary_code/content-filter/
On Failure Error
Server content-filtration-server4
Fortinet Technologies Inc. Page 135 Security Profiles for FortiOS 5.2
Path /proprietary_code/content-filter/
On Failure Error
Fortinet Technologies Inc. Page 136 Security Profiles for FortiOS 5.2
Other Security Profiles considerations
If you enable virtual domains (VDOMs) on your FortiGate unit, all Security Profiles configuration
is limited to the VDOM in which you configure it.
While configuration is not shared, the various databases used by Security Profiles features are
shared. The FortiGuard antivirus and IPS databases and database updates are shared. The
FortiGuard web filter and spam filter features contact the FortiGuard distribution network and
access the same information when checking email for spam and web site categories and
classification.
Conserve mode
FortiGate units perform all Security Profiles processing in physical RAM. Since each model has
a limited amount of memory, conserve mode is activated when the remaining free memory is
nearly exhausted or the AV proxy has reached the maximum number of sessions it can service.
While conserve mode is active, the AV proxy does not accept new sessions.
The AV proxy
Most content inspection the FortiGate unit performs requires that the files, email messages,
URLs, and web pages be buffered and examined as a whole. The AV proxy performs this
function, and because it may be buffering many files at the same time, it uses a significant
amount of memory. Conserve mode is designed to prevent all the component features of the
FortiGate unit from trying to use more memory than it has. Because the AV proxy uses so much
memory, conserve mode effectively disables it in most circumstances. As a result, the content
inspection features that use the AV proxy are also disabled in conserve mode.
All of the Security Profiles features use the AV proxy with the exception of IPS, application
control, DoS as well as flow-based antivirus, DLP, and web filter scanning. These features
continue to operate normally when the FortiGate unit enters conserve mode.
Page 137
The FortiGate unit will leave conserve mode only when the available physical memory exceeds
about 30%. When exiting conserve mode, all new sessions configured to be scanned with
features requiring the AV proxy will be scanned as normal, with the exception of a unit
configured with the one-shot option.
off
The off setting forces the FortiGate unit to stop all traffic that is configured for content
inspection by Security Profiles features that use the AV proxy. New sessions are not allowed but
current sessions continue to be processed normally unless they request more memory.
Sessions requesting more memory are terminated.
For example, if a security policy is configured to use antivirus scanning, the traffic it permits is
blocked while in conserve mode. A policy with IPS scanning enabled continues as normal. A
policy with both IPS and antivirus scanning is blocked because antivirus scanning requires the
AV proxy.
Use the off setting when security is more important than a loss of access while the problem is
rectified.
pass
The pass setting allows traffic to bypass the AV proxy and continue to its destination. Since the
traffic is bypassing the proxy, no Security Profiles scanning that requires the AV proxy is
performed. Security Profiles scanning that does not require the AV proxy continues normally.
Use the pass setting when access is more important than security while the problem is rectified.
Pass is the default setting.
one-shot
The one-shot setting is similar to pass in that traffic is allowed when conserve mode is active.
The difference is that a system configured for one-shot will force new sessions to bypass the AV
proxy even after it leaves conserve mode. The FortiGate unit resumes use of the AV proxy only
when the av-failopen setting is changed or the unit is restarted.
idledrop
The idledrop setting will recover memory and session space by terminating all the sessions
associated with the host that has the most sessions open. The FortiGate may force this session
termination a number of times, until enough memory is available to allow it to leave conserve
mode.
The idledrop setting is primarily designed for situations in which malware may continue to open
sessions until the AV proxy cannot accept more new sessions, triggering conserve mode. If your
FortiGate unit is operating near capacity, this setting could cause the termination of valid
sessions. Use this option with caution.
Fortinet Technologies Inc. Page 138 Security Profiles for FortiOS 5.2
Configuring the av-failopen command
You can configure the av-failopen command using the CLI.
config system global
set av-failopen {off | pass | one-shot | idledrop}
end
The default setting is pass.
If your FortiGate model supports SSL content scanning and inspection, you can apply antivirus
scanning, web filtering, FortiGuard Web Filtering, and email filtering to encrypted traffic. You can
also apply DLP and DLP archiving to HTTPS, IMAPS, POP3S, and SMTPS traffic. To perform
SSL content scanning and inspection, the FortiGate unit does the following:
• intercepts and decrypts HTTPS, IMAPS, POP3S, SMTPS, and FTPS sessions between
clients and servers (FortiGate SSL acceleration speeds up decryption)
• applies content inspection to decrypted content, including:
• HTTPS, IMAPS, POP3S, and SMTPS Antivirus, DLP, and DLP archiving
• HTTPS web filtering and FortiGuard web filtering
• IMAPS, POP3S, and SMTPS email filtering
• encrypts the sessions and forwards them to their destinations.
Fortinet Technologies Inc. Page 139 Security Profiles for FortiOS 5.2
Figure 6: FortiGate SSL content scanning and inspection packet flow
3 1
2
Decrypted
packets
Encrypted 3
2
1 3
2
1
Encrypted
packets Firewall packets
You can add one signing CA certificate for SSL content scanning and inspection. The CA
certificate key size must be 1024 or 2048 bits. 4096-bit keys are not supported for SSL content
scanning and encryption.
Fortinet Technologies Inc. Page 140 Security Profiles for FortiOS 5.2
You can replace the default signing CA certificate, Fortinet_CA_SSLProxy, with another signing
CA certificate. To do this, you need the signing CA certificate file, the CA certificate key file, and
the CA certificate password.
Exceptions
Periodically, you will come across situations were SSL and certificates will interfere with the
smooth operation of an application or website. For instance, there is a popular application
called Dropbox that does not work when deep SSL inspection is enabled. The reason for this is
that the trusted certificate authority that is recognized by Dropbox is imbedded in the software
and Dropbox cannot be reconfigured to recognise the FortiGate certificates that are used when
deep SSL inspection is implemented.
One way to by-pass the deep inspection for Dropbox is to add [Link] to a local category
in web filter i ng and add that local category to the ftgd-wf-ssl-exempt list in the webfilter
profile. This way any connections with [Link] will be exempt from deep SSL inspection.
Whenever an exception is found, the reason that it causes an issue will have to be determined in
order to figure out a way to accommodate that application or website.
Fortinet Technologies Inc. Page 141 Security Profiles for FortiOS 5.2
The acceptable range is from 64 to 8192 kilobytes. This command affects only logging to
memory.
Setting packet-log-history to a value larger than 1 can affect the performance of the
FortiGate unit because network traffic must be buffered. The performance penalty depends on
the model, the setting, and the traffic load.
The packet-log-post-attack command specifies how many packets are logged after the
one in which the IPS signature is detected. For example, if packet-log-post-attack is set
to 10, the FortiGate unit will save the ten packets following the one containing the IPS signature
match.
The acceptable range for packet-log-post-attack is from 0 to 255. The default is 0.
Many Security Profiles feature list entries can include wild cards or Perl regular expressions.
For more information about using Perl regular expressions, see
[Link]
Fortinet Technologies Inc. Page 142 Security Profiles for FortiOS 5.2
Regular expression vs. wildcard match pattern
A wildcard character is a special character that represents one or more other characters. The
most commonly used wildcard characters are the asterisk (*), which typically represents zero or
more characters in a string of characters, and the question mark (?), which typically represents
any one character.
In Perl regular expressions, the ‘.’ character refers to any single character. It is similar to the ‘?’
character in wildcard match pattern. As a result:
• [Link] not only matches [Link] but also [Link], [Link],
[Link], and so on.
To add a question mark (?) character to a regular expression from the FortiGate CLI, enter
Ctrl+V followed by ?. To add a single backslash character (\) to a regular expression from the
CLI you must add precede it with another backslash character. For example, example\\.com.
To match a special character such as '.' and ‘*’ use the escape character ‘\’. For example:
• To match [Link], the regular expression should be: example\.com
In Perl regular expressions, ‘*’ means match 0 or more times of the character before it, not 0 or
more times of any character. For example:
• exam*.com matches [Link] but does not match [Link]
To match any character 0 or more times, use ‘.*’ where ‘.’ means any character and the ‘*’
means 0 or more times. For example, the wildcard match pattern exam*.com should therefore
be exam.*\.com.
Word boundary
In Perl regular expressions, the pattern does not have an implicit word boundary. For example,
the regular expression “test” not only matches the word “test” but also any word that contains
“test” such as “atest”, “mytest”, “testimony”, “atestb”. The notation “\b” specifies the word
boundary. To match exactly the word “test”, the expression should be \btest\b.
Case sensitivity
Regular expression pattern matching is case sensitive in the web and Email Filter filters. To
make a word or phrase case insensitive, use the regular expression /i. For example, /bad
language/i will block all instances of “bad language”, regardless of case.
Expression Matches
abc “abc” (the exact character sequence, but anywhere in the string)
Fortinet Technologies Inc. Page 143 Security Profiles for FortiOS 5.2
Table 8: Perl regular expression formats (continued)
^abc|abc$ The string “abc” at the beginning or at the end of the string
ab*c “a” followed by any number (zero or more) of “b”s followed by a “c”
ab?c “a” followed by an optional “b” followed by a” c”; that is, either “abc” or ”ac”
[abc]+ Any (nonempty) string of “a”s, “b”s and “c”s (such as “a”, “abba”,
”acbabcacaa”)
[^abc]+ Any (nonempty) string which does not contain any of “a”, “b”, and “c” (such as
“defg”)
/i Makes the pattern case insensitive. For example, /bad language/i blocks
any instance of bad language regardless of case.
100\s*mk The strings “100” and “mk” optionally separated by any amount of white space
(spaces, tabs, newlines)
abc\b “abc” when followed by a word boundary (for example, in “abc!” but not in
“abcd”)
perl\B “perl” when not followed by a word boundary (for example, in “perlert” but not
in “perl stuff”)
\x Tells the regular expression parser to ignore white space that is neither
preceded by a backslash character nor within a character class. Use this to
break up a regular expression into (slightly) more readable parts.
/x Used to add regular expressions within other text. If the first character in a
pattern is forward slash '/', the '/' is treated as the delimiter. The pattern must
contain a second '/'. The pattern between ‘/’ will be taken as a regular
expressions, and anything after the second ‘/’ will be parsed as a list of regular
expression options ('i', 'x', etc). An error occurs if the second '/' is missing. In
regular expressions, the leading and trailing space is treated as part of the
regular expression.
Fortinet Technologies Inc. Page 144 Security Profiles for FortiOS 5.2
/block|any|word/
Block purposely misspelled words
Spammers often insert other characters between the letters of a word to fool spam blocking
software.
/^.*v.*i.*a.*g.*r.*o.*$/i
/cr[eéèêë][\+\-\*=<>\.\,;!\?%&§@\^°\$£€\{\}()\[\]\|\\_01]dit/i
Block common spam phrases
The following phrases are some examples of common phrases found in spam messages.
/try it for free/i
/student loans/i
/you’re already approved/i
/special[\+\-\*=<>\.\,;!\?%&~#§@\^°\$£€\{\}()\[\]\|\\_1]offer/i
Fortinet Technologies Inc. Page 145 Security Profiles for FortiOS 5.2
Index
A filter
antispam, see email filtering and IPS 81
FortiGuard, AntiSpam FortiAnalyzer
antivirus 18 antivirus 15
concepts 18 FortiGuard
databases 24 AntiSpam 16
file filtering 15 Antivirus 25
FortiAnalyzer 15 Web Filtering 15
scanning order 21 FortiGuard Center 25
application control 16 FortiGuard Web Filter quota 44
monitor 72 FortiGuard, Distribution Network 24
application monitor 72
archiving
G
DLP 122 grayware 21, 24
B H
black list 16 HA
buffer size IPS processing 84
IPS 87 heuristics 21, 25
C I
CA certificate 140 IM 16
certificate inspection
key size 140 SSL 139
SSL 140 intrusion prevention system, see IPS
concepts intrusion protection system, see IPS
antivirus 18 IPS
web filtering 15 buffer size 87
conserve mode 137 concepts 78
content scanning custom signature keywords 98
SSL 139 custom signature syntax 96
engine algorithm 86
D engine count 86
data leak prevention (DLP), see DLP fail-open 86
DLP 116 filter 81
archiving 122 in an HA cluster 84
default rules 117, 118 overview 15
packet logging 88
E protocol decoders 87
scanning 80
EICAR 32
sensor 80
email filtering, see also FortiGuard, session count accuracy 86
AntiSpam 16
engine algorithm K
IPS 86 key size
engine count certificate 140
IPS 86 keywords
F IPS custom signatures 98
fail-open M
IPS 86 monitor
file filtering application control 72
antivirus 15
file pattern 21 P
file size 21 P2P 16
file type 21
Fortinet Technologies Inc. Page 146 Security Profiles for FortiOS 5.2
packet logging syntax
IPS 88 IPS custom signatures 96
settings 141
protocol decoders 87 U
Unified Threat Management, see UTM
Q URL filtering 15
quota URL formats 51
FortiGuard Web Filter 44 UTM
overview 12
R VDOM 137
regex 142 UTM profiles 16
regular expressions 142
V
S VDOM
scanning order UTM 137
antivirus 21 virus scan 21, 24
security processing modules
configuring 87 W
example configuration 93 web content filtering 16
sensor web filter
IPS 80 how URL formats are detected, HTTP
session count accuracy 86 52
SSL how URL formats are detected,
certificate 140 HTTPS 51
content inspection 139 quota 44
content scanning 139 web filtering 15
inspection 139 wildcards 142
supported FortiGate models 139
Fortinet Technologies Inc. Page 147 Security Profiles for FortiOS 5.2