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
Copy file name to clipboardExpand all lines: articles/iot-edge/how-to-manage-device-certificates.md
+46-13Lines changed: 46 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,39 +209,55 @@ If you are using IoT Edge for Linux on Windows, you need to use the SSH key loca
209
209
sudo iotedge config apply
210
210
```
211
211
212
+
## Automatic certificate renewal
213
+
214
+
IoT Edge has built-in ability to renew certificates before expiry.
215
+
216
+
Certificates can only auto-renew if you have a certificate issuance method set, like EST. It must be configured per type of certificate. To configure, go to the relevant certificate configuration section in `config.toml` and add:
217
+
218
+
```toml
219
+
# To use auto renew with other types of certs, swap `edge_ca` with other certificate types
220
+
# And put into the relevant section
221
+
[edge_ca.auto_renew]
222
+
rotate_key = true
223
+
threshold = "80%"
224
+
retry = "4%"
225
+
```
226
+
227
+
Here:
228
+
-`rotate_key` controls if the private key should be rotated.
229
+
-`threshold` sets when IoT Edge should start renewing the certificate . It can be specified as:
230
+
-*Percentage* - integer between `0` and `100` followed by `%`. Renewal starts relative to the certificate lifetime. For example, when set to `80%`, a certificate that is valid for 100 days begins renewal at 20 days before its expiry.
231
+
-*Absolute time* - integer followed by `m` (minutes) or `d` (days). Renewal starts relative to the certificate expiration time. For example, when set to `4d` for 4 days or `10m` for 10 minutes, the certificate begins renewing at that time before expiry. To avoid unintentional misconfiguration where the `threshold` is bigger than the certificate lifetime, we recommend to use *percentage* instead whenever possible.
232
+
-`retry` controls how often renewal should be retried on failure. Like `threshold`, it can similarly be specified as a *percentage* or *absolute time* using the same format.
233
+
212
234
:::moniker-end
213
235
<!-- end iotedge-2020-11 -->
214
236
215
237
## Customize certificate lifetime
216
238
217
239
IoT Edge automatically generates certificates on the device in several cases, including:
218
240
219
-
<!-- 1.2 -->
220
-
:::moniker range=">=iotedge-2020-11"
221
-
If you don't provide your own production certificates when you install and provision IoT Edge, the IoT Edge security manager automatically generates an **edge CA certificate**. This self-signed certificate is only meant for development and testing scenarios, not production. This certificate expires after 90 days.
222
-
:::moniker-end
223
-
<!-- end 1.2 -->
224
-
225
241
<!-- 1.1. -->
226
242
:::moniker range="iotedge-2018-06"
227
243
* If you don't provide your own production certificates when you install and provision IoT Edge, the IoT Edge security manager automatically generates a **device CA certificate**. This self-signed certificate is only meant for development and testing scenarios, not production. This certificate expires after 90 days.
228
244
* The IoT Edge security manager also generates a **workload CA certificate** signed by the device CA certificate
229
245
:::moniker-end
230
246
<!-- end 1.1 -->
231
247
248
+
<!-- 1.2 -->
249
+
:::moniker range=">=iotedge-2020-11"
250
+
If you don't provide your own production certificates when you install and provision IoT Edge, the IoT Edge security manager automatically generates an **edge CA certificate**. This self-signed certificate is only meant for development and testing scenarios, not production. This certificate expires after 90 days.
251
+
:::moniker-end
252
+
<!-- end 1.2 -->
253
+
232
254
For more information about the function of the different certificates on an IoT Edge device, see [Understand how Azure IoT Edge uses certificates](iot-edge-certs.md).
233
255
234
-
For these two automatically generated certificates, you have the option of setting a flag in the config file to configure the number of days for the lifetime of the certificates.
256
+
You have the option of setting a flag in the config file to configure the number of days for the lifetime of the certificates.
235
257
236
258
>[!NOTE]
237
259
>There is a third auto-generated certificate that the IoT Edge security manager creates, the **IoT Edge hub server certificate**. This certificate always has a 30 day lifetime, but is automatically renewed before expiring. The auto-generated CA lifetime value set in the config file doesn't affect this certificate.
238
260
239
-
<!-- 1.2 -->
240
-
:::moniker range=">=iotedge-2020-11"
241
-
Upon expiry after the specified number of days, IoT Edge has to be restarted to regenerate the edge CA certificate. The edge CA certificate won't be renewed automatically.
242
-
:::moniker-end
243
-
<!-- end 1.2 -->
244
-
245
261
<!-- 1.1. -->
246
262
:::moniker range="iotedge-2018-06"
247
263
Upon expiry after the specified number of days, IoT Edge has to be restarted to regenerate the device CA certificate. The device CA certificate won't be renewed automatically.
@@ -347,6 +363,23 @@ Upon expiry after the specified number of days, IoT Edge has to be restarted to
347
363
:::moniker-end
348
364
<!-- end iotedge-2020-11 -->
349
365
366
+
<!-- 1.2 -->
367
+
:::moniker range=">=iotedge-2020-11"
368
+
### Renew Edge CA
369
+
370
+
By default, IoT Edge automatically regenerates the Edge CA certificate when at 80% of the certificate lifetime. So for certificate with 90 day lifetime, IoT Edge automatically regenerates the Edge CA certificate at 72 days from issuance.
371
+
372
+
To configure the auto-renewal logic, add this part to the "Edge CA certificate" section in `config.toml`.
373
+
374
+
```toml
375
+
[edge_ca.auto_renew]
376
+
rotate_key = true
377
+
threshold = "70%"
378
+
retry = "2%"
379
+
```
380
+
:::moniker-end
381
+
<!-- end 1.2 -->
382
+
350
383
## Next steps
351
384
352
385
Installing certificates on an IoT Edge device is a necessary step before deploying your solution in production. Learn more about how to [Prepare to deploy your IoT Edge solution in production](production-checklist.md).
0 commit comments