arlotito / iot-edge-1.2-tpm

How to to provision an IoT Edge 1.2 via DPS, using identity certs issued by a CA via EST and keys stored in an HSM (TPM/PKCS11)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

This guide explains how to provision an IoT Edge 1.2 via DPS, using an Identity Certificate dynamically issued by a CA via EST, with all the keys securely stored in an HSM implemented with a TPM and PKCS11.

All the required components (including a simulated TPM if needed) are installed running few scripts included in this repo.

Disclaimer

Samples in this repo are for demonstration purposes only! This is not a guidance or best practices on IoT Edge security.

Get started

Install git if you haven't it:

sudo apt-get install git -y

Grab the scripts from this repo:

cd ~
git clone https://github.com/arlotito/iot-edge-1.2-tpm.git
cd iot-edge-1.2-tpm/scripts
chmod +x *.sh

Once you have the scripts:

  1. install using either a one-click or step-by-step approach:
  2. troubleshoot if needed
  3. experiment

I deployed/performed all the steps, now what?

If everything went fine, you should now have an IoT Edge provisioned via DPS, using an Identity Certificate dynamically issued by a CA via EST, with private keys securely stored in the TPM/PKCS11.

If you want, you can now inspect the content of the PKCS11 store and see the private keys generated by IoT Edge:

export TPM2_PKCS11_STORE='/opt/tpm2-pkcs11'
export PKCS11_LIB_PATH='/usr/local/lib/libtpm2_pkcs11.so'
sudo pkcs11-tool --module "$PKCS11_LIB_PATH" -IOT

NOTE: the 'pkcs11-tool' is installed by script 3-install-pkcs11-tool.sh

...and make sure you have 'device-id' and 'aziot-edged-ca': picture 1

If you don't see any key or just the 'device-id', try with:

sudo iotedge system reprovision

Look at this for additional troubleshooting.

Tested configurations

This guide has been tested on:

References

About

How to to provision an IoT Edge 1.2 via DPS, using identity certs issued by a CA via EST and keys stored in an HSM (TPM/PKCS11)


Languages

Language:Shell 100.0%