How to use Shared Access Policy to restrict access of IoT Edge to IoT Hub

Satyam Chauhan 607 Reputation points
2022-12-22T07:39:02.877+00:00

Hi,

We are using an IoT Edge Device which sends D2C message to IoT Hub, can we restrict the access to IoT Hub from IoT Edge using the shared access policy and built-in end-points, for example the shared access policy with name iothubowner is having all access, so is the IoT edge have all those permissions?

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
598 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,272 questions
{count} votes

1 answer

Sort by: Most helpful
  1. chbeier 1,871 Reputation points
    2022-12-22T08:36:47.24+00:00

    Hello @Satyam Chauhan ,

    It is a best practice to follow the principle of least privilege in any solution. Therefore, different shared access policies exist, one for the iothubowner (think about "root" or admin), one for services to consume messages from the built-in service endpoints, one for devices to connect and communicate through the device facing endpoints and special policies for device management solutions like registryRead to list the device registry contents, registryReadWrite to read and create new entries in the device registry (create new devices) and a special deviceupdateservice policy what combines device, service and registryRead.

    There is a great documentation on how to control and secure access to IoT Hub. I recommend reading Control access with Azure AD for service APIs as it simplifies management compared to security tokens.

    ----------

    Please don't forget to click on "best answer" or "upvote" button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.