Back
Azure IoT Device Security Best Practices

What are the Azure IoT Device Security Best Practices

What are the Azure IoT Device Security Best Practices

As IoT (Internet of Things) has skyrocketed in mainstream popularity, many businesses find it to be a must-have in order to successfully compete and grow; however, businesses are not the only ones taking note of IoT’s rise in prominence. Hackers have taken advantage of a lack of proper IoT security practices to conduct attacks ranging from small-scale ones directed at specific companies to large-scale ones such as the attack on DNS infrastructure by the Mirai Botnet or more recently, the DJI Vacuum Attack where an attacker was able to access the camera of all DJI vacuum devices remotely. But while these attacks are years apart, they all have one thing in common: weak IoT security practices that could have been mitigated with proper device authentication and management.

As the IoT realm matures, it is our responsibility to employ best practices to protect millions of global users from these bad actors and, in doing so, to address the many IoT device security concerns that have come forth. In this article, we will share a guide outlining these best practices to help you create a device provisioning system that is both secure and compliant.

The Challenge of Effective IoT Security

The biggest problem with creating new IoT devices is that you must create these devices at scale while also enabling the devices to authenticate securely within the cloud, making it incredibly difficult to design a secure identity bootstrapping story. This problem is further complicated because of the limitations inherent in IoT devices – unlike larger and more powerful computers, IoT devices are quite limited in computing power and storage size.

So, what are your options? Early on, most companies just put the same password on all devices and have them connect to the cloud with it, either way who would be able to see that password? Now we know that this approach doesn’t work because hackers are great at either intercepting traffic or just looking at the code in the device itself to extract the password. Therefore, a more secure method is required to ensure that each device can authenticate individually without exposing a shared secret. For that, certificates are the perfect solution where you can have a bootstrap certificate and then you can use it to request device-specific certificates from a trusted certificate authority (CA), ensuring each device has a unique identity for secure authentication; don’t take my word for it, this is what Microsoft recommends for IoT authentication.

How to Secure IoT Devices

Defining the problem is great, but what can we do about it? How can we safely secure IoT devices? Well, industry experts recommend using cryptographic certificates to control authentication between IoT devices and cloud services. If administered properly, certificate authentication enables organizations to have a secure authority that issues credentials to their IoT devices, allowing for credential rotation while also giving organizations the ability to revoke compromised credentials.

What Are Certificates? How do Certificates Work?

Before we can properly authenticate certificates, we first need to gain an understanding of how certificates work. Certificates are identities that are signed by a trusted authority (think of how your passport is issued by a government authority and people just trust that you are who you say you are because the government said so), this makes it that you don’t have to know every single device/certificate individually instead you can say any certificate issued by this Certificate Authority (CA) you trust it and use the serial number inside the certificate to know who the IoT device belongs to. Fun fact that is literally how mobile drivers licenses work.

How to Bootstrap a New IoT Device to Azure IoT Hub

The biggest obstacle with bootstrapping a new IoT device is that devices need a way to authenticate with the cloud without sharing a common credential between all IoT devices. As previously mentioned, the easiest way to fix this is by using certificates. We even created a code sample to automatically provision IoT devices in Azure IoT with a trusted CA; however, this code sample doesn’t cover how this should look in the factory. Here’s the steps on how to bootstrap the identity of a new IoT device:

How to Create an IoT SSL Certificate in the Factory

  • 1. The IoT device creates a private key and uses it to create a certificate signing request (CSR) with its unique device ID.
  • 2. The CSR is then transferred to the IoT programming service. It is important to note that since there is no authentication between the IoT device and the IoT Programming Service, this has to be done over a secure bus where it would be physically impossible for another device to impersonate an IoT device.
  • 3. The IoT Programming Service sends the request to the CA.
  • 4. The CA returns a signed certificate.
  • 5. The certificate is installed in the IoT device.
  • How to create IoT SSL Certificates with EZCA

    How to Register and Connect an IoT Device to Azure IoT Hub

    Note: Connecting to Azure does not need to happen in the factory – once the certificate is loaded, the IoT device can use that certificate to register itself in Azure once the IoT device is going to be used.

  • 1. The IoT device uses that certificate to authenticate with Azure Provisioning Service.
  • 2. Device Provisioning Service assigns an IoT Hub to this device.
  • 3. The IoT device starts communicating with the Azure IoT Hub.
  • Ultimately, IoT device vulnerabilities can be mitigated by having a proper design. For more information on how Keytos makes connecting to Azure IoT painless, check out our One Click Azure IoT Integration and schedule a demo today!