4.2. Transport Layer Security

For production MetaDefender Email Gateway Security deployments a more sophisticated TLS configuration is recommended than what is described below. Please consult the nginx documentation on Configuring HTTPS servers for further details.

It is not recommended to use self-signed certificates in production environments. If you do not have a suitable certificate, you can apply to a Certificate Authority to obtain one.

Digital ID

To keep the solution simple, MetaDefender Email Gateway Security uses a single private/public key pair as its digital identifier.

This digital ID –the same certificate– is used when MetaDefender Email Gateway Security acts either as a server or as a client.

Key and certificate files must be in PEM format.

Key and certificate files

The following files of the digital ID must be placed on the following paths in the server's file system:

 

Path

Private key

<install base>\data\key.pem

Example:

C:\Program Files\OPSWAT\Metadefender Email Security\data\key.pem

Certificate

<install base>\data\cert.pem

Example:

C:\Program Files\OPSWAT\Metadefender Email Security\data\cert.pem

Private key and certificate

<install base>\data\tls.pem

Example:

C:\Program Files\OPSWAT\Metadefender Email Security\data\tls.pem

Inbound connections

Web Management Console and Public Rescan Page

OpenSSL required

To enable TLS for the web management console, OpenSSL must be installed on the server.

For details see 3.1. Prerequisites.

MetaDefender Email Gateway Security supports accessing the Web Management Console and the Public Rescan functionality (for details see 5.6. Password protected attachments) via HTTPS. This feature is, however, not enabled by default. To enable HTTPS you should perform the following steps.

Public server address

The TLS settings of the web management console are propagated to the Public server address under Settings > General / Configuration.

For example, when TLS is enabled for the web management console, then the scheme for the Public server address will be changed to https. When TLS is disabled for the web management console, then the scheme for the Public server address will be downgraded to http.

For details see 4.3. Settings.

  1. Define a certificate and private key pair under Settings > Certificates for the HTTPS connections.

    images/download/attachments/3720195/image2020-7-3_13-11-35.png

    images/download/attachments/3720195/image2020-7-3_13-17-25.png

  2. Using the certificate defined in the previous step, enable HTTPS under Settings > Security.

    images/download/attachments/3720195/image2020-9-16_15-37-26.png

Inbound SMTP services

Email Gateway Security can listen on multiple SMTP ports providing the option to apply different TLS settings for each SMTP port.

To enable TLS for a certain inbound SMTP service:

  1. Define a certificate and private key pair under Settings > Certificates for the HTTPS connections.

    images/download/attachments/3720195/image2020-12-10_9-58-43.png
  2. Under Settings > Security / SMTP Server Connection Settings select the SMTP service for which the TLS needs to be set
    images/download/attachments/3720195/image2020-12-10_10-1-5.png

  3. In the Edit SMTP endpoint panel apply the desired settings for the SMTP service:

    1. Select the appropriate SMTP encryption method

      images/download/attachments/3720195/image2020-12-10_10-6-3.png
    2. Use the certificate defined in step 1 and select the desired TLS versions

      Specific port only

      These TLS settings apply to this specific port only.

      images/download/attachments/3720195/image2020-12-10_10-7-54.png

TLS cipher suite settings for inbound SMTP

Email Gateway Security uses Window's Schannel for inbound SMTP secure connections by default. This makes possible to configure the accepted ciphers, cipher suites via Windows registry. You can find information about how to configure specific settings here: https://docs.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings.

images/download/attachments/3720195/image2020-3-18_16-40-33.png

Outbound connections

TLS for outbound connections can be set up at the appropriate server profile. For details see 4.6. Server profiles.

In case of outbound connections the servers certificate must always be trusted by the client.

In practice it means that either the CA certificate –that was used for signing the server's certificate–, or the server's certificate itself must be installed in the Email Gateway Security's operating system's trusted certificate store.

Connection to MetaDefender Core

To connect to a Core server over TLS perform the following steps:

  1. Configure the Core server to listen on HTTPS. For details see 3.8.1 Enabling HTTPS,

  2. Add this Core to your server profiles using https scheme. For details see 4.6. Server profiles.

Outbound SMTP

To connect to an SMTP server over TLS first you need to decide which favour to use: StartTLS (TLS over SMTP) or SMTPS (SMTP over TLS).

Due to security considerations always prefer SMTPS to StartTLS whenever possible.

StartTLS

In case of StartTLS you still need to decide whether using StartTLS is just an option or it is mandatory.

Optional StartTLS

If StartTLS is optional then the client will try to establish the TLS connection, and if it fails, then the connection will fail over to a clear text connection.

To connect to an SMTP server using optional StartTLS perform the following steps:

  1. Configure the SMTP server to either

    1. Support StartTLS – in this case clear text SMTP connections will be upgraded to TLS; or

    2. Not support StartTLS – in this case SMTP connections will be fall back to clear text.

  2. Add this SMTP server to your server profiles

    1. Using smtp scheme, with

    2. TRANSPORT LEVEL ENCRYPTION set to STARTTLS optional.

    3. For details see 4.6. Server profiles.

Mandatory StartTLS

If StartTLS is mandatory then the client will try to establish the TLS connection, and if it fails, then the connection will fail.

To connect to an SMTP server using mandatory StartTLS perform the following steps:

  1. Configure the SMTP server to Support StartTLS;

  2. Add this SMTP server to your server profiles

    1. Using smtp scheme, with

    2. TRANSPORT LEVEL ENCRYPTION set to STARTTLS required.

    3. For details see 4.6. Server profiles.

SMTPS

In case of SMTPS, the TLS handshake comes first, and if (and only if) it succeeds, then the SMTP connection is established over the TLS.

To connect to an SMTP server over TLS perform the following steps:

  • Configure the SMTP server to listen on SMTPS.

  • Add this SMTP server to your server profiles using smtps scheme. For details see 4.6. Server profiles.