SSL content scanning and inspection
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.
FortiGate SSL content scanning and inspection packet flow
HTTP Strict Transport Security (HSTS) Protocol
HSTS is a protocol used by Google and other web browsers to prevent man-in-the-middle attacks.
When performing deep inspection, the FortiGate intercepts the https traffic and would send its own self-signed CA certificate to the browser. If the browser is configured to use HSTS connections, it would refuse the FortiGate CA certificate since it is not on the trusted list for Google servers.
To keep the CA certificate from being refused, the HSTS settings should be cleared from the browser. Instructions for this vary between browsers.
Setting up certificates to avoid client warnings
To use SSL content scanning and inspection, you need to set up and use a certificate that supports it. FortiGate SSL content scanning and inspection intercepts the SSL keys that are passed between clients and servers during SSL session handshakes and then substitutes spoofed keys. Two encrypted SSL sessions are set up, one between the client and the FortiGate unit, and a second one between the FortiGate unit and the server. Inside the FortiGate unit the packets are decrypted.
While the SSL sessions are being set up, the client and server communicate in clear text to exchange SSL session keys. The session keys are based on the client and server certificates. The FortiGate SSL decrypt/encrypt process intercepts these keys and uses a built-in signing CA certificate named Fortinet_CA_SSLProxy to create keys to send to the client and the server. This signing CA certificate is used only by the SSL decrypt/encrypt process. The SSL decrypt/encrypt process then sets up encrypted SSL sessions with the client and server and uses these keys to decrypt the SSL traffic to apply content scanning and inspection.
Some client programs (for example, web browsers) can detect this key replacement and will display a security warning message. The traffic is still encrypted and secure, but the security warning indicates that a key substitution has occurred.
You can stop these security warnings by importing the signing CA certificate used by the server into the FortiGate unit SSL content scanning and inspection configuration. Then the FortiGate unit creates keys that appear to come from the server and not the FortiGate unit.
|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.|
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.
To add a signing CA certificate for SSL content scanning and inspection
- Obtain a copy of the signing CA certificate file, the CA certificate key file, and the password for the CA certificate.
- Go to System > Certificates > Local Certificates and select Import.
- Set Type to Certificate.
- For Certificate file, use the Browse button to select the signing CA certificate file.
- For Key file, use the Browse button to select the CA certificate key file.
- Enter the CA certificate Password.
- Select OK.
The CA certificate is added to the Local Certificates list. In this example the signing CA certificate name is Example_CA. This name comes from the certificate file and key file name. If you want the certificate to have a different name, change these file names.
- Add the imported signing CA certificate to the SSL content scanning and inspection configuration. Use the following CLI command if the certificate name is Example_CA.
config firewall ssl setting
set caname Example_CA
The Example_CA signing CA certificate will now be used by SSL content scanning and inspection for establishing encrypted SSL sessions.
Periodically, you will come across situations were SSL and certificates will interfer 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 recognised 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 implimented.
One way to by-pass the deep inspection for Dropbox is to add dropbox.com to a local category in webfiltering and add that local category to the
ftgd-wf-ssl-exempt list in the webfilter profile. This way any connections with dropbox.com 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.
Configuring packet logging options
You can use a number of CLI commands to further configure packet logging.
Limiting memory use
When logging to memory, you can define the maximum amount of memory used to store logged packets.
config ips settings
set packet-log-memory 256
The acceptable range is from 64 to 8192 kilobytes. This command affects only logging to memory.
Limiting disk use
When logging to the FortiGate unit internal hard disk, you can define the maximum amount of space used to store logged packets.
config ips settings
set ips-packet-quota 256
The acceptable range is from 0 to 4294967295 megabytes. This command affects only logging to disk.
Configuring how many packets are captured
Since the packet containing the signature is sometimes not sufficient to troubleshoot a problem, you can specify how many packets are captured before and after the packet containing the IPS signature match.
config ips settings
packet-log-history command specifies how many packets are captured before and including the one in which the IPS signature is detected. If the value is more than
1, the packet containing the signature is saved in the packet log, as well as those preceding it, with the total number of logged packets equalling the
packet-log-history setting. For example, if
packet‑log-history is set to
7, the FortiGate unit will save the packet containing the IPS signature match and the six before it.
The acceptable range for
packet-log-history is from 1 to 255. The default is 1.
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.