Skip to content

Commit 1f79172

Browse files
committed
Add feedback
1 parent ffecf45 commit 1f79172

File tree

3 files changed

+72
-12
lines changed

3 files changed

+72
-12
lines changed

articles/iot-edge/how-to-connect-downstream-iot-edge-device.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,43 @@ To enable secure connections, every IoT Edge parent device in a gateway scenario
183183
# Give aziotcs ownership to certificates
184184
# Read and write for aziotcs, read-only for others
185185
sudo chown -R aziotcs:aziotcs /var/aziot/certs
186-
sudo chmod 644 /var/aziot/certs/*
186+
sudo find /var/aziot/certs -type f -name "*.*" -exec chmod 644 {} \;
187187
188188
# Give aziotks ownership to private keys
189189
# Read and write for aziotks, no permission for others
190190
sudo chown -R aziotks:aziotks /var/aziot/secrets
191-
sudo chmod 600 /var/aziot/secrets/*
191+
sudo find /var/aziot/secrets -type f -name "*.*" -exec chmod 600 {} \;
192+
193+
# Verify permissions of directories and files
194+
sudo ls -Rla /var/aziot
195+
```
196+
197+
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
192221
```
222+
193223

194224
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.
195225

@@ -381,8 +411,8 @@ To enable secure connections, every IoT Edge downstream device in a gateway scen
381411
sudo chmod 700 /var/aziot/secrets
382412

383413
# Copy device full-chain certificate and private key into the correct directory
384-
sudo cp iot-edge-device-ca-downstream-full-chain.cert.pem /var/aziot/certs
385-
sudo cp iot-edge-device-ca-downstream.key.pem /var/aziot/secrets
414+
sudo cp iot-device-downstream-full-chain.cert.pem /var/aziot/certs
415+
sudo cp iot-device-downstream.key.pem /var/aziot/secrets
386416

387417
### Root certificate ###
388418

@@ -476,8 +506,8 @@ You should already have IoT Edge installed on your device. If not, follow the st
476506
477507
```toml
478508
[edge_ca]
479-
cert = "file:///var/aziot/certs/iot-edge-device-ca-downstream-full-chain.cert.pem"
480-
pk = "file:///var/aziot/secrets/iot-edge-device-ca-downstream.key.pem"
509+
cert = "file:///var/aziot/certs/iot-device-downstream-full-chain.cert.pem"
510+
pk = "file:///var/aziot/secrets/iot-device-downstream.key.pem"
481511
```
482512
483513
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:
@@ -494,8 +524,8 @@ You should already have IoT Edge installed on your device. If not, follow the st
494524
trust_bundle_cert = "file:///var/aziot/certs/azure-iot-test-only.root.ca.cert.pem"
495525
496526
[edge_ca]
497-
cert = "file:///var/aziot/certs/iot-edge-device-ca-downstream-full-chain.cert.pem"
498-
pk = "file:///var/aziot/secrets/iot-edge-device-ca-downstream.key.pem"
527+
cert = "file:///var/aziot/certs/iot-device-downstream-full-chain.cert.pem"
528+
pk = "file:///var/aziot/secrets/iot-device-downstream.key.pem"
499529
```
500530
501531
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*.

articles/iot-edge/how-to-manage-device-certificates.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,42 @@ sudo chmod 700 /var/aziot/secrets
9090
# Give aziotcs ownership to certificates
9191
# Read and write for aziotcs, read-only for others
9292
sudo chown -R aziotcs:aziotcs /var/aziot/certs
93-
sudo chmod 644 /var/aziot/certs/*
93+
sudo chmod -R 644 /var/aziot/certs
94+
sudo find /var/aziot/certs -type f -name "*.*" -exec chmod 644 {} \;
9495

9596
# Give aziotks ownership to private keys
9697
# Read and write for aziotks, no permission for others
9798
sudo chown -R aziotks:aziotks /var/aziot/secrets
98-
sudo chmod 600 /var/aziot/secrets/*
99+
sudo find /var/aziot/secrets -type f -name "*.*" -exec chmod 600 {} \;
100+
101+
# Verify permissions of directories and files
102+
sudo ls -Rla /var/aziot
103+
```
104+
105+
The output of list with correct ownership and permission is similar to the following:
106+
107+
```Output
108+
azureUser@vm-h2hnm5j5uxk2a:/var/aziot$ sudo ls -Rla /var/aziot
109+
/var/aziot:
110+
total 16
111+
drwxr-xr-x 4 root root 4096 Dec 14 00:16 .
112+
drwxr-xr-x 15 root root 4096 Dec 14 00:15 ..
113+
drw-r--r-- 2 aziotcs aziotcs 4096 Jan 14 00:31 certs
114+
drwx------ 2 aziotks aziotks 4096 Jan 14 00:35 secrets
115+
116+
/var/aziot/certs:
117+
total 20
118+
drw-r--r-- 2 aziotcs aziotcs 4096 Jan 14 00:31 .
119+
drwxr-xr-x 4 root root 4096 Dec 14 00:16 ..
120+
-rw-r--r-- 1 aziotcs aziotcs 1984 Jan 14 00:24 azure-iot-test-only.root.ca.cert.pem
121+
-rw-r--r-- 1 aziotcs aziotcs 5887 Jan 14 00:27 iot-device-devicename-full-chain.cert.pem
122+
123+
/var/aziot/secrets:
124+
total 20
125+
drwx------ 2 aziotks aziotks 4096 Jan 14 00:35 .
126+
drwxr-xr-x 4 root root 4096 Dec 14 00:16 ..
127+
-rw------- 1 aziotks aziotks 3326 Jan 14 00:29 azure-iot-test-only.root.ca.key.pem
128+
-rw------- 1 aziotks aziotks 3243 Jan 14 00:28 iot-device-devicename.key.pem
99129
```
100130

101131
## Manage trusted root CA (trust bundle)

articles/iot-edge/tutorial-configure-est-server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ Each device requires the Certificate Authority (CA) certificate that is associat
148148
openssl s_client -showcerts -verify 5 -connect localhost:8085 < /dev/null | sudo awk '/BEGIN/,/END/{ if(/BEGIN/){a++}; out="cert"a".pem"; print >out}' && sudo cp cert2.pem cacert.crt.pem
149149
```
150150

151-
1. Certificates should be owned by the key service user **aziotcs**. Set the ownership to **aziotcs** for all the certificate files and set permissions.
151+
1. Certificates should be owned by the key service user **aziotcs**. Set the ownership to **aziotcs** for all the certificate files and set permissions. For more information about certificate ownership and permissions, see [Permission requirements](how-to-manage-device-certificates.md#permission-requirements).
152152

153153
```bash
154154
# Give aziotcs ownership to certificates
155155
sudo chown -R aziotcs:aziotcs /var/aziot/certs
156156
# Read and write for aziotcs, read-only for others
157-
sudo chmod 644 /var/aziot/certs/*
157+
sudo find /var/aziot/certs -type f -name "*.*" -exec chmod 644 {} \;
158158
```
159159

160160
## Provision IoT Edge device using DPS

0 commit comments

Comments
 (0)