Skip to content

Commit c27aca9

Browse files
authored
Merge pull request #282006 from PatAltimore/patricka-default-listener-release-aio-july-updates
MQTT broker Brokerlistener changes
2 parents 2255506 + ec91d31 commit c27aca9

8 files changed

+218
-194
lines changed

articles/iot-operations/create-edge-apps/howto-deploy-dapr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ To configure authorization policies to MQTT broker, first you create a [BrokerAu
131131
1. Save the following yaml, which contains a BrokerAuthorization definition, to a file named `aio-dapr-authz.yaml`:
132132

133133
```yml
134-
apiVersion: mq.iotoperations.azure.com/v1beta1
134+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
135135
kind: BrokerAuthorization
136136
metadata:
137137
name: my-dapr-authz-policies

articles/iot-operations/manage-mqtt-broker/howto-configure-authentication.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.subservice: azure-mqtt-broker
77
ms.topic: how-to
88
ms.custom:
99
- ignite-2023
10-
ms.date: 07/26/2024
10+
ms.date: 08/02/2024
1111

1212
#CustomerIntent: As an operator, I want to configure authentication so that I have secure MQTT broker communications.
1313
---
@@ -29,27 +29,26 @@ kubectl get brokerauthentication authn -n azure-iot-operations -o yaml
2929
The output shows the default BrokerAuthentication resource, with metadata removed for brevity:
3030

3131
```yaml
32-
apiVersion: mq.iotoperations.azure.com/v1beta1
32+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
3333
kind: BrokerAuthentication
3434
metadata:
3535
name: authn
3636
namespace: azure-iot-operations
3737
spec:
38-
listenerRef:
39-
- listener
4038
authenticationMethods:
41-
- sat:
42-
audiences: ["aio-mq"]
39+
- method: ServiceAccountToken
40+
serviceAccountToken:
41+
audiences:
42+
- aio-mq
4343
```
4444
4545
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`.
4646

4747
## Relationship between BrokerListener and BrokerAuthentication
4848

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:
5050

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.
5352
* Each BrokerAuthentication can support multiple authentication methods at once
5453

5554
## Authentication flow
@@ -71,18 +70,21 @@ The authentication flow ends when:
7170
With multiple authentication methods, MQTT broker has a fallback mechanism. For example:
7271

7372
```yaml
74-
apiVersion: mq.iotoperations.azure.com/v1beta1
73+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
7574
kind: BrokerAuthentication
7675
metadata:
7776
name: authn
7877
namespace: azure-iot-operations
7978
spec:
80-
listenerRef:
81-
- listener
8279
authenticationMethods:
83-
- custom:
80+
- method: Custom
81+
custom:
82+
# ...
83+
- method: ServiceAccountToken
84+
serviceAccountToken:
8485
# ...
85-
- sat:
86+
- method: x509Credentials
87+
x509Credentials:
8688
# ...
8789
```
8890

@@ -98,12 +100,7 @@ If the custom authentication server is unavailable and all subsequent methods de
98100

99101
## Disable authentication
100102

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.
107104

108105
## Configure authentication method
109106

@@ -155,14 +152,15 @@ BinaryData
155152
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.
156153

157154
```yaml
158-
apiVersion: mq.iotoperations.azure.com/v1beta1
155+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
159156
kind: BrokerAuthentication
160157
metadata:
161158
name: authn
162159
namespace: azure-iot-operations
163160
spec:
164161
authenticationMethods:
165-
- x509Credentials:
162+
- method: x509Credentials
163+
x509Credentials:
166164
authorizationAttributes:
167165
root:
168166
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
192190
```yaml
193191
spec:
194192
authenticationMethods:
195-
- x509:
193+
- method: x509Credentials
194+
x509Credentials:
196195
trustedClientCaCert: client-ca
197196
attributes:
198197
secretName: x509-attributes
@@ -264,13 +263,16 @@ Clients authentication via SAT can optionally have their SATs annotated with att
264263

265264
### Enable Service Account Token (SAT) authentication
266265

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.
268267

269268
```yaml
270269
spec:
271270
authenticationMethods:
272-
- sat:
273-
audiences: ["aio-mq", "my-audience"]
271+
- method: ServiceAccountToken
272+
serviceAccountToken:
273+
audiences:
274+
- aio-mq
275+
- my-audience
274276
```
275277

276278
Apply your changes with `kubectl apply`. It might take a few minutes for the changes to take effect.

articles/iot-operations/manage-mqtt-broker/howto-configure-authorization.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ The specification of a *BrokerAuthorization* resource has the following fields:
2929

3030
| Field Name | Required | Description |
3131
| --- | --- | --- |
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. |
3332
| authorizationPolicies | Yes | This field defines the settings for the authorization policies, such as *enableCache* and *rules*.|
3433
| 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`. |
3534
| 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:
4443
The following example shows how to create a *BrokerAuthorization* resource that defines the authorization policies for a listener named *my-listener*.
4544

4645
```yaml
47-
apiVersion: mq.iotoperations.azure.com/v1beta1
46+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
4847
kind: BrokerAuthorization
4948
metadata:
5049
name: "my-authz-policies"
5150
namespace: azure-iot-operations
5251
spec:
53-
listenerRef:
54-
- "my-listener" # change to match your listener name as needed
5552
authorizationPolicies:
5653
enableCache: true
5754
rules:
@@ -92,7 +89,7 @@ Clients that use [X.509 certificates for authentication](./howto-configure-authe
9289

9390
### Using attributes
9491

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).
9693

9794
### With client certificate subject common name as username
9895

@@ -113,14 +110,12 @@ Attribute annotations must begin with `aio-mq-broker-auth/` to distinguish them
113110
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:
114111

115112
```yaml
116-
apiVersion: mq.iotoperations.azure.com/v1beta1
113+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
117114
kind: BrokerAuthorization
118115
metadata:
119116
name: "my-authz-policies"
120117
namespace: azure-iot-operations
121118
spec:
122-
listenerRef:
123-
- "az-mqtt-non-tls-listener"
124119
authorizationPolicies:
125120
enableCache: false
126121
rules:
@@ -161,7 +156,7 @@ kubectl edit brokerauthorization my-authz-policies
161156
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.
162157

163158
```yaml
164-
apiVersion: mq.iotoperations.azure.com/v1beta1
159+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
165160
kind: BrokerListener
166161
metadata:
167162
name: "my-listener"

articles/iot-operations/manage-mqtt-broker/howto-configure-availability-scale.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ kubectl delete broker broker -n azure-iot-operations
108108
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.
109109

110110
```yaml
111-
apiVersion: mq.iotoperations.azure.com/v1beta1
111+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
112112
kind: Broker
113113
metadata:
114114
name: broker
@@ -178,7 +178,7 @@ The following table lists the properties of the broker advanced settings that in
178178
Here's an example of a *Broker* with advanced settings:
179179

180180
```yml
181-
apiVersion: mq.iotoperations.azure.com/v1beta1
181+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
182182
kind: Broker
183183
metadata:
184184
name: broker
@@ -243,7 +243,7 @@ You can configure diagnostics using the *Broker* custom resource definition (CRD
243243
Here's an example of a *Broker* custom resource with metrics and tracing enabled and self-check disabled:
244244

245245
```yaml
246-
apiVersion: mq.iotoperations.azure.com/v1beta1
246+
apiVersion: mqttbroker.iotoperations.azure.com/v1beta1
247247
kind: Broker
248248
metadata:
249249
name: broker

0 commit comments

Comments
 (0)