Skip to content

Commit 3194a77

Browse files
authored
Fix build errors
1 parent 4f0a33c commit 3194a77

File tree

5 files changed

+241
-31
lines changed

5 files changed

+241
-31
lines changed

articles/iot-hub/.openpublishing.redirection.iot-hub.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,32 +1350,32 @@
13501350
},
13511351
{
13521352
"source_path_from_root": "/articles/iot-hub/iot-hub-x509-certificate-concepts.md",
1353-
"redirect_url": "/azure/iot-hub/authenticate-x509.md",
1353+
"redirect_url": "/azure/iot-hub/authenticate-x509",
13541354
"redirect_document_id": true
13551355
},
13561356
{
13571357
"source_path_from_root": "/articles/iot-hub/iot-hub-x509ca-overview.md",
1358-
"redirect_url": "/azure/iot-hub/authenticate-x509.md",
1358+
"redirect_url": "/azure/iot-hub/authenticate-x509",
13591359
"redirect_document_id": false
13601360
},
13611361
{
13621362
"source_path_from_root": "/articles/iot-hub/iot-hub-x509ca-concept.md",
1363-
"redirect_url": "/azure/iot-hub/authenticate-x509.md",
1363+
"redirect_url": "/azure/iot-hub/authenticate-x509",
13641364
"redirect_document_id": false
13651365
},
13661366
{
13671367
"source_path_from_root": "/articles/iot-hub/iot-hub-dev-guide-azure-ad-rbac.md",
1368-
"redirect_url": "/azure/iot-hub/authenticate-azure-ad.md",
1368+
"redirect_url": "/azure/iot-hub/authenticate-azure-ad",
13691369
"redirect_document_id": true
13701370
},
13711371
{
13721372
"source_path_from_root": "/articles/iot-hub/iot-hub-dev-guide-sas.md",
1373-
"redirect_url": "/azure/iot-hub/authenticate-sas.md",
1373+
"redirect_url": "/azure/iot-hub/authenticate-sas",
13741374
"redirect_document_id": true
13751375
},
13761376
{
13771377
"source_path_from_root": "/articles/iot-hub/iot-hub-devguide-security.md",
1378-
"redirect_url": "/azure/iot-hub/authenticate-overview.md",
1378+
"redirect_url": "/azure/iot-hub/authenticate-overview",
13791379
"redirect_document_id": false
13801380
},
13811381
{

articles/iot-hub/authenticate-sas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Use shared access policies for IoT hub-level access, and use the individual devi
4343
### IoT hub-level shared access policies
4444

4545
Shared access policies can grant any combination of permissions. You can define policies in the [Azure portal](https://portal.azure.com), programmatically by using the [IoT Hub Resource REST APIs](/rest/api/iothub/iothubresource), or using the [az iot hub policy](/cli/azure/iot/hub/policy) CLI. A newly created IoT hub has the following default policies:
46-
46+
4747
| Shared Access Policy | Permissions |
4848
| -------------------- | ----------- |
4949
| iothubowner | All permission |
@@ -205,7 +205,7 @@ The following code generates a SAS token using the resource URI and signing key.
205205

206206
String token = "SharedAccessSignature sr=" + URLEncoder.encode(resourceUri, StandardCharsets.UTF_8)
207207
+ "&sig=" + URLEncoder.encode(signature, StandardCharsets.UTF_8.name()) + "&se=" + expiry;
208-
208+
209209
return token;
210210
}
211211
```

articles/iot-hub/authenticate-x509.md

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
---
2-
title: Concepts of Azure IoT Hub X.509 security | Microsoft Docs
3-
description: Concept - understanding the value X.509 certificate authority certificates in IoT device manufacturing, and authentication.
4-
author: eustacea
5-
manager: arjmands
62
title: Authenticate with X.509 certificates
73
titleSuffix: Azure IoT Hub
84
description: Understand how Azure IoT Hub uses X.509 certificates to authenticate IoT hubs and devices.
@@ -11,13 +7,10 @@ ms.service: iot-hub
117
services: iot-hub
128
ms.author: kgremban
139
ms.topic: conceptual
14-
ms.date: 08/26/2022
15-
ms.author: eustacea
1610
ms.date: 05/01/2023
1711
ms.custom: ['Role: Cloud Development', 'Role: IoT Device', 'Role: System Architecture']
1812
---
1913

20-
# Understand how X.509 CA certificates are used in IoT
2114
# Authenticate with X.509 certificates
2215

2316
Every IoT hub has an identity registry that stores information about the devices and modules permitted to connect to it. Before a device or module can connect, there must be an entry for that device or module in the IoT hub's identity registry. A device or module authenticates with the IoT hub based on credentials stored in the identity registry.
@@ -93,63 +86,118 @@ IoT Hub doesn't check certificate revocation lists from the certificate authorit
9386
This article describes the value of using X.509 certificate authority (CA) certificates in IoT device manufacturing and authentication.
9487

9588
An X.509 CA certificate is a digital certificate that can sign other certificates. A digital certificate is considered an X.509 certificate if it conforms to the certificate formatting standard prescribed by IETF's RFC 5280 standard. A certificate authority (CA) means that its holder can sign other certificates.
89+
9690
[!INCLUDE [iot-hub-include-x509-ca-signed-support-note](../../includes/iot-hub-include-x509-ca-signed-support-note.md)]
91+
9792
## Benefits of X.509 CA certificate authentication
93+
9894
X.509 certificate authority (CA) authentication is an approach for authenticating devices to IoT Hub using a method that dramatically simplifies device identity creation and life-cycle management in the supply chain.
95+
9996
A distinguishing attribute of X.509 CA authentication is the one-to-many relationship that a CA certificate has with its downstream devices. This relationship enables registration of any number of devices into IoT Hub by registering an X.509 CA certificate once. Otherwise, unique certificates would have to be pre-registered for every device before a device can connect. This one-to-many relationship also simplifies device certificates lifecycle management operations.
97+
10098
Another important attribute of X.509 CA authentication is simplification of supply chain logistics. Secure authentication of devices requires that each device holds a unique secret like a key as the basis for trust. In certificate-based authentication, this secret is a private key. A typical device manufacturing flow involves multiple steps and custodians. Securely managing device private keys across multiple custodians and maintaining trust is difficult and expensive. Using certificate authorities solves this problem by signing each custodian into a cryptographic chain of trust rather than entrusting them with device private keys. Each custodian signs devices at their respective step of the manufacturing flow. The overall result is an optimal supply chain with built-in accountability through use of the cryptographic chain of trust.
99+
101100
This process yields the most security when devices protect their unique private keys. To this end, we recommend using Hardware Secure Modules (HSM) capable of internally generating private keys.
101+
102102
The Azure IoT Hub Device Provisioning Service (DPS) makes it easy to provision groups of devices to hubs. For more information, see [Tutorial: Provision multiple X.509 devices using enrollment groups](../iot-dps/tutorial-custom-hsm-enrollment-group-x509.md).
103+
103104
## Example scenario
105+
104106
Company-X makes Smart-X-Widgets that are designed for professional installation. Company-X outsources both manufacturing and installation. Factory-Y manufactures the Smart-X-Widgets and Technician-Z installs them. Company-X wants the Smart-X-Widget shipped directly from Factory-Y to Technician-Z for installation and then for it to connect directly to Company-X's instance of IoT Hub. To make this happen, Company-X need to complete a few one-time setup operations to prime Smart-X-Widget for automatic connection. This article discusses the steps involved in that end-to-end scenario:
107+
105108
1. Acquire the X.509 CA certificate
109+
106110
2. Register the X.509 CA certificate to IoT Hub
111+
107112
3. Sign devices into a certificate chain of trust
113+
108114
4. Connect the devices
115+
109116
## Acquire the certificate
117+
110118
Company-X can either purchase an X.509 CA certificate from a public root certificate authority or create one through a self-signed process. Either option entails two basic steps: generating a public/private key pair and signing the public key into a certificate.
119+
111120
Details on how to accomplish these steps differ with various service providers.
121+
112122
:::image type="content" source="./media/iot-hub-x509ca-concept/csr-flow.png" alt-text="Diagram showing the flow for generating an X.509 CA certificate." lightbox="./media/iot-hub-x509ca-concept/csr-flow.png":::
123+
113124
### Purchasing a certificate
125+
114126
Purchasing a CA certificate has the benefit of having a well-known root CA act as a trusted third party to vouch for the legitimacy of IoT devices when the devices connect. Choose this option if your devices will interact with third-party products or services.
127+
115128
To purchase an X.509 CA certificate, choose a root certificate service provider. An internet search for the phrase 'Root CA' will yield good leads. The root CA provider will guide you on how to create the public/private key pair and how to generate a certificate signing request (CSR) for their services. A CSR is the formal process of applying for a certificate from a certificate authority. The outcome of this purchase is a certificate for use as an authority certificate. Given the ubiquity of X.509 certificates, the certificate is likely to have been properly formatted to IETF's RFC 5280 standard.
129+
116130
### Creating a self-signed certificate
131+
117132
The process to create a self-signed X.509 CA certificate is similar to purchasing one, except that it doesn't involve a third-party signer like the root certificate authority. In our example, Company-X would sign its authority certificate instead of a root certificate authority.
133+
118134
You might choose this option for testing until you're ready to purchase an authority certificate. You could also use a self-signed X.509 CA certificate in production if your devices won't connect to any third-party services outside of IoT Hub.
135+
119136
## Register the certificate to IoT Hub
137+
120138
Company-X needs to register the X.509 CA to IoT Hub where it will serve to authenticate Smart-X-Widgets as they connect. This one-time process enables the ability to authenticate and manage any number of Smart-X-Widget devices. This is a one-time process because of the one-to-many relationship between CA certificate and device certificates that are signed by the CA certificate or an intermediate certificate. This relationship is one of the main advantages of using the X.509 CA authentication method. The alternative would be to upload individual certificate thumbprints for each and every Smart-X-Widget device, thereby adding to operational costs.
139+
121140
Registering the X.509 CA certificate is a two-step process: upload the certificate then provide proof-of-possession.
141+
122142
:::image type="content" source="./media/iot-hub-x509ca-concept/pop-flow.png" alt-text="Diagram showing the process flow for registering an X.509 CA certificate." lightbox="./media/iot-hub-x509ca-concept/pop-flow.png":::
143+
123144
### Certificate upload
145+
124146
The X.509 CA certificate upload process is just that: uploading the CA certificate to IoT Hub. IoT Hub expects the certificate in a file.
147+
125148
The certificate file must not under any circumstances contain any private keys. Best practices from standards governing Public Key Infrastructure (PKI) mandates that knowledge of Company-X's private key resides exclusively within Company-X.
149+
126150
### Proof of possession
151+
127152
The X.509 CA certificate, just like any digital certificate, is public information that is susceptible to eavesdropping. As such, an eavesdropper may intercept a certificate and try to upload it as their own. In our example, IoT Hub has to make sure that the CA certificate Company-X uploaded really belongs to Company-X. It does so by challenging Company-X to prove that they possess the certificate through a [proof-of-possession (PoP) flow](https://tools.ietf.org/html/rfc5280#section-3.1).
153+
128154
For the proof-of-possession flow, IoT Hub generates a random number to be signed by Company-X using its private key. If Company-X followed PKI best practices and protected their private key, then only they would be able to correctly respond to the proof-of-possession challenge. IoT Hub proceeds to register the X.509 CA certificate upon a successful response of the proof-of-possession challenge.
155+
129156
A successful response to the proof-of-possession challenge from IoT Hub completes the X.509 CA registration.
157+
130158
## Sign devices into a certificate chain of trust
159+
131160
IoT requires a unique identity for every device that connects. For certificate-based authentication, these identities are in the form of certificates. In our example, certificate-based authentication means that every Smart-X-Widget must possess a unique device certificate.
161+
132162
One way to provide unique certificates on each device is to pre-generate certificates for Smart-X-Widgets and to trust supply chain partners with the corresponding private keys. For Company-X, this means entrusting both Factory-Y and Technician-Z. While this is a valid method, it comes with challenges that must be overcome to ensure trust, as follows:
163+
133164
* Having to share device private keys with supply chain partners, besides ignoring PKI best practices of never sharing private keys, makes building trust in the supply chain expensive. It requires systems like secure rooms to house device private keys and processes like periodic security audits. Both add cost to the supply chain.
165+
134166
* Securely accounting for devices in the supply chain, and later managing them in deployment, becomes a one-to-one task for every key-to-device pair from the point of device unique certificate (and private key) generation to device retirement. This precludes group management of devices unless the concept of groups is explicitly built into the process somehow. Secure accounting and device life-cycle management, therefore, becomes a heavy operations burden.
167+
135168
X.509 CA certificate authentication offers elegant solutions to these challenges by using certificate chains. A certificate chain results from a CA signing an intermediate CA that in turn signs another intermediate CA, and so on, until a final intermediate CA signs a device. In our example, Company-X signs Factory-Y, which in turn signs Technician-Z that finally signs Smart-X-Widget.
169+
136170
:::image type="content" source="./media/iot-hub-x509ca-concept/cert-chain-hierarchy.png" alt-text="Diagram showing an example of a certificate chain hierarchy." lightbox="./media/iot-hub-x509ca-concept/cert-chain-hierarchy.png":::
171+
137172
This cascade of certificates in the chain represents the logical hand-off of authority. Many supply chains follow this logical hand-off whereby each intermediate CA gets signed into the chain while receiving all upstream CA certificates, and the last intermediate CA finally signs each device and injects all the authority certificates from the chain into the device. This is common when the contracted manufacturing company with a hierarchy of factories commissions a particular factory to do the manufacturing. While the hierarchy may be several levels deep (for example, by geography/product type/manufacturing line), only the factory at the end gets to interact with the device but the chain is maintained from the top of the hierarchy.
173+
138174
Alternate chains may have different intermediate CAs interact with the device in which case the CA interacting with the device injects certificate chain content at that point. Hybrid models are also possible where only some of the CA has physical interaction with the device.
175+
139176
The following diagram shows how the certificate chain of trust comes together in our Smart-X-Widget example.
177+
140178
:::image type="content" source="./media/iot-hub-x509ca-concept/cert-mfr-chain.png" alt-text="Diagram showing the certificate chain of trust from the certificates of one company to the certificates of another company." lightbox="./media/iot-hub-x509ca-concept/cert-mfr-chain.png":::
179+
141180
1. Company-X never physically interacts with any of the Smart-X-Widgets. It initiates the certificate chain of trust by signing Factory-Y's intermediate CA certificate.
142181
1. Factory-Y now has its own intermediate CA certificate and a signature from Company-X. It passes copies of these items to the device. It also uses its intermediate CA certificate to sign Technician-Z's intermediate CA certificate and the Smart-X-Widget device certificate.
143182
1. Technician-Z now has its own intermediate CA certificate and a signature from Factory-Y. It passes copies of these items to the device. It also uses its intermediate CA certificate to sign the Smart-X-Widget device certificate.
144183
1. Every Smart-X-Widget device now has its own unique device certificate and copies of the public keys and signatures from each intermediate CA certificate that it interacted with throughout the supply chain. These certificates and signatures can be traced back to the original Company-X root.
184+
145185
The CA method of authentication infuses secure accountability into the device manufacturing supply chain. Because of the certificate chain process, the actions of every member in the chain are cryptographically recorded and verifiable.
186+
146187
This process relies on the assumption that the unique device public/private key pair is created independently and that the private key is protected within the device always. Fortunately, secure silicon chips exist in the form of Hardware Secure Modules (HSM) that are capable of internally generating keys and protecting private keys. Company-X only needs to add one such secure chip into Smart-X-Widget's component bill of materials.
188+
147189
## Device connection
190+
148191
Once the top level CA certificate is registered to IoT Hub and the devices have their unique certificates, how do they connect? By registering an X.509 CA certificate to IoT Hub one time, how do potentially millions of devices connect and get authenticated from the first time? Through the same certificate upload and proof-of-possession flow we earlier encountered with registering the X.509 CA certificate.
192+
149193
Devices manufactured for X.509 CA authentication are equipped with unique device certificates and a certificate chain from their respective manufacturing supply chain. Device connection, even for the first time, happens in a two-step process: certificate chain upload and proof-of-possession.
194+
150195
During the certificate chain upload, the device uploads its unique certificate and its certificate chain to IoT Hub. Using the pre-registered X.509 CA certificate, IoT Hub validates that the uploaded certificate chain is internally consistent and that the chain was originated by the valid owner of the X.509 CA certificate. As with the X.509 CA registration process, IoT Hub uses a proof-of-possession challenge-response process to ascertain that the chain, and therefore the device certificate, belongs to the device uploading it. A successful response triggers IoT Hub to accept the device as authentic and grant it connection.
196+
151197
In our example, each Smart-X-Widget would upload its device unique certificate together with Factory-Y and Technician-Z X.509 CA certificates and then respond to the proof-of-possession challenge from IoT Hub.
198+
152199
:::image type="content" source="./media/iot-hub-x509ca-concept/device-pop-flow.png" alt-text="Diagram showing the flow for validating a device certificate." lightbox="./media/iot-hub-x509ca-concept/device-pop-flow.png":::
200+
153201
The foundation of trust rests in protecting private keys, including device private keys. We therefore can't stress enough the importance of secure silicon chips in the form of Hardware Secure Modules (HSM) for protecting device private keys, and the overall best practice of never sharing any private keys, like one factory entrusting another with its private key.
154202

155203
## Next steps

0 commit comments

Comments
 (0)