You can configure SSL-encrypted traffic detection policies so that the FW decrypts SSL-encrypted traffic generated by a user to access the extranet, and configure security policies to enable the FW to check content security of decrypted traffic.
As shown in Figure 1, the FW is deployed on the network boundary as an enterprise gateway, and checks content security of traffic generated by users to access extranet HTTPS servers and SMTPS servers (mail servers).
The SSL decryption certificate can be imported to the FW or generated on the FW.
This section uses a manually generated SSL decryption certificate on the FW as an example.
Note that over 100 common server CA certificates have been preset on the FW by default, which can be used to verify most server certificates. Generally, these default CA certificates are enough and you do not need to import other CA certificates. In some cases, however, if the preset CA certificates cannot verify the peer server certificates, you need to import other CA certificates. This section describes how to import a CA certificate as a configuration step.
Specify a detection profile in the detection policies, and set the file type of the detection profile to Outbound. According to actual requirements, you can configure refined policies, so that the FW decrypts only traffic that really requires content security check. You must avoid proxy policies with wide configuration conditions, because traffic encryption or decryption affects the forwarding performance of the device to a certain extent.
After the SSL-encrypted traffic detection policy is configured, you still need to configure correct security policies and reference the content security profile to check the content security of traffic.
<FW> system-view [FW] interface GigabitEthernet 0/0/1 [FW-GigabitEthernet 0/0/1] ip address 10.1.1.1 24 [FW-GigabitEthernet 0/0/1] quit [FW] firewall zone trust [FW-zone-untrust] add interface GigabitEthernet 0/0/1 [FW-zone-untrust] quit
[FW] interface GigabitEthernet 0/0/2 [FW-GigabitEthernet 0/0/2] ip address 1.1.1.1 24 [FW-GigabitEthernet 0/0/2] quit [FW] firewall zone untrust [FW-zone-trust] add interface GigabitEthernet 0/0/2 [FW-zone-trust] quit
[FW] pki rsa built-in-ca ssl-decryption-certificate create exportable
Info: The name of the new key-pair will be: ssl-decryption-certificate
The size of the public key ranges from 2048 to 4096.
Input the bits in the modules:2048
Generating key-pairs...
............................................+++
...................................................+++
[FW] pki entity ssl-decryption-certificate [FW-pki-entity-ssl-decryption-certificate] common-name ssl-decryption-certificate [FW-pki-entity-ssl-decryption-certificate] fqdn www.example.com [FW-pki-entity-ssl-decryption-certificate] locality trust-Network [FW-pki-entity-ssl-decryption-certificate] country CN [FW-pki-entity-ssl-decryption-certificate] quit
[FW] pki generate built-in-ca certificate rsa-key-pair ssl-decryption-certificate entity ssl-decryption-certificate Please enter the file name for built in CA certificate <length 1-64>: ssl-decryption-certificate.cer Info: Generate built in CA certificate successfully. [FW] pki import-certificate built-in-ca filename ssl-decryption-certificate.cer Info: Succeeded in importing the built in CA certificate. [FW] app-proxy built-in-ca trust filename ssl-decryption-certificate.cer
[FW] pki export built-in-ca rsa-key-pair ssl-decryption-certificate and-certificate ssl-decryption-certificate.cer pem ssl-decryption-certificate.pem password Mypassword@123
The password is used to protect the key file in the certificate. When you install the certificate, the system requires this password.
<FW> cd hda1:/pki/public/ <FW> ftp 10.1.1.100 Trying 10.1.1.100... Press CTRL+K to abort Connected to 10.1.1.100. 220 FTP service ready. User(10.1.1.100:(none)):ftpuser 331 Password required for ftpuser Enter password: 230 User logged in. [ftp] get https_server_ca.crt 200 Port command okay. 150 Opening ASCII mode data connection for https_server_ca.crt. 226 Transfer complete. FTP: 393 byte(s) received in 8.190 second(s) .48byte(s)/sec. [ftp] get smtps_server_ca.crt 200 Port command okay. 150 Opening ASCII mode data connection for smtps_server_ca.crt. 226 Transfer complete. FTP: 393 byte(s) received in 8.190 second(s) .48byte(s)/sec.[ftp] bye
<FW> system-view [FW] pki import-certificate ca filename https_server_ca.crt [FW] pki import-certificate ca filename smtps_server_ca.crt
[FW] app-proxy ca trust filename https_server_ca.crt [FW] app-proxy ca trust filename smtps_server_ca.crt
[FW] profile type decryption name profile [FW-profile-decryption-profile] detect type outbound [FW-profile-decryption-profile] undo unsupport ssl-version block [FW-profile-decryption-profile] undo unsupport ssl-cipher block [FW-profile-decryption-profile] ssl-cipher client-side high medium low [FW-profile-decryption-profile] quit
[FW] decryption-policy [FW-policy-decrytion] rule name 1 [FW-policy-decrytion-rule-1] source-zone trust [FW-policy-decrytion-rule-1] destination-zone untrust [FW-policy-decrytion-rule-1] source-address 10.1.1.0 24 [FW-policy-decrytion-rule-1] service https smtps [FW-policy-decrytion-rule-1] action decrypt profile profile [FW-policy-decrytion-rule-1] quit [FW-policy-decrytion] quit
In this example, a mail content filtering profile needs to be configured to filter traffic of a user who accesses the mail server.
[FW] profile type mail-filter name mail_filter [FW-profile-mail-filter-mail_filter] send-mail anonymity action allow [FW-profile-mail-filter-mail_filter] recv-mail anonymity action allow [FW-profile-mail-filter-mail_filter] send-mail attachment max-amount enable [FW-profile-mail-filter-mail_filter] recv-mail attachment max-amount enable [FW-profile-mail-filter-mail_filter] send-mail attachment max-size enable [FW-profile-mail-filter-mail_filter] recv-mail attachment max-size enable [FW-profile-mail-filter-mail_filter] send-mail sender filter-mode block [FW-profile-mail-filter-mail_filter] send-mail receiver filter-mode block [FW-profile-mail-filter-mail_filter] recv-mail sender filter-mode block [FW-profile-mail-filter-mail_filter] recv-mail receiver filter-mode block
[FW] security-policy [FW-policy-security] rule name policy1 [FW-policy-security-rule-policy1] source-zone trust [FW-policy-security-rule-policy1] destination-zone untrust [FW-policy-security-rule-policy1] source-address 10.1.1.0 24 [FW-policy-security-rule-policy1] service https smtps [FW-policy-security-rule-policy1] profile av default [FW-policy-security-rule-policy1] profile ips default [FW-policy-security-rule-policy1] profile mail-filter mail_filter [FW-policy-security-rule-policy1] action permit [FW-policy-security-rule-policy1] quit [FW-policy-security] quit
<FW> display app-proxy session table
Vsys: 0 10.1.1.1:3449--->2.2.2.2:443 Left:00:00:05 Type:Outbound Age:1
down:0000 -->bytes: 314 <--bytes: 1016
Vsys: 0 10.1.1.1:3450--->2.2.2.2:443 Left:00:00:05 Type:Outbound Age:1
down:0000 -->bytes: 124 <--bytes: 0
Vsys: 0 10.1.1.1:3448--->2.2.2.2:443 Left:00:00:05 Type:Outbound Age:1
down:0000 -->bytes: 628 <--bytes: 1067
# pki rsa built-in-ca ssl-server-ca create exportable pki entity ssl-server-ca common-name ssl-server-ca fqdn www.example.com locality trust-Network country CN # pki generate built-in-ca certificate rsa-key-pair built-in-ca ssl-server-ca entity built-in-ca ssl-server-ca pki import-certificate built-in-ca filename built-in-ca ssl-server-ca.cer app-proxy built-in-ca trust filename built-in-ca ssl-server-ca.cer # pki export built-in-ca rsa-key-pair built-in-ca ssl-server-ca and-certificate built-in-ca ssl-server-ca.cer pem built-in-ca ssl-server-ca.pem password Mypassword@123 # app-proxy ca trust filename https_server_ca.crt app-proxy ca trust filename smtps_server_ca.crt # interface GigabitEthernet 0/0/1 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet 0/0/2 undo shutdown ip address 1.1.1.1 255.255.255.0 # firewall zone trust add interface GigabitEthernet 0/0/1 # firewall zone untrust add interface GigabitEthernet 0/0/2 # profile type decryption name profile detect type outbound undo unsupport ssl-version block undo unsupport ssl-cipher block # decryption-policy rule name 1 source-zone trust destination-zone untrust source-address 10.1.1.0 24 service https smtps action decrypt profile profile # profile type mail-filter name mail-filter rbl-filter enable profile type mail-filter name mail_filter send-mail anonymity action allow recv-mail anonymity action allow send-mail attachment max-amount enable recv-mail attachment max-amount enable send-mail attachment max-size enable recv-mail attachment max-size enable send-mail sender filter-mode block send-mail receiver filter-mode block recv-mail sender filter-mode block recv-mail receiver filter-mode block # security-policy rule name policy1 source-zone trust destination-zone untrust source-address 10.1.1.0 24 service https service smtps profile av default profile ips default profile mail-filter mail_filter action permit