概要: メールサーバへの接続が SSL/TLS 証明書で保護されている場合、DANE(DNS-based Authentication of Named Entities)を有効にすることでダウングレード攻撃や中間者攻撃への耐久性を高めることができます。 DANE はまた、認証局が侵害を受けたことによるウェブサイトのなりすましからも保護します。

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. Plesk にログインします

  2. [ウェブサイトとドメイン]に移動して、必要なドメインを探します。

  3. [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. [無料で取得]をクリックします。

    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>

たとえば、

[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).

特定のアプリケーションプロトコル経由の接続を堅牢化するのは、2 ステップのプロセスです。

  • まず、SSL/TLS 証明書の公開鍵のハッシュを作成する必要があります。ハッシュ化されていない公開鍵や証明書全体のハッシュを使用することもできますが、この例では公開鍵ハッシュを使用します。
  • 次に、ハッシュを含め、多数の必須パラメータを指定する TLSA DNS レコードを追加する必要があります。

堅牢化したいアプリケーションプロトコルごとに、上記の手順を繰り返す必要があります。

以下の例では、個別ドメイン用にメールサーバへの SMTP 接続を堅牢化する手順を説明します。必要に応じて、これを参考に、他の接続を堅牢化することができます。

前提条件

個別ドメインに対して DANE を使用して SMTP 接続を堅牢化するためには、以下を行う必要があります。

SMTP サーバの接続を保護する

注釈: 以下の例では、証明書全体ではなく、SSL/TLS 証明書の公開鍵の SHA-256 ハッシュを使用します。こうすることで、公開鍵も変更した場合を除き、証明書を更新するときに TLSA レコードを更新する必要はありません。

証明書の公開鍵のハッシュを生成する

  1. Plesk にログインします

  2. [ウェブサイトとドメイン]に移動して、必要なドメインを探します。

  3. [SSL/TLS 証明書]をクリックします。

  4. メールサーバを保護するための証明書を探して(「メールをセキュリティ強化」と記されているもの)、download アイコンをクリックして証明書を *.pem ファイルとしてダウンロードします。

  5. Linux マシンに *.pem ファイルを保存して、次のコマンドを実行します(作業ディレクトリをこのファイルが含まれるディレクトリに変更しておき、"certificate.pem" を実際のファイル名に置き換えてください)。

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

その結果、TLSA DNS レコードの作成時に使用される SHA-256 ハッシュが出力されます(例: 499e42e36d7b04529725a1f8036e0f7cf1030b4e25a3fa1988f2572e1ce70d28)。

TLSA DNS レコードを追加する

  1. Plesk にログインします
  2. [ウェブサイトとドメイン]に移動して、必要なドメインを探します。
  3. [ホスティングと DNS]タブに移動して、[DNS]をクリックします。
  4. [レコードを追加]をクリックします。
  5. [レコードタイプ]ドロップダウンメニューから「TLSA」を選択します。
  6. (オプション)レコードに TTL を指定します。最適な TTL がわからない場合は[TTL]フィールドを空欄にしておいてください。この場合、デフォルトの TTL 値が使用されます。
  7. ポート「25」を指定します。アンダースコア文字は自動的に追加されるため、追加しないでください。
  8. プロトコル「tcp」を指定します。アンダースコア文字は自動的に追加されるため、追加しないでください。
  9. [ドメイン名]フィールドに「mail」と入力します。
  10. [使用状況]ドロップダウンメニューから「3, DANE-EE」を選択します。
  11. [セレクタ]ドロップダウンメニューから「1, SPKI」を選択します。
  12. [一致タイプ]ドロップダウンメニューから「1, SHA-256」を選択します。
  13. 先ほど生成した証明書の公開鍵のハッシュを[証明書関連付けデータ]フィールドに貼り付けます。
  14. [OK]をクリックしてから[更新]をクリックして、DNS ゾーンへの変更を適用します。

TLSA DNS レコードが追加され、DNS ゾーンへの変更が適用されます。DNS の変更がプロパゲートされたら(通常約 24 時間)、このドメインの SMTP 接続に対して DANE がアクティブになります。