Skip to content

Commit 5a81a79

Browse files
committed
2 parents 311fcb4 + 406c396 commit 5a81a79

File tree

3 files changed

+84
-14
lines changed

3 files changed

+84
-14
lines changed

articles/iot-edge/how-to-create-iot-edge-device.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,32 +138,32 @@ To see more of the features of DPS, see the [Features section of the overview pa
138138

139139
## Choose an authentication method
140140

141-
### Symmetric keys attestation
142-
143-
Symmetric key attestation is a simple approach to authenticating a device. This attestation method represents a "Hello world" experience for developers who are new to device provisioning, or don't have strict security requirements.
144-
145-
When you create a new device identity in IoT Hub, the service creates two keys. You place one of the keys on the device, and it presents the key to IoT Hub when authenticating.
146-
147-
This authentication method is faster to get started but not as secure. Device provisioning using a TPM or X.509 certificates is more secure and should be used for solutions with more stringent security requirements.
148-
149141
### X.509 certificate attestation
150142

151-
Using X.509 certificates as an attestation mechanism is an excellent way to scale production and simplify device provisioning. Typically, X.509 certificates are arranged in a certificate chain of trust. Starting with a self-signed or trusted root certificate, each certificate in the chain signs the next lower certificate. This pattern creates a delegated chain of trust from the root certificate down through each intermediate certificate to the final "leaf" certificate installed on a device.
143+
Using X.509 certificates as an attestation mechanism is the recommended way to scale production and simplify device provisioning. Typically, X.509 certificates are arranged in a certificate chain of trust. Starting with a self-signed or trusted root certificate, each certificate in the chain signs the next lower certificate. This pattern creates a delegated chain of trust from the root certificate down through each intermediate certificate to the final "leaf" certificate installed on a device.
152144

153-
You create two X.509 identity certificates and place them on the device. When you create a new device identity in IoT Hub, you provide thumbprints from both certificates. When the device authenticates to IoT Hub, it presents one certificate and IoT Hub verifies that the certificate matches its thumbprint.
145+
You create two X.509 identity certificates and place them on the device. When you create a new device identity in IoT Hub, you provide thumbprints from both certificates. When the device authenticates to IoT Hub, it presents one certificate and IoT Hub verifies that the certificate matches its thumbprint. The X.509 keys on the device should be stored in a Hardware Security Module (HSM). For example, PKCS#11 modules, ATECC, dTPM, etc.
154146

155-
This authentication method is more secure than symmetric keys and is recommended for production scenarios.
147+
This authentication method is more secure than symmetric keys and supports group enrollments which provides a simplified management experience for a high number of devices. This authentication method is recommended for production scenarios.
156148

157149
### Trusted platform module (TPM) attestation
158150

159-
Using TPM attestation is the most secure method for device provisioning, as it provides authentication features in both software and hardware. Each TPM chip uses a unique endorsement key to verify its authenticity.
151+
Using TPM attestation is a method for device provisioning that uses authentication features in both software and hardware. Each TPM chip uses a unique endorsement key to verify its authenticity.
160152

161153
TPM attestation is only available for provisioning at-scale with DPS, and only supports individual enrollments not group enrollments. Group enrollments aren't available because of the device-specific nature of TPM.
162154

163155
TPM 2.0 is required when you use TPM attestation with the device provisioning service.
164156

165157
This authentication method is more secure than symmetric keys and is recommended for production scenarios.
166158

159+
### Symmetric keys attestation
160+
161+
Symmetric key attestation is a simple approach to authenticating a device. This attestation method represents a "Hello world" experience for developers who are new to device provisioning, or don't have strict security requirements.
162+
163+
When you create a new device identity in IoT Hub, the service creates two keys. You place one of the keys on the device, and it presents the key to IoT Hub when authenticating.
164+
165+
This authentication method is faster to get started but not as secure. Device provisioning using a TPM or X.509 certificates is more secure and should be used for solutions with more stringent security requirements.
166+
167167
## Next steps
168168

169169
You can use the table of contents to navigate to the appropriate end-to-end guide for creating an IoT Edge device for your IoT Edge solution's platform, provisioning, and authentication requirements.

articles/iot-edge/how-to-provision-devices-at-scale-linux-tpm.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ The tasks are as follows:
5252

5353
A physical Linux device to be the IoT Edge device.
5454

55+
If you are a device manufacturer then refer to guidance on [integrating a TPM into the manufacturing process](../iot-dps/concepts-device-oem-security-practices.md#integrating-a-tpm-into-the-manufacturing-process).
56+
5557
# [Virtual machine](#tab/virtual-machine)
5658

5759
A Windows development machine with [Hyper-V enabled](/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v). This article uses Windows 10 running an Ubuntu Server VM.
@@ -141,6 +143,8 @@ After the installation is finished and you've signed back in to your VM, you're
141143

142144
## Retrieve provisioning information for your TPM
143145

146+
<!-- 1.1 -->
147+
:::moniker range="<iotedge-1.4"
144148
In this section, you build a tool that you can use to retrieve the registration ID and endorsement key for your TPM.
145149

146150
1. Sign in to your device, and then follow the steps in [Set up a Linux development environment](https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/devbox_setup.md#linux) to install and build the Azure IoT device SDK for C.
@@ -157,11 +161,74 @@ In this section, you build a tool that you can use to retrieve the registration
157161

158162
1. The output window displays the device's **Registration ID** and the **Endorsement key**. Copy these values for use later when you create an individual enrollment for your device in the device provisioning service.
159163

160-
> [!TIP]
161-
> If you don't want to use the SDK tool to retrieve the information, you need to find another way to obtain the provisioning information. The endorsement key, which is unique to each TPM chip, is obtained from the TPM chip manufacturer associated with it. You can derive a unique registration ID for your TPM device. For example, you can create an SHA-256 hash of the endorsement key.
164+
:::moniker-end
165+
<!-- end 1.1 -->
166+
167+
<!-- iotedge-1.4 -->
168+
:::moniker range=">=iotedge-1.4"
169+
170+
> [!NOTE]
171+
> This article previously used the `tpm_device_provision` tool from the IoT C SDK to generate provisioning info. If you relied on that tool previously, then be aware the steps below generate a different registration ID for the same public endorsement key. If you need to recreate the registration ID as before then refer to how the C SDK's [tpm_device_provision tool](https://github.com/Azure/azure-iot-sdk-c/tree/main/provisioning_client/tools/tpm_device_provision) generates it. Be sure the registration ID for the individual enrollment in DPS matches the regisration ID the IoT Edge device is configured to use.
172+
173+
In this section, you use the TPM2 software tools to retrieve the endorsement key for your TPM and then generate a unique registration ID. This section corresponds with [Step 3: Device has firmware and software installed](../iot-dps/concepts-device-oem-security-practices.md#step-3-device-has-firmware-and-software-installed) in the process for [integrating a TPM into the manufacturing process](../iot-dps/concepts-device-oem-security-practices.md#integrating-a-tpm-into-the-manufacturing-process).
174+
175+
### Install the TPM2 Tools
176+
Sign in to your device, and install the `tpm2-tools` package.
177+
178+
# [Ubuntu / Debian / Raspberry Pi OS](#tab/ubuntu+debian+rpios)
179+
180+
181+
```bash
182+
sudo apt-get install tpm2-tools
183+
```
184+
185+
# [Red Hat Enterprise Linux](#tab/rhel)
186+
187+
188+
```bash
189+
sudo yum install tpm2-tools
190+
```
191+
192+
---
193+
194+
Run the following script to read the endorsement key, creating one if it does not already exist.
195+
196+
```bash
197+
#!/bin/sh
198+
if [ "$USER" != "root" ]; then
199+
SUDO="sudo "
200+
fi
201+
202+
$SUDO tpm2_readpublic -Q -c 0x81010001 -o ek.pub 2> /dev/null
203+
if [ $? -gt 0 ]; then
204+
# Create the endorsement key (EK)
205+
$SUDO tpm2_createek -c 0x81010001 -G rsa -u ek.pub
206+
207+
# Create the storage root key (SRK)
208+
$SUDO tpm2_createprimary -Q -C o -c srk.ctx > /dev/null
209+
210+
# make the SRK persistent
211+
$SUDO tpm2_evictcontrol -c srk.ctx 0x81000001 > /dev/null
212+
213+
# open transient handle space for the TPM
214+
$SUDO tpm2_flushcontext -t > /dev/null
215+
fi
216+
217+
printf "Gathering the registration information...\n\nRegistration Id:\n%s\n\nEndorsement Key:\n%s\n" $(sha256sum -b ek.pub | cut -d' ' -f1 | sed -e 's/[^[:alnum:]]//g') $(base64 -w0 ek.pub)
218+
$SUDO rm ek.pub srk.ctx 2> /dev/null
219+
220+
```
221+
222+
The output window displays the device's **Endorsement key** and a unique **Registration ID**. Copy these values for use later when you create an individual enrollment for your device in the device provisioning service.
223+
224+
:::moniker-end
225+
<!-- end iotedge-1.4 -->
162226

163227
After you have your registration ID and endorsement key, you're ready to continue.
164228

229+
> [!TIP]
230+
> If you don't want to use the TPM2 software tools to retrieve the information, you need to find another way to obtain the provisioning information. The endorsement key, which is unique to each TPM chip, is obtained from the TPM chip manufacturer associated with it. You can derive a unique registration ID for your TPM device. For example, as shown above you can create an SHA-256 hash of the endorsement key.
231+
165232
<!-- Create an enrollment for your device using TPM provisioning information H2 and content -->
166233
[!INCLUDE [tpm-create-a-device-provision-service-enrollment.md](../../includes/tpm-create-a-device-provision-service-enrollment.md)]
167234

articles/iot-edge/how-to-provision-devices-at-scale-linux-x509.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ The tasks are as follows:
2424

2525
Using X.509 certificates as an attestation mechanism is an excellent way to scale production and simplify device provisioning. Typically, X.509 certificates are arranged in a certificate chain of trust. Starting with a self-signed or trusted root certificate, each certificate in the chain signs the next lower certificate. This pattern creates a delegated chain of trust from the root certificate down through each intermediate certificate to the final "leaf" certificate installed on a device.
2626

27+
> [!TIP]
28+
> If your device has a Hardware Security Module (HSM) such as a TPM 2.0, then we recommend storing the X.509 keys securely in the HSM. Learn more about how to implement the zero-touch provisioning at scale described in [this blueprint](https://azure.microsoft.com/blog/the-blueprint-to-securely-solve-the-elusive-zerotouch-provisioning-of-iot-devices-at-scale) with the [iotedge-tpm2cloud](https://aka.ms/iotedge-tpm2cloud) sample.
29+
2730
## Prerequisites
2831

2932
<!-- Cloud resources prerequisites H3 and content -->

0 commit comments

Comments
 (0)