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
To change the configuration, modify the `authenticationMethods` setting in this BrokerAuthentication resource or create new brand new BrokerAuthentication resource with a different name. Then, deploy it using `kubectl apply`.
46
46
47
47
## Relationship between BrokerListener and BrokerAuthentication
48
48
49
-
BrokerListener and BrokerAuthentication are separate resources, but they're linked together using `listenerRef`. The following rules apply:
49
+
The following rules apply to the relationship between BrokerListener and BrokerAuthentication:
50
50
51
-
* A BrokerListener can be linked to only one BrokerAuthentication
52
-
* A BrokerAuthentication can be linked to multiple BrokerListeners
51
+
* Each BrokerListener can have multiple ports. Each port can be linked to a BrokerAuthentication resource.
53
52
* Each BrokerAuthentication can support multiple authentication methods at once
54
53
55
54
## Authentication flow
@@ -71,18 +70,21 @@ The authentication flow ends when:
71
70
With multiple authentication methods, MQTT broker has a fallback mechanism. For example:
@@ -98,12 +100,7 @@ If the custom authentication server is unavailable and all subsequent methods de
98
100
99
101
## Disable authentication
100
102
101
-
For testing, disable authentication by changing it in the [BrokerListener resource](howto-configure-brokerlistener.md).
102
-
103
-
```yaml
104
-
spec:
105
-
authenticationEnabled: false
106
-
```
103
+
For testing, you can disable authentication by omitting `authenticationRef` in the `ports` setting of a BrokerListener resource.
107
104
108
105
## Configure authentication method
109
106
@@ -155,14 +152,15 @@ BinaryData
155
152
X509 attributes can be specified in the *BrokerAuthentication* resource. For example, every client that has a certificate issued by the root CA `CN = Contoso Root CA Cert, OU = Engineering, C = US` or an intermediate CA `CN = Contoso Intermediate CA` receives the attributes listed.
subject = "CN = Contoso Root CA Cert, OU = Engineering, C = US"
@@ -192,7 +190,8 @@ Finally, once the trusted client root CA certificate and the certificate-to-attr
192
190
```yaml
193
191
spec:
194
192
authenticationMethods:
195
-
- x509:
193
+
- method: x509Credentials
194
+
x509Credentials:
196
195
trustedClientCaCert: client-ca
197
196
attributes:
198
197
secretName: x509-attributes
@@ -264,13 +263,16 @@ Clients authentication via SAT can optionally have their SATs annotated with att
264
263
265
264
### Enable Service Account Token (SAT) authentication
266
265
267
-
Modify the `authenticationMethods` setting in a BrokerAuthentication resource to specify `sat` as a valid authentication method. The `audiences` specifies the list of valid audiences for tokens. Choose unique values that identify the MQTT broker service. You must specify at least one audience, and all SATs must match one of the specified audiences.
266
+
Modify the `authenticationMethods` setting in a BrokerAuthentication resource to specify `ServiceAccountToken` as a valid authentication method. The `audiences` specifies the list of valid audiences for tokens. Choose unique values that identify the MQTT broker service. You must specify at least one audience, and all SATs must match one of the specified audiences.
268
267
269
268
```yaml
270
269
spec:
271
270
authenticationMethods:
272
-
- sat:
273
-
audiences: ["aio-mq", "my-audience"]
271
+
- method: ServiceAccountToken
272
+
serviceAccountToken:
273
+
audiences:
274
+
- aio-mq
275
+
- my-audience
274
276
```
275
277
276
278
Apply your changes with `kubectl apply`. It might take a few minutes for the changes to take effect.
Copy file name to clipboardExpand all lines: articles/iot-operations/manage-mqtt-broker/howto-configure-authorization.md
+4-9Lines changed: 4 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,6 @@ The specification of a *BrokerAuthorization* resource has the following fields:
29
29
30
30
| Field Name | Required | Description |
31
31
| --- | --- | --- |
32
-
| listenerRef | Yes | The names of the BrokerListener resources that this authorization policy applies. This field is required and must match an existing *BrokerListener* resource in the same namespace. |
33
32
| authorizationPolicies | Yes | This field defines the settings for the authorization policies, such as *enableCache* and *rules*.|
34
33
| enableCache | No | Whether to enable caching for the authorization policies. If set to `true`, the broker caches the authorization results for each client and topic combination to improve performance and reduce latency. If set to `false`, the broker evaluates the authorization policies for each client and topic request, to ensure consistency and accuracy. This field is optional and defaults to `false`. |
35
34
| rules | No | A list of rules that specify the principals and resources for the authorization policies. Each rule has these subfields: *principals* and *brokerResources*. |
@@ -44,14 +43,12 @@ The specification of a *BrokerAuthorization* resource has the following fields:
44
43
The following example shows how to create a *BrokerAuthorization* resource that defines the authorization policies for a listener named *my-listener*.
- "my-listener"# change to match your listener name as needed
55
52
authorizationPolicies:
56
53
enableCache: true
57
54
rules:
@@ -92,7 +89,7 @@ Clients that use [X.509 certificates for authentication](./howto-configure-authe
92
89
93
90
### Using attributes
94
91
95
-
To create rules based on properties from a client's certificate, its root CA, or intermediate CA, define the X.509 attributes in in the *BrokerAuthorization* resource. For more information, see [Certificate attributes](howto-configure-authentication.md#certificate-attributes).
92
+
To create rules based on properties from a client's certificate, its root CA, or intermediate CA, define the X.509 attributes in the *BrokerAuthorization* resource. For more information, see [Certificate attributes](howto-configure-authentication.md#certificate-attributes).
96
93
97
94
### With client certificate subject common name as username
98
95
@@ -113,14 +110,12 @@ Attribute annotations must begin with `aio-mq-broker-auth/` to distinguish them
113
110
As the application has an authorization attribute called `authz-sat`, there's no need to provide a `clientId` or `username`. The corresponding *BrokerAuthorization* resource uses this attribute as a principal, for example:
To disable authorization, set `authorizationEnabled: false` in the BrokerListener resource. When the policy is set to allow all clients, all [authenticated clients](./howto-configure-authentication.md) can access all operations.
Then, create a YAML file with desired settings. For example, the following YAML file configures the broker with name `broker` in namespace `azure-iot-operations` with `medium` memory profile and `distributed` mode with two frontend replicas and two backend chains with two partitions and two workers each. Also, the [encryption of internal traffic option](#configure-encryption-of-internal-traffic) is disabled.
0 commit comments