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
@@ -155,10 +155,10 @@ To create this *BrokerAuthorization* resource, apply the YAML manifest to your K
155
155
156
156
---
157
157
158
-
This broker authorization allows clients with usernames`temperature-sensor` or `humidity-sensor`, or clients with attributes `organization` with value `contoso` and `city` with value `seattle`, to:
158
+
This broker authorization allows clients with client IDs`temperature-sensor` or `humidity-sensor`, or clients with attributes `organization` with value `contoso` and `city` with value `seattle`, to:
159
159
160
160
- Connect to the broker.
161
-
- Publish messages to telemetry topics scoped with their usernames and organization. For example:
161
+
- Publish messages to telemetry topics scoped with their client IDs and organization. For example:
162
162
- `temperature-sensor`can publish to `/telemetry/temperature-sensor` and `/telemetry/contoso`.
163
163
- `humidity-sensor`can publish to `/telemetry/humidity-sensor` and `/telemetry/contoso`.
164
164
- `some-other-username`can publish to `/telemetry/contoso`.
@@ -168,12 +168,14 @@ This broker authorization allows clients with usernames `temperature-sensor` or
168
168
169
169
### Using username for authorization
170
170
171
-
Here's a summary of how the username is used for authorization based on the authentication method:
171
+
To use the MQTT username for authorization, specify them as an array under `principals.usernames`. However, depending on the authentication method, the username might not be verified:
172
172
173
173
- **Kubernetes SAT** - Username shouldn't be used for authorization because is not verified for MQTTv5 with enhanced authentication.
174
174
- **X.509** - Username matches the CN from certificate and can be used for authorization rules.
175
175
- **Custom** - Username should only be used for authorization rules if custom authentication validates the username.
176
176
177
+
To prevent security issues, only use the MQTT username for broker authorization when it can be verified.
178
+
177
179
### Further limit access based on client ID
178
180
179
181
Because the `principals` field is a logical OR, you can further restrict access based on client ID by adding the `clientIds` field to the `brokerResources` field. For example, to allow clients with client IDs that start with its building number to connect and publish telemetry to topics scoped with their building, use the following configuration:
0 commit comments