Skip to main content

クラウドプラットフォームポリシーの作成

目的

  • Azure Event Grid MQTT ブローカーをデバイスにオンボーディングする。

  • 証明書ベースの MQTT クライアント認証でデバイスをセキュアに接続する。

  • DigiCert® Device Trust Manager のクラウドプラットフォームポリシー機能によって、デバイスを自動的にプロビジョニングする。

開始する前に

Event Grid 名前空間とリソースを作成し管理する権限を持つアクティブな Microsoft Azure サブスクリプションが必要です。

Microsoft Azure Event Grid MQTT ブローカー:

  • Create an MQTT Broker namespace:

    For creating an MQTT Broker namespace, see Create, view, and manage namespaces on the Azure Event Grid documentation page.

  • Enable certificate-based MQTT authentication:

    For configuring Microsoft Azure to authenticate MQTT clients using X.509 certificates, see the MQTT client authentication using certificates on the Azure Event Grid documentation page.

  • Establish TLS Trust with Azure Event Grid:

    To ensure a secure TLS connection between the device and the Azure Event Grid, the device must trust the Event Grid endpoint’s server certificate.

    • Retrieve the TLS certificate chain from the Event Grid endpoint using the following command:

      openssl s_client -connect <eventgrid-endpoint>:443 -showcerts
    • Install the root and intermediate CA certificates on the device at the following location:

      /etc/digicert/keystore/ca
  • Configure and keep the following details from your Azure account:

  • Collect and keep the following configuration details from your Azure account:

    • Azure subscription ID

    • Event Grid namespace

    • Client ID

Device Trust Manager

ステップ 1: クラウドプラットフォームポリシーの作成

以下の手順で、クラウドプラットフォームポリシーを作成します。

  1. Device Trust Manager]メニューで[クラウドプラットフォームポリシー]を選択します。

  2. [Create cloud platform policy]をクリックします。

  3. クラウドプラットフォームポリシー名を指定します。

  4. Select the Set up Azure Event Grid MQTT broker checkbox.

  5. Select the Gather the data for broke setup checkbox.

  6. ドロップダウンリストから[発行 CA]を選択します。

  7. 発行 CA 証明書をダウンロードします。

  8. 発行 CA 証明書を Azure Event Grid Services に登録します。

    登録するには、「証明書を使用した MQTT クライアント認証」に記載されている手順に従ってください。

  9. [Set up certificate issuance]チェックボックスを選択します。

  10. [次へ]をクリックして、MQTT ブローカーを追加します。

ステップ 2: Microsoft Azure Event Grid MQTT ブローカーの追加

次に、Microsoft Azure Event Grid MQTT ブローカーを追加します。

  1. [Add MQTT broker]をクリックします。

  2. 画面の指示に従って、Device Trust Manager で必要な構成条件の詳細を、Azure アカウントから指定します。

  3. Azure アカウントから必要な構成条件をすべて入力したら、[Platform Onboarding Test]をクリックして、提供した構成パラメータが正しいかどうかを確認し、クラウドプラットフォームポリシーを追加します。

  4. [Add broker]をクリックして、MQTT ブローカーを追加します。

  5. Click Next to configure the cloud platform policy.

ステップ 3: クラウドプラットフォームポリシーの設定

クラウドプラットフォームポリシーを設定する手順:

  1. [クラウドプラットフォームポリシーの設定]タブに移動します。

  2. Optionally, under Cloud platform provisioning, select Provision device on certificate issuance.

    • Enable this setting to automatically provision devices to the configured cloud platform whenever an operational certificate is issued

    • If you keep it unchecked, device provisioning will not occur automatically. Instead, you must initiate provisioning manually through the cloud provisioning API.

  3. Optionally, Assign the policy to a division.

  4. [Add assignment]をクリックして、MQTT ブローカーでデバイス認証用の X.509 証明書を発行する証明書管理ポリシーを選択します。

  5. [デバイスグループ]ドロップダウンメニューから、デバイスグループを選択します。

    • このグループで選択したデバイスは、MQTT ブローカーでデバイス ID が作成され、接続する MQTT エンドポイントが割り当てられます。

    • 選択したデバイスグループに基づいて、それに関連付けられた運用管理ポリシー証明書が自動的に[運用証明書管理ポリシー]ドロップダウンメニューに表示されます。

  6. [Create cloud platform policy]をクリックします。

    クラウドプラットフォームポリシーの作成に成功すると、ポリシーが[完了したポリシー]リストに表示されます。

How devices discover MQTT broker details?

After the cloud platform policy is applied to a device, Device Trust Manager stores the policy metadata locally on the device at:

/etc/digicert/cloudprovider

Inside this /etc/digicert/cloudprovider directory, the device stores a JSON file that contains:

  • The MQTT broker endpoint and port

  • Device registration identifiers

  • Certificate metadat used for authentication

  • Cloud platform policy status information

Applications running on the device can read this file at runtime to configure secure MQTT communication.

The following is an example file of how cloud platform policy metadata is stored:

JSON example:

{
  "operationId": "<unique operation identifier>",
  "registrationState": {
    "assignedHub": "<iot-broker-endpoint:port>",
    "createdDateTimeUtc": "<policy-creation-timestamp>",
    "deviceId": "<unique-device-id>",
    "registrationId": "<iot-platform-registration-resource-id>",
    "x509": {
      "certificateInfo": {
        "certificateId": "<certificate-identifier>",
        "commonName": "<device-policy-name>",
        "status": "ISSUED",
        "validFrom": "<certificate-start-date>",
        "validTo": "<certificate-expiry-date>",
        "thumbprintSha256": "<certificate-thumbprint>",
        "serialNumber": "<certificate-serial-number>"
      },
      "enrollmentGroupId": "<enrollment-group-id>"
    }
  },
  "status": "ENABLED"
}

How applications use this information?

Applications on the device can:

  • Read the assignedHub value to determine the correct MQTT broker endpoint

  • Use the associated X.509 certificate for mutual TLS (mTLS) authentication

  • Validate certificate status, validity period, and trust chain

  • Dynamically configure MQTT client settings without hardcoding endpoints

This approach ensures that:

  • Broker details stay in sync with the cloud platform policy configuration

  • Certificates and device identity are centrally managed

  • Applications can securely connect without manual updates