New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Reply To: Keeping the device secret on an SD card: bad idea or acceptable?

Did a review of a similar design for a contractor last year, so here’s the reasoning for the report.

Separate public stuff from secret stuff. The CA bundle is public; the server certificate is a public one and you verify it with a normal CA bundle, so keeping that on the card is fine. WiFi password and the device token are secrets, they identify this exact device.

Secrets on removable media fail on two counts: removing them leaves no trace, and the card usually gets copied into other boards (“just clone the card”), and then you have several devices sharing one credential. Hermetry allows one session per device, so two boards with the same token keep kicking each other off, and you’d see takeover in the device’s Log tab.

On X.509: for your own boards it’s not available. Client certificates must come from Hermetry’s device certificate authority, and uploading your own CA for third-party devices is not offered; that path is for licensed devices that generate their key and send a CSR themselves. Your ESP32 uses an access token or MQTT basic.

What I’d do on an ESP32:
1. Same binary for every board is fine. Put the token in NVS at provisioning (a small serial command on first boot), not on the card.
2. Turn on flash encryption and NVS encryption, so a flash dump does not give up the token.
3. Card only for data logging and the CA bundle.
4. In Hermetry, one device and one token per board; rotate the secret if a board goes missing. That ends its sessions at once.

The certificate limitation is on Device certificates, last section.

Accepted solution♥ 6