resumen: Si las conexiones al servidor de correo están protegidas mediante un certificado SSL/TLS, puede mejorar el nivel de protección frente a ataques de man-in-the-middle y degradación activando DANE. DANE también ofrece protección frente a posibles suplantaciones de sitios web como consecuencia de la afectación de autoridades de certificación.

In this topic, you will learn how to harden connections to the server using DANE: automatically via SSL It! and manually. Note that this topic is not meant to be an exhaustive source of information about DANE or TLSA DNS records.

In Plesk, you can harden connections to the server using DANE in the following ways:

  • Automatically by using the SSL It! extension.
  • Manually by generating a hash of the SSL/TLS certificate’s public key, and then adding a TLSA DNS record.

Each way has its own advantages as well as downsides.

The automatic implementation of DANE using SSL It! is easy and needs just a few clicks. However, you can harden only one connection type with DANE: to the mail server for an individual domain. Additionally, you can use DANE only with Let’s Encrypt certificates. If you want to use DANE with SSL/TLS certificates of other certificate authorities, choose the manual implementation.

The manual implementation of DANE is a multistep procedure, which requires time and effort (even though we provide you with a step-by-step guide below). As for the benefits, you can harden connections not only to the mail server but also other ones secured with SSL/TLS certificates. You can also use DANE with SSL/TLS certificates of any certificate authorities, not limited to Let’s Encrypt only.

Regardless of the way you choose, you will need to make sure your server and/or hosted domains meet certain requirements necessary for using DANE.

(Automatically) Hardening Mail Connections Using DANE

Before you can automatically harden a connection to the mail server using DANE, make sure your server and hosted domains have the following configuration:

  • For the Plesk server: - The mail service is enabled. - DKIM is enabled. - Plesk is the primary DNS server.
  • For the domain whose connection to the mail server you want to harden using DANE: - The mail service is enabled. - DKIM is enabled. - The MX record exists and it resolves to the IP address of the Plesk server. - DNSSEC is enabled.

If all the conditions above are fulfilled, you can harden a connection to the mail server using DANE with the help of the SSL It! extension.

Hardening a Mail Connection Using DANE via SSL It!

  1. Acceso a Plesk.

  2. Vaya a Sitios web y dominios y localice el dominio en cuestión.

  3. Haga clic en Certificados SSL/TLS.

  4. Under «Install a free basic certificate provided by Let’s Encrypt», click Install.

  5. Keep the «Secure the domain name» checkbox selected.

  6. (Optional) Select other checkboxes depending on subdomains you want to secure.

  7. Select the «Assign the certificate to the mail domain» and «DANE support» checkboxes.

    image ssl it 1

  8. Haga clic en Obténgalo gratis.

    image ssl it 2

  9. Wait a while until the created TLSA records necessary for DANE are propagated to the DNS server, and then click Install.

SSL It! has secured your domain with a Let’s Encrypt certificate and also hardened the domain’s connection to the mail server using DANE.

Automatically Renewing Certificates with DANE

SSL It! automatically renews free SSL/TLS certificates from Let’s Encrypt 30 days in advance of their expiration. If a certificate was issued with DANE support, SSL It! will configure it for a new certificate as well.

When a new certificate is ready to be installed on the domain, SSL It! creates a corresponding set of TLSA records and sets a timer for 24 hours (it is the default value). After the timer expires, the next run of the SSL It! «Keep websites secured» task installs the new certificate and removes old TLSA records. Depending on the configured settings, Plesk also sends an email notification on the certificate renewal.

If desired, you can change the default 24-hour interval between the creation of TLSA records and the installation of a new certificate by adding lines of the following pattern to the panel.ini file:

[ext-sslit]
dane-confirmation-interval-in-hours = <the number of hours>

Por ejemplo:

[ext-sslit]
dane-confirmation-interval-in-hours = 12

Disabling DANE Support in SSL It!

By default, DANE support is enabled in SSL It! if the Plesk server and hosted domains meet the configuration criteria necessary for DANE. It means that you and your customers can see and select the «DANE support» checkbox under «Assign the certificate to the mail domain» when securing a domain with a Let’s Encrypt certificate.

To safeguard your customers, you may want to disable DANE support in SSL It! by hiding the corresponding checkbox. To do so, add the following lines to the panel.ini file:

[ext-sslit]
daneEnabled = false

(Manually) Hardening Server Connections Using DANE

You can harden connections via any application protocol that is already secured using an SSL/TLS certificate via the corresponding combination of transport protocol and port (for example, «TCP/25» for SMTP, «TCP/443» for HTTPS, and so on).

La mejora de la protección de conexiones mediante un determinado protocolo de aplicación consiste en dos pasos:

  • En primer lugar debe generar un hash de la clave pública del certificado SSL/TLS. Si bien también puede usar una clave pública sin hash o el hash de todo el certificado, en este ejemplo usaremos un hash de clave pública.
  • A continuación debe añadir un registro DNS TLSA que indique distintos parámetros necesarios, incluyendo el hash.

Debe repetir estos pasos para cada protocolo de aplicación cuyo nivel de protección desee mejorar.

En el ejemplo que se muestra a continuación proporcionamos los pasos necesarios para mejorar el nivel de protección de conexiones SMTP al servidor de correo para un dominio en concreto. Puede usar dichos pasos como referencia para mejorar la protección de otras conexiones, si así lo desea.

Requisitos mínimos

Antes poder mejorar el nivel de protección de las conexiones SMTP mediante DANE para un dominio en concreto, deberá hacer lo siguiente:

Protección de las conexiones SMTP del servidor

Nota: En el siguiente ejemplo, usaremos el hash SHA-256 de la clave pública del certificado SSL/TLS, y no el certificado completo. De esta manera, no será necesario actualizar el registro TLSA al renovar el certificado, a menos que la clave pública también cambie.

Generación del hash de clave pública del certificado

  1. Acceso a Plesk.

  2. Vaya a Sitios web y dominios y localice el dominio en cuestión.

  3. Haga clic en Certificados SSL/TLS.

  4. Localice el certificado que protege el servidor de correo (el marcado con «Protege el correo») y haga clic en el icono download para descargar el certificado como un archivo *.pem.

  5. Sitúe el archivo *.pem en una máquina Linux y ejecute el comando detallado a continuación. Compruebe que de antemano ha cambiado el directorio de trabajo al que contiene el archivo y que ha reemplazado «certificate.pem» por el nombre de archivo actual:

    openssl x509 -in certificate.pem -pubkey -noout | openssl rsa -pubin -outform der | sha256sum | awk '{print $1}'
    

La salida resultante (por ejemplo, 499e42e36d7b04529725a1f8036e0f7cf1030b4e25a3fa1988f2572e1ce70d28) es el hash SHA-256 que usará cuando cree el registro DNS TLSA.

Adición de un registro DNS TLSA

  1. Acceso a Plesk.
  2. Vaya a Sitios web y dominios y localice el dominio en cuestión.
  3. Vaya a la pestaña Hosting y DNS y haga clic en DNS.
  4. Haga clic en Añadir registro.
  5. Seleccione «TLSA» en el menú desplegable «Tipo de registro».
  6. (Opcional) Indique un TTL para el registro. Si no está seguro sobre el TTL óptimo, deje el campo «TTL» en blanco. En este caso, se usará el valor TTL predeterminado.
  7. Indique el puerto «25». No añada el guion bajo, puesto que se añadirá automáticamente.
  8. Indique el protocolo «tcp». No añada el guion bajo, puesto que se añadirá automáticamente.
  9. Indique «mail» en el campo «Nombre de dominio».
  10. Seleccione «3, DANE-EE» en el menú desplegable «Uso».
  11. Seleccione «1, SPKI» en el menú desplegable «Selector».
  12. Seleccione «1, SHA-256» en el menú desplegable «Tipo de coincidencia».
  13. Pegue el hash de la clave pública del certificado generado anteriormente al campo «Datos de asociación del certificado».
  14. Haga clic en ACEPTAR y a continuación haga clic en Actualizar para aplicar los cambios a la zona DNS.

Se añade un registro DNS TLSA y se aplican los cambios efectuados en la zona DNS. Una vez propagados los cambios (esto suele tardar unas 24 horas), DANE pasará a estar activo para las conexiones SMTP al dominio.