Security best practices for IoT solutions
This overview introduces the key concepts around securing a typical Azure IoT solution. Each section includes links to content that provides further detail and guidance.
The following diagram shows a high-level view of the components in a typical edge-based IoT solution. This article focuses on the security of an edge-based IoT solution:
You can divide security in an edge-based IoT solution into the following three areas:
Asset security: Secure the physical or virtual item of value that you want to manage, monitor, and collect data from.
Connection security: Ensure all data in transit between the asset, edge, and cloud services is confidential and tamper-proof.
Edge security: Secure your data while it moves through, and is stored in the edge.
Cloud security: Secure your data while it moves through, and is stored in the cloud.
Typically on an edge-based solution, you want to secure your end-to-end operations by using Azure security capabilities. Azure IoT Operations has built-in security capabilities such as secrets management, certificate management, and secure settings on an Azure Arc-enabled Kubernetes cluster. When a Kubernetes cluster is connected to Azure, an outbound connection to Azure is initiated, using industry-standard SSL to secure data in transit, and several other security features are enabled, such as:
- View and monitor your clusters using Azure Monitor for containers.
- Enforce threat protection using Microsoft Defender for Containers.
- Ensure governance through applying policies with Azure Policy for Kubernetes.
- Grant access and connect to your Kubernetes clusters from anywhere, and manage access by using Azure role-based access control (Azure RBAC) on your cluster.
Microsoft Defender for IoT and for Containers
Microsoft Defender for IoT is a unified security solution built specifically to identify IoT and operational technology (OT) devices, vulnerabilities, and threats. Microsoft Defender for Containers is a cloud-native solution to improve, monitor, and maintain the security of your containerized assets (Kubernetes clusters, Kubernetes nodes, Kubernetes workloads, container registries, container images and more), and their applications, across multicloud and on-premises environments.
Both Defender for IoT and Defender for Containers can automatically monitor some of the recommendations included in this article. Defender for IoT and Defender for Containers should be the frontline of defense to protect your edge-based solution. To learn more, see:
- Microsoft Defender for Containers - overview
- Microsoft Defender for IoT for organizations - overview.
Asset security
Secrets management: Use Azure Key Vault to store and manage asset's sensitive information such as keys, passwords, certificates, and secrets. Azure IoT Operations uses Azure Key Vault as the managed vault solution on the cloud, and uses Azure Key Vault Secret Store extension for Kubernetes to sync the secrets down from the cloud and store them on the edge as Kubernetes secrets. To learn more, see Manage secrets for your Azure IoT Operations deployment.
Certificate management: Managing certificates is crucial for ensuring secure communication between assets and your edge runtime environment. Azure IoT Operations provides tools for managing certificates, including issuing, renewing, and revoking certificates. To learn more, see Certificate management for Azure IoT Operations internal communication.
Select tamper-proof hardware for assets: Choose asset hardware with built-in mechanisms to detect physical tampering, such as the opening of the device cover or the removal of a part of the device. These tamper signals can be part of the data stream uploaded to the cloud, alerting operators to these events.
Enable secure updates for asset firmware: Use services that enable over-the-air updates for your assets. Build assets with secure paths for updates and cryptographic assurance of firmware versions to secure your assets during and after updates.
Deploy asset hardware securely: Ensure that asset hardware deployment is as tamper-proof as possible, especially in unsecure locations such as public spaces or unsupervised locales. Only enable necessary features to minimize the physical attack footprint, such as securely covering USB ports if they aren't needed.
Follow device manufacturer security and deployment best practices: If the device manufacturer provides security and deployment guidance, follow that guidance in addition to the generic guidance listed in this article.
Connection security
Use Transport Layer Security (TLS) to secure connections from assets: All communication within Azure IoT Operations is encrypted using TLS. To provide a secure-by-default experience that minimizes inadvertent exposure of your edge-based solution to attackers, Azure IoT Operations is deployed with a default root CA and issuer for TLS server certificates. For a production deployment, we recommend using your own CA issuer and an enterprise PKI solution.
Consider using enterprise firewalls or proxies to manage outbound traffic: If you use enterprise firewalls or proxies, add the Azure IoT Operations endpoints to your allowlist.
Encrypt internal traffic of message broker: Ensuring the security of internal communications within your edge infrastructure is important to maintain data integrity and confidentiality. You should configure the MQTT broker to encrypt internal traffic and data in transit between the MQTT broker frontend and backend pods. To learn more, see Configure encryption of broker internal traffic and internal certificates.
Configure TLS with automatic certificate management for listeners in your MQTT broker: Azure IoT Operations provides automatic certificate management for listeners in your MQTT broker. This reduces the administrative overhead of manually managing certificates, ensures timely renewals, and helps maintain compliance with security policies. To learn more, see Secure MQTT broker communication by using BrokerListener.
Set up a secure connection to OPC UA server: When connecting to an OPC UA server, you should determine which OPC UA servers you trust to securely establish a session with. To learn more, see Configure OPC UA certificates infrastructure for the connector for OPC UA.
Edge security
Keep the edge runtime environment up-to-date: Keep your cluster and Azure IoT Operations deployment up-to-date with the latest patches and minor releases to get all available security and bug fixes. For production deployments, turn off auto-upgrade for Azure Arc to have complete control over when new updates are applied to your cluster. Instead, manually upgrade agents as needed.
Verify the integrity of docker and helm images: Before deploying any image to your cluster, verify that the image is signed by Microsoft. To learn more, see Validate image signing.
Always use X.509 certificates or Kubernetes service account tokens for authentication with your MQTT broker: An MQTT broker supports multiple authentication methods for clients. You can configure each listener port to have its own authentication settings with a BrokerAuthentication resource. To learn more, see Configure MQTT broker authentication.
Provide the least privilege needed for the topic asset in your MQTT broker: Authorization policies determine what actions the clients can perform on the broker, such as connecting, publishing, or subscribing to topics. Configure the MQTT broker to use one or multiple authorization policies with the BrokerAuthorization resource. To learn more, see Configure MQTT broker authorization.
Configure isolated network environments by using Azure IoT Layered Network Management (preview): Azure IoT Layered Network Management (preview) is a component that facilitates the connection between Azure and clusters in isolated network environments. In industrial scenarios, the isolated networks follow the ISA-95/Purdue Network architecture. To learn more, see What is Azure IoT Layered Network Management (preview)?.
Cloud security
Use user-assigned managed identities for cloud connections: Always use managed identity authentication. When possible, use user-assigned managed identity in data flow endpoints for flexibility and auditability.
Deploy observability resources and set up logs: Observability provides visibility into every layer of your Azure IoT Operations configuration. It gives you insight into the actual behavior of issues, which increases the effectiveness of site reliability engineering. Azure IoT Operations offers observability through custom curated Grafana dashboards that are hosted in Azure. These dashboards are powered by Azure Monitor managed service for Prometheus and by Container Insights. Deploy observability resources on your cluster before deploying Azure IoT Operations.
Secure access to assets and asset endpoints with Azure RBAC: Assets and asset endpoints in Azure IoT Operations have representations in both the Kubernetes cluster and the Azure portal. You can use Azure RBAC to secure access to these resources. Azure RBAC is an authorization system that enables you to manage access to Azure resources. You can use Azure RBAC to grant permissions to users, groups, and applications at a certain scope. To learn more, see Secure access to assets and asset endpoints.
Next steps
To learn more about IoT security, see: