You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#CustomerIntent: As an operator, I want understand options to secure MQTT communications for my IoT Operations solution.
14
14
---
@@ -20,7 +20,7 @@ To customize the network access and security use the *BrokerListener* resource.
20
20
Each listener port can have its own authentication and authorization rules that define who can connect to the listener and what actions they can perform on the broker. You can use *BrokerAuthentication* and *BrokerAuthorization* resources to specify the access control policies for each listener. This flexibility allows you to fine-tune the permissions and roles of your MQTT clients, based on their needs and use cases.
21
21
22
22
> [!TIP]
23
-
> You can only access the default MQTT broker deployment by using the cluster IP, TLS, and a service account token. Clients connecting from outside the cluster need extra configuration before they can connect.
23
+
> You can only access the default MQTT broker deployment by using the cluster IP, TLS, and a service account token. Clients connecting from outside the cluster [need extra configuration](./howto-test-connection.md) before they can connect.
24
24
25
25
Listeners have the following characteristics:
26
26
@@ -35,9 +35,12 @@ For a list of the available settings, see the [Broker Listener](/rest/api/iotope
35
35
36
36
## Default BrokerListener
37
37
38
-
When you deploy Azure IoT Operations, the deployment also creates a *BrokerListener* resource named `default` in the `azure-iot-operations` namespace. This listener is linked to the default *Broker* resource named `default` that's also created during deployment. The default listener exposes the brokeron port 18883 with TLS and SAT authentication enabled. The TLS certificate is [automatically managed](#configure-tls-with-automatic-certificate-management)by cert-manager. Authorization is disabled by default.
38
+
When you deploy Azure IoT Operations, the deployment also creates a *BrokerListener* resource named `default`. This listener is used to for encrypted internal communication between Azure IoT Operations components. The default listener is part of the [default *Broker*](./overview-broker.md#default-broker-resource), exposes a [ClusterIp service](https://kubernetes.io/docs/concepts/services-networking/service/#type-clusterip)on port 18883, uses [Kubernetes service account authentication](./howto-configure-authentication.md#enable-service-account-token-sat-authentication), has an [automatically managed](#configure-tls-with-automatic-certificate-management)TLS certificate, and doesn't use any authorization.
39
39
40
-
To view or edit the listener:
40
+
> [!CAUTION]
41
+
> To avoid disrupting internal Azure IoT Operations communication, keep the default listener unchanged and dedicated for internal use. For external communication, [create a new listener](#create-new-broker-listeners). If you need to use the ClusterIp service, add more ports to the default listener without changing any of the existing settings.
42
+
43
+
To view or edit the default listener:
41
44
42
45
# [Portal](#tab/portal)
43
46
@@ -50,11 +53,72 @@ To view or edit the listener:
50
53
51
54
:::image type="content" source="media/howto-configure-brokerlistener/default-broker-listener.png" alt-text="Screenshot using Azure portal to view or edit the default broker listener.":::
52
55
53
-
1. Review the listener settings and make any changes as needed.
56
+
1. Review the listener settings, but avoid modifying any of the existing settings. Instead, create a new port and configure it as needed.
54
57
55
58
# [Bicep](#tab/bicep)
56
59
57
-
You shouldn't modify the default listener using Bicep. Instead, create a new listener and configure it as needed.
60
+
You shouldn't modify the default listener using Bicep.
To learn more about the default BrokerAuthentication resource linked to this listener, see [Default BrokerAuthentication resource](howto-configure-authentication.md#default-brokerauthentication-resource).
@@ -96,37 +166,72 @@ To learn more about the default BrokerAuthentication resource linked to this lis
96
166
The default *BrokerListener* uses the service type *ClusterIp*. You can have only one listener per service type. If you want to add more ports to service type *ClusterIp*, you can update the default listener to add more ports. For example, you could add a new port 1883 with no TLS and authentication off with the following kubectl patch command:
This example shows how to create a new *BrokerListener* resource named *loadbalancer-listener* for a *Broker* resource. The *BrokerListener* resource defines a two ports that accept MQTT connections from clients.
176
+
To create a new listener, you need to specify the following settings:
177
+
178
+
- **Name**: Name of the *BrokerListener* resource. The name must be unique within the namespace.
179
+
- **Service name**: Name of the Kubernetes service that exposes the broker. If left empty, the listener name is used as the service name.
180
+
- **Service type**: Type of the Kubernetes service. Can be `LoadBalancer`, `ClusterIp`, or `NodePort`.
181
+
- **Ports**: List of ports that the listener listens on. Each port can have its own authentication, authorization, and TLS settings.
182
+
- To use your own authentication or authorization setting for a port, you must create the corresponding resources before creating the *BrokerListener* resource. For more information, see [Configure MQTT broker authentication](howto-configure-authentication.md) and [Configure MQTT broker authorization](howto-configure-authorization.md).
183
+
- To use TLS, see [Configure TLS with automatic certificate management](#configure-tls-with-automatic-certificate-management) or [Configure TLS with manual certificate management](#configure-tls-with-manual-certificate-management) sections.
184
+
185
+
This example shows how to create a new listener with load balancer service type. The *BrokerListener* resource defines a two ports that accept MQTT connections from clients.
107
186
108
-
- The first port listens on port 1883 with no TLS and authentication off. Clients can connect to the broker without encryption or authentication.
109
-
- The second port listens on port 18883 with TLS and authentication enabled. Only authenticated clients can connect to the broker with TLS encryption. TLS is set to `automatic`, which means that the listener uses cert-manager to get and renew its server certificate.
187
+
- The first port listens on port 1883 without TLS and authentication. Clients can connect to the broker without encryption or authentication. This setup is suitable for testing only. [Don't use this configuration in production](./howto-test-connection.md#only-turn-off-tls-and-authentication-for-testing).
188
+
- The second port listens on port 8883 with TLS and authentication enabled. Only [authenticated clients with a Kubernetes service account token](./howto-configure-authentication.md#default-brokerauthentication-resource) can connect. TLS is set to [automatic mode](#enable-tls-automatic-certificate-management-for-a-port), using cert-manager to manage the server certificate from the [default issuer](../secure-iot-ops/concept-default-root-ca.md#default-self-signed-issuer-and-root-ca-certificate-for-tls-server-certificates). This setup is closer to a production configuration.
110
189
111
190
# [Portal](#tab/portal)
112
191
113
192
1. In the Azure portal, navigate to your IoT Operations instance.
114
193
1. Under **Azure IoT Operations resources**, select **MQTT Broker**.
115
-
1. Select **MQTT broker listener for LoadBalancer** > **Create**. You can only create one listener per service type. If you already have a listener of the same service type, you can add more ports to the existing listener.
116
-
117
-
:::image type="content" source="media/howto-configure-brokerlistener/create-loadbalancer.png" alt-text="Screenshot using Azure portal to create MQTT broker for load balancer listener.":::
194
+
1. Select **MQTT broker listener for LoadBalancer** > **Create**.
| Service name | Name of the Kubernetes service associated with the BrokerListener. |
125
-
| Service type | Type of broker service, such as *LoadBalancer*, *NodePort*, or *ClusterIP*. |
126
-
| Port | Port number on which the BrokerListener listens for MQTT connections. |
127
-
| Authentication | The [authentication resource reference](howto-configure-authentication.md). |
128
-
| Authorization | The [authorization resource reference](howto-configure-authorization.md). |
129
-
| TLS | Indicates whether TLS is enabled for secure communication. Can be set to [automatic](#configure-tls-with-automatic-certificate-management) or [manual](#configure-tls-with-manual-certificate-management). |
201
+
| Service name | Name of the Kubernetes service. Leave empty to use the listener name as service name. |
202
+
| Service type | **LoadBalancer** already selected. |
203
+
204
+
1. Under **Ports**, enter the following settings for the first port:
205
+
206
+
| Setting | Description |
207
+
| -------------- | --------------------- |
208
+
| Port | Enter 1883 |
209
+
| Authentication | Choose **None** |
210
+
| Authorization | Choose **None** |
211
+
| Protocol | Choose **MQTT** |
212
+
| TLS | Don't add |
213
+
214
+
1. Select **Add port entry** to add a second port and enter the following settings:
215
+
216
+
| Setting | Description |
217
+
| -------------- | --------------------- |
218
+
| Port | Enter 8883 |
219
+
| Authentication | Choose **default** |
220
+
| Authorization | Choose **None** |
221
+
| Protocol | Choose **MQTT** |
222
+
| TLS | Select **Add** |
223
+
224
+
1. In the **TLS configuration** pane, enter the following settings:
225
+
226
+
| Setting | Description |
227
+
| -------------- | --------------------- |
228
+
| TLS Mode | Choose **Automatic** |
229
+
| Issuer name | Enter `azure-iot-operations-aio-certificate-issuer` |
230
+
| Issuer kind | Choose **ClusterIssuer** |
231
+
232
+
Leave other settings as default, and select **Apply**.
233
+
234
+
:::image type="content" source="media/howto-configure-brokerlistener/create-loadbalancer.png" alt-text="Screenshot using Azure portal to create MQTT broker for load balancer listener.":::
130
235
131
236
1. Select **Create listener**.
132
237
@@ -135,7 +240,6 @@ This example shows how to create a new *BrokerListener* resource named *loadbala
For more information about authentication, see [Configure MQTT broker authentication](howto-configure-authentication.md). For more information about authorization, see [Configure MQTT broker authorization](howto-configure-authorization.md). For more information about TLS, see [Configure TLS with automatic certificate management](#configure-tls-with-automatic-certificate-management) or [Configure TLS with manual certificate management](#configure-tls-with-manual-certificate-management) sections.
222
-
223
325
---
224
326
327
+
## Service type
328
+
329
+
Each BrokerListener maps to a [Kubernetes service](https://kubernetes.io/docs/concepts/services-networking/service/).. The service type determines how the broker is exposed to the network. The three service types are:
330
+
331
+
- **ClusterIp**: Exposes the broker on a cluster-internal IP. Clients can connect to the broker from within the cluster. This is the default service type for the default listener.
332
+
- **NodePort**: Exposes the broker on each node's IP at a static port. Clients can connect to the broker from outside the cluster. This service type is useful for development and testing.
333
+
- **LoadBalancer**: Exposes the broker externally. The service is assigned an external IP address that clients can use to connect to the broker. This is the most common service type for production deployments.
334
+
335
+
Only one listener per service type is allowed. If you need more connectivity of the same service type, add more ports to the existing listener.
336
+
337
+
## Service name
338
+
339
+
The service name is the name of the Kubernetes service that exposes the broker. If left empty, the broker listener name is used as the service name. The service name must be unique within the namespace.
340
+
341
+
> [!TIP]
342
+
> To prevent management overhead, we recommend leaving the service name empty. The listener name is unique and can be used to identify the service. Use the service name as an override only when you can't name the service after the listener.
343
+
344
+
## Ports
345
+
346
+
Each listener can have multiple ports, but each port number must be unique within the Azure IoT Operations MQTT broker. For example, if you have a NodePort listener using port 1883, you can't create another LoadBalancer listener with port 1883. Similarly, the default listener uses port 18883, so you can't create another listener with port 18883.
347
+
348
+
## WebSockets support
349
+
350
+
Azure IoT Operations MQTT broker supports MQTT over WebSockets. To enable WebSockets, set the protocol to `WebSockets` in the port settings.
351
+
225
352
## Configure TLS with automatic certificate management
226
353
227
354
To enable TLS with automatic certificate management, specify the TLS settings on a listener port.
Copy file name to clipboardExpand all lines: articles/iot-operations/manage-mqtt-broker/howto-test-connection.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.subservice: azure-mqtt-broker
7
7
ms.topic: how-to
8
8
ms.custom:
9
9
- ignite-2023
10
-
ms.date: 10/30/2024
10
+
ms.date: 11/06/2024
11
11
12
12
#CustomerIntent: As an operator or developer, I want to test MQTT connectivity with tools that I'm already familiar with to know that I set up my MQTT broker correctly.
0 commit comments