FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
mricardez
Staff
Staff
Article Id 247749
Description This article describes how to create a custom IPS signature to block through the SNI (Server Name Indication) of TLS extension a HTTPS connection or those TLS connection where the SNI header is used during the TLS handshake.
Scope FortiGate v7.0 and earlier.
Solution

It is possible to block connections with FortiOS using an IPS profile during the first packet (Client Hello) of the TLS handshake.

 

The block can be performed with UTM SSL/SSH inspection in mode 'certificate-inspection' since the SNI is a header in clear text used during the TLS handshake.

 

After the TCP 3-Way Handshake process has been finished, initiate the negotiation of TLS where the first packet is the 'client hello' message.

It contains the SNI extension and is inspected by the IPS, then FortiOS can take an action, e.g block it.

 

mricardez_1-1677689536858.png

 

mricardez_2-1677689576921.png

 

The following topology is the test-bed to IPS custom, where IP 192.168.70.111 is an HTTPS server.

 

mricardez_0-1677688758372.png

 

The custom IPS signature as following, where the pattern to match is 'www.markoz.com' on the SSL connection.

 

F-SBID(--name "SNI.www.markoz.com"; --service SSL; --flow from_client;--pattern "www.markoz.com";--no_case;--context packet;)

 

It is possible to use the GUI Security Profiles -> IPS Signatures and then select 'Create New'.

 

mricardez_3-1677690805963.png

 

Create an IPS Profile and add the custom IPS signature: 

 

mricardez_4-1677691076745.png

 mricardez_5-1677691119232.png

 

Associated the UTM IPS profile to the firewall policy:

  

mricardez_6-1677691296915.png

 

Testing with HTTPS client:

From a PC test using the CURL tool to simulate the HTTPS connection.

The HTTPS connection froze after the TLS Client Hello message.

 

mricardez_7-1677692199857.png

 

From packet capture, it is possible to confirm the packet is blocked after the FortiGate receives the TLS Client Hello on the ingress interface 'Vlan10'.

 

mricardez_8-1677692681804.png

 

The FortiGate IPS logs where the custom IPS signature matches the dropping of the HTTPS connection. 

 

mricardez_9-1677692907104.png

 

Related document:

Creating IPS and application control signatures

Comments
vweis
Staff
Staff

Help me understand the use-case for this?
How is this different than just using the Web Filter security profile in conjunction with certificate inspection?

Doesn't that accomplish the same thing?