Skip to content

Commit 53cad2b

Browse files
committed
Updates to cert expiry config section
1 parent 51946a2 commit 53cad2b

File tree

1 file changed

+38
-25
lines changed

1 file changed

+38
-25
lines changed

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

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,52 +91,65 @@ For example, if you used the sample scripts to [Create demo certificates](how-to
9191

9292
* Linux: `/var/lib/iotedge/hsm/certs` and `/var/lib/iotedge/hsm/cert_keys`
9393

94-
## Design customization certificate lifetime
94+
## Customize certificate lifetime
9595

96-
If you are not providing your own production certificates, you will need to restart the IoT-Edge device to renew the temporary certificates before they expire at the end of 90 days. However, you have the option of setting the **auto_generated_ca_lifetime_days** flag in config.yaml to specify the number of days for the lifetime of the certificates.
96+
IoT Edge automatically generates certificates on the device in several cases, including:
9797

98-
Add the following line to the **certificate** properties in the config.yaml file with the desired number of days:
98+
* If you don't provide your own production certificates when you install and provision IoT Edge, the IoT Edge security manager auto-generates a **device CA certificate**. This auto-generated and self-signed certificate is only meant for development and testing scenarios, not production. This certificate expires after 90 days.
99+
* The IoT Edge security manager also generates a **workload CA certificate** signed by the device CA certificate
99100

100-
```yaml
101-
auto_generated_ca_lifetime_days: \<number of days>
102-
```
101+
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).
102+
103+
For these two auto-generated certificates, you have the option of setting the **auto_generated_ca_lifetime_days** flag in config.yaml to configure the number of days for the lifetime of the certificates.
104+
105+
To configure the certificate expiration to something other than the default 90 days, add the value in days to the **certificates** section of the config.yaml file.
103106

104-
This setting honors both temporary certificates and production certificates. If the **device_ca_cert** and **device_ca_pk** certificates are not specified in the config.yaml file, then the flag will be honored on temporary certificates. If they are specified, then this flag will override the expiration settings on the production certificates.
107+
```yaml
108+
certificates:
109+
device_ca_cert: "<ADD URI TO DEVICE CA CERTIFICATE HERE>"
110+
device_ca_pk: "<ADD URI TO DEVICE CA PRIVATE KEY HERE>"
111+
trusted_ca_certs: "<ADD URI TO TRUSTED CA CERTIFICATES HERE>"
112+
auto_generated_ca_lifetime_days: <value>
113+
```
114+
115+
If you provided your own device CA certificates, then this value still applies to the workload CA certificate, as long as the lifetime value you set is shorter than the lifetime of the device CA certificate.
105116

106117
After you specify the flag in the config.yaml file, do the following:
107118

108119
1. Delete the contents of the hsm folder.
109120

110-
Windows: C:\ProgramData\iotedge\hsm\certs and C:\ProgramData\iotedge\hsm\cert_keys
111-
Linux: /var/lib/iotedge/hsm/certs and /var/lib/iotedge/hsm/cert_keys
121+
Windows: `C:\ProgramData\iotedge\hsm\certs and C:\ProgramData\iotedge\hsm\cert_keys`
122+
Linux: `/var/lib/iotedge/hsm/certs and /var/lib/iotedge/hsm/cert_keys`
112123

113124
1. Restart the IoT Edge service.
114125

115-
Windows:
126+
Windows:
116127

117-
```azurecli
118-
Restart-Service iotedge
119-
```
128+
```powershell
129+
Restart-Service iotedge
130+
```
120131

121-
Linux:
132+
Linux:
122133

123-
```bash
124-
sudo systemctl restart iotedge
125-
```
134+
```bash
135+
sudo systemctl restart iotedge
136+
```
126137

127138
1. Confirm the lifetime setting.
128139

129-
Windows:
140+
Windows:
141+
142+
```powershell
143+
iotedge check --verbose
144+
```
130145

131-
```azurecli
132-
iotedge check --verbose
133-
```
146+
Linux:
134147

135-
Linux:
148+
```bash
149+
sudo iotedge check --verbose
150+
```
136151

137-
```bash
138-
sudo iotedge check --verbose
139-
```
152+
Check the output of the **production readiness: certificates** check, which lists the number of days until the auto-generated device CA certificates expire.
140153

141154
## Next steps
142155

0 commit comments

Comments
 (0)