You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4,7 +4,7 @@ description: Step by step adaptable manual instructions on how to create a hiera
4
4
author: PatAltimore
5
5
6
6
ms.author: patricka
7
-
ms.date: 10/5/2022
7
+
ms.date: 01/17/2023
8
8
ms.topic: conceptual
9
9
ms.service: iot-edge
10
10
services: iot-edge
@@ -140,26 +140,99 @@ To configure your parent device, open a local or remote command shell.
140
140
141
141
To enable secure connections, every IoT Edge parent device in a gateway scenario needs to be configured with a unique device CA certificate and a copy of the root CA certificate shared by all devices in the gateway hierarchy.
142
142
143
-
01.Transfer the **root CA certificate**, **parent device CA certificate**, and **parent private key** to the parent device. The examples in this article use the preferred directory `/var/aziot` for the certificates and keys.
143
+
01.Check your certificates meet the [format requirements](how-to-manage-device-certificates.md#format-requirements).
144
144
145
-
01.Install the **root CA certificate** on the parent IoT Edge device. First, copy the root certificate into the certificate directory and add `.crt`to the end of the file name. Next, update the certificate store on the device using the platform-specific command.
145
+
01.Transfer the **root CA certificate**, **parent device CA certificate**, and **parent private key**to the parent device.
146
146
147
-
**Debian or Ubuntu:**
147
+
01. Copy the certificates and keys to the correct directories. The preferred directories for device certificates are `/var/aziot/certs` for the certificates and `/var/aziot/secrets` for keys.
The output of list with correct ownership and permission is similar to the following:
198
+
199
+
```Output
200
+
azureUser@vm-h2hnm5j5uxk2a:/var/aziot$ sudo ls -Rla /var/aziot
201
+
/var/aziot:
202
+
total 16
203
+
drwxr-xr-x 4 root root 4096 Dec 14 00:16 .
204
+
drwxr-xr-x 15 root root 4096 Dec 14 00:15 ..
205
+
drw-r--r-- 2 aziotcs aziotcs 4096 Jan 14 00:31 certs
206
+
drwx------ 2 aziotks aziotks 4096 Jan 14 00:35 secrets
207
+
208
+
/var/aziot/certs:
209
+
total 20
210
+
drw-r--r-- 2 aziotcs aziotcs 4096 Jan 14 00:31 .
211
+
drwxr-xr-x 4 root root 4096 Dec 14 00:16 ..
212
+
-rw-r--r-- 1 aziotcs aziotcs 1984 Jan 14 00:24 azure-iot-test-only.root.ca.cert.pem
213
+
-rw-r--r-- 1 aziotcs aziotcs 5887 Jan 14 00:27 iot-edge-device-ca-gateway-full-chain.cert.pem
214
+
215
+
/var/aziot/secrets:
216
+
total 20
217
+
drwx------ 2 aziotks aziotks 4096 Jan 14 00:35 .
218
+
drwxr-xr-x 4 root root 4096 Dec 14 00:16 ..
219
+
-rw------- 1 aziotks aziotks 3326 Jan 14 00:29 azure-iot-test-only.root.ca.key.pem
220
+
-rw------- 1 aziotks aziotks 3243 Jan 14 00:28 iot-edge-device-ca-gateway.key.pem
221
+
```
222
+
223
+
224
+
01. Install the **root CA certificate** on the parent IoT Edge device by updating the certificate store on the device using the platform-specific command.
225
+
226
+
```bash
227
+
# Update the certificate store
228
+
229
+
# For Ubuntu and Debian, use update-ca-certificates command
230
+
sudo update-ca-certificates
231
+
# For EFLOW, use update-ca-trust
160
232
sudo update-ca-trust
161
233
```
162
-
For more information about using `update-ca-trust`, see [CBL-Mariner SSL CA certificates management](https://github.com/microsoft/CBL-Mariner/blob/1.0/toolkit/docs/security/ca-certificates.md).
234
+
235
+
For more information about using `update-ca-trust`in EFLOW, see [CBL-Mariner SSL CA certificates management](https://github.com/microsoft/CBL-Mariner/blob/1.0/toolkit/docs/security/ca-certificates.md).
163
236
164
237
The command reports one certificate was added to `/etc/ssl/certs`.
165
238
@@ -319,26 +392,69 @@ To configure your downstream device, open a local or remote command shell.
319
392
320
393
To enable secure connections, every IoT Edge downstream device in a gateway scenario needs to be configured with a unique device CA certificate and a copy of the root CA certificate shared by all devices in the gateway hierarchy.
321
394
322
-
01. Transfer the **root CA certificate**, **child device CA certificate**, and **child private key** to the downstream device. The examples in this article use the directory `/var/aziot` for the certificates and keys directory.
395
+
01. Check your certificates meet the [format requirements](how-to-manage-device-certificates.md#format-requirements).
323
396
324
-
01. Install the **root CA certificate** on the downstream IoT Edge device. First, copy the root certificate into the certificate directory and add `.crt` to the end of the file name. Next, update the certificate store on the device using the platform-specific command.
397
+
01. Transfer the **root CA certificate**, **child device CA certificate**, and **child private key** to the downstream device.
325
398
326
-
**Debian or Ubuntu:**
399
+
01. Copy the certificates and keys to the correct directories. The preferred directories for device certificates are `/var/aziot/certs` for the certificates and `/var/aziot/secrets` for keys.
01. Install the **root CA certificate** on the downstream IoT Edge device by updating the certificate store on the device using the platform-specific command.
447
+
448
+
```bash
449
+
# Update the certificate store
450
+
451
+
# For Ubuntu and Debian, use update-ca-certificates command
452
+
sudo update-ca-certificates
453
+
# For EFLOW, use update-ca-trust
339
454
sudo update-ca-trust
340
455
```
341
-
For more information about using `update-ca-trust`, see [CBL-Mariner SSL CA certificates management](https://github.com/microsoft/CBL-Mariner/blob/1.0/toolkit/docs/security/ca-certificates.md).
456
+
457
+
For more information about using `update-ca-trust`in EFLOW, see [CBL-Mariner SSL CA certificates management](https://github.com/microsoft/CBL-Mariner/blob/1.0/toolkit/docs/security/ca-certificates.md).
342
458
343
459
The command reports one certificate was added to `/etc/ssl/certs`.
344
460
@@ -390,8 +506,8 @@ You should already have IoT Edge installed on your device. If not, follow the st
01. Verify your IoT Edge device uses the correct version of the IoT Edge agent when it starts. Find the **Default Edge Agent** section and set the image value for IoT Edge to version 1.4. For example:
@@ -408,8 +524,8 @@ You should already have IoT Edge installed on your device. If not, follow the st
01. Save and close the `config.toml` configuration file. For example if you're using the **nano** editor, select **Ctrl+O** - *Write Out*, **Enter**, and **Ctrl+X** - *Exit*.
@@ -455,7 +571,6 @@ You should already have IoT Edge installed on your device. If not, follow the st
@@ -475,7 +590,7 @@ You should already have IoT Edge installed on your device. If not, follow the st
475
590
If the command times out, there may be blocked ports between the child and parent devices. Review the network configuration and settings for the devices.
476
591
477
592
> [!WARNING]
478
-
> A previous version of this document directed users to copy the `iot-edge-device-ca-gateway.cert.pem` certificate for use in the gateway `[edge_ca]` section. This was incorrect, and results in certificate validation errors from the downstream device. For example, the `openssl s_client ...` command above will produce:
593
+
> Not using a full-chain certificate in the gateway's`[edge_ca]` section results in certificate validation errors from the downstream device. For example, the `openssl s_client ...` command above will produce:
479
594
>
480
595
> ```
481
596
> Can't use SSL_get_servername
@@ -487,7 +602,7 @@ You should already have IoT Edge installed on your device. If not, follow the st
487
602
> DONE
488
603
> ```
489
604
>
490
-
> The same issue will appear for TLS-enabled devices connecting to the downstream Edge device if`iot-edge-device-ca-downstream.cert.pem` is copied to the device instead of `iot-edge-device-ca-downstream-full-chain.cert.pem`.
605
+
> The same issue occurs for TLS-enabled devices that connect to the downstream IoT Edge device if the full-chain device certificate isn't used and configured on the downstream device.
title: Create transparent gateway device using Azure IoT Edge
3
3
description: Use an Azure IoT Edge device as a transparent gateway that can process information from downstream devices
4
4
author: PatAltimore
5
5
6
6
ms.author: patricka
7
-
ms.date: 11/1/2022
7
+
ms.date: 01/17/2022
8
8
ms.topic: conceptual
9
9
ms.service: iot-edge
10
10
services: iot-edge
@@ -114,20 +114,41 @@ If you don't have your own certificate authority and want to use demo certificat
114
114
115
115
# [IoT Edge](#tab/iotedge)
116
116
117
+
1. Check the certificate meets [format requirements](how-to-manage-device-certificates.md#format-requirements).
117
118
1. If you created the certificates on a different machine, copy them over to your IoT Edge device. You can use a USB drive, a service like [Azure Key Vault](../key-vault/general/overview.md), or with a function like [Secure file copy](https://www.ssh.com/ssh/scp/).
118
119
1. Move the files to the preferred directory for certificates and keys. Use `/var/aziot/certs` for certificates and `/var/aziot/secrets` for keys.
119
-
1.Change the ownership and permissions of the certificates and keys.
120
+
1.Create the certificates and keys directories and set permissions. You should store your certificates and keys to the preferred `/var/aziot` directory. Use `/var/aziot/certs` for certificates and`/var/aziot/secrets` for keys.
120
121
121
122
```bash
123
+
# If the certificate and keys directories don't exist, create, set ownership, and set permissions
124
+
sudo mkdir -p /var/aziot/certs
122
125
sudo chown aziotcs:aziotcs /var/aziot/certs
123
-
sudo chown -R iotedge /var/aziot/certs
124
-
sudo chmod 644 /var/aziot/secrets/
126
+
sudo chmod 755 /var/aziot/certs
127
+
128
+
sudo mkdir -p /var/aziot/secrets
129
+
sudo chown aziotks:aziotks /var/aziot/secrets
130
+
sudo chmod 700 /var/aziot/secrets
131
+
```
132
+
1. Change the ownership and permissions of the certificates and keys.
133
+
134
+
```bash
135
+
# Give aziotcs ownership to certificates
136
+
# Read and write for aziotcs, read-only for others
Now, you need to copy the certificates to the Azure IoT Edge for Linux on Windows virtual machine.
130
149
150
+
1. Check the certificate meets [format requirements](how-to-manage-device-certificates.md#format-requirements).
151
+
131
152
1. Copy the certificates to the EFLOW virtual machine to a directory where you have write access. For example, the `/home/iotedge-user` home directory.
132
153
133
154
```powershell
@@ -146,27 +167,42 @@ Now, you need to copy the certificates to the Azure IoT Edge for Linux on Window
146
167
Connect-EflowVm
147
168
```
148
169
149
-
1. Create the certificates directory. You should store your certificates and keys to the preferred `/var/aziot` directory. Use `/var/aziot/certs` for certificates and `/var/aziot/secrets` for keys.
170
+
1. Create the certificates and keys directories and set permissions. You should store your certificates and keys to the preferred `/var/aziot` directory. Use `/var/aziot/certs` for certificates and `/var/aziot/secrets` for keys.
150
171
151
172
```bash
173
+
# If the certificate and keys directories don't exist, create, set ownership, and set permissions
152
174
sudo mkdir -p /var/aziot/certs
175
+
sudo chown aziotcs:aziotcs /var/aziot/certs
176
+
sudo chmod 755 /var/aziot/certs
177
+
153
178
sudo mkdir -p /var/aziot/secrets
179
+
sudo chown aziotks:aziotks /var/aziot/secrets
180
+
sudo chmod 700 /var/aziot/secrets
154
181
```
155
182
156
183
1. Move the certificates and keys to the preferred `/var/aziot` directory.
157
184
158
185
```bash
159
186
# Move the IoT Edge device CA certificate and key to preferred location
@@ -239,7 +275,7 @@ Downstream devices send telemetry and messages to the gateway device, where the
239
275
240
276
* The IoT Edge hub module is deployed to the device.
241
277
242
-
When you first install IoT Edge on a device, only one system module starts automatically: the IoT Edge agent. Once you create the first deployment for a device, the second system module, the IoT Edge hub, starts as well. If the **edgeHub** module isn't running on your device, create a deployment for your device.
278
+
When you first install IoT Edge on a device, only one system module starts automatically: the IoT Edge agent. Once you create the first deployment for a device, the second system module and the IoT Edge hub start as well. If the **edgeHub** module isn't running on your device, create a deployment for your device.
243
279
244
280
* The IoT Edge hub module has routes set up to handle incoming messages from downstream devices.
0 commit comments