beautypg.com

Fortinet Network Device IPS User Manual

Page 34

background image

FortiGate IPS User Guide Version 3.0 MR7

34

01-30007-0080-20080916

Creating custom signatures

Custom signatures

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 needless
waste of system resources.

5

Specifying 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 "Block.example.com"; --pattern

"example.com"; --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

Ignoring case sensitivity

By default, patterns are case sensitive. If a user directed his or her browser to
Example.com, 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 "Block.example.com"; --pattern

"example.com"; --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

Limiting 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 "Block.example.com";

--pattern "example.com"; --service HTTP; --no_case;
--flow from_client; )

Web servers don’t contact clients until clients first open a communication session.
Therefore, using the --flow from_client command will force the FortiGate

until to ignore all traffic originating 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

Specifying the context

When the client browser tries to contact example.com, a DNS is first consulted to
get the example.com 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 "Block.example.com";

--pattern "example.com"; --service HTTP; --no_case;
--flow from_client; --context host; )