Skip to content

Commit 50bb33b

Browse files
Merge pull request #280897 from PatAltimore/patricka-x509-inline-release-aio-july-updates
Update MQTT broker x.509 attributes
2 parents 2d61fbb + c0fbd6b commit 50bb33b

File tree

2 files changed

+35
-39
lines changed

2 files changed

+35
-39
lines changed

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

Lines changed: 31 additions & 6 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/01/2024
10+
ms.date: 07/16/2024
1111

1212
#CustomerIntent: As an operator, I want to configure authentication so that I have secure MQTT broker communications.
1313
---
@@ -150,15 +150,40 @@ BinaryData
150150
====
151151
```
152152

153-
### Import certificate-to-attribute mapping
153+
### Certificate attributes
154154

155-
To use authorization policies for clients using properties on the X.509 certificates, create a certificate-to-attribute mapping TOML file and import it as a Kubernetes secret under the key `x509Attributes.toml`. This file maps the subject name of the client certificate to the attributes that can be used in authorization policies. It's required even if you don't use authorization policies.
155+
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.
156156

157-
```bash
158-
kubectl create secret generic x509-attributes --from-file=x509Attributes.toml -n azure-iot-operations
157+
```yaml
158+
apiVersion: mq.iotoperations.azure.com/v1beta1
159+
kind: BrokerAuthentication
160+
metadata:
161+
name: authn
162+
namespace: azure-iot-operations
163+
spec:
164+
authenticationMethods:
165+
- x509Credentials:
166+
authorizationAttributes:
167+
root:
168+
subject = "CN = Contoso Root CA Cert, OU = Engineering, C = US"
169+
attributes:
170+
organization = contoso
171+
intermediate:
172+
subject = "CN = Contoso Intermediate CA"
173+
attributes:
174+
city = seattle
175+
foo = bar
176+
smart-fan:
177+
subject = "CN = smart-fan"
178+
attributes:
179+
building = 17
159180
```
160181

161-
To learn about the attributes file syntax, see [Authorize clients that use X.509 authentication](./howto-configure-authorization.md#authorize-clients-that-use-x509-authentication).
182+
In this 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. In addition, the smart fan receives attributes specific to it.
183+
184+
The matching for attributes always starts from the leaf client certificate and then goes along the chain. The attribute assignment stops after the first match. In previous example, even if `smart-fan` has the intermediate certificate `CN = Contoso Intermediate CA`, it doesn't get the associated attributes.
185+
186+
Authorization rules can be applied to clients using X.509 certificates with these attributes.
162187

163188
### Enable X.509 client authentication
164189

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

Lines changed: 4 additions & 33 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/02/2024
10+
ms.date: 07/15/2024
1111

1212
#CustomerIntent: As an operator, I want to configure authorization so that I have secure MQTT broker communications.
1313
---
@@ -84,44 +84,15 @@ This broker authorization allows clients with usernames `temperature-sensor` or
8484
- `temperature-sensor` can subscribe to `/commands/contoso`.
8585
- `some-other-username` can subscribe to `/commands/contoso`.
8686

87-
To create this BrokerAuthorization resource, apply the YAML manifest to your Kubernetes cluster.
87+
To create this *BrokerAuthorization* resource, apply the YAML manifest to your Kubernetes cluster.
8888

8989
## Authorize clients that use X.509 authentication
9090

9191
Clients that use [X.509 certificates for authentication](./howto-configure-authentication.md) can be authorized to access resources based on X.509 properties present on their certificate or their issuing certificates up the chain.
9292

93-
### With certificate chain properties using attributes
93+
### Using attributes
9494

95-
To create rules based on properties from a client's certificate, its root CA, or intermediate CA, a certificate-to-attributes mapping TOML file is required. For example:
96-
97-
```toml
98-
[root]
99-
subject = "CN = Contoso Root CA Cert, OU = Engineering, C = US"
100-
101-
[root.attributes]
102-
organization = "contoso"
103-
104-
[intermediate]
105-
subject = "CN = Contoso Intermediate CA"
106-
107-
[intermediate.attributes]
108-
city = "seattle"
109-
foo = "bar"
110-
111-
[smart-fan]
112-
subject = "CN = smart-fan"
113-
114-
[smart-fan.attributes]
115-
building = "17"
116-
```
117-
118-
In this 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. In addition, the smart fan receives attributes specific to it.
119-
120-
The matching for attributes always starts from the leaf client certificate and then goes along the chain. The attribute assignment stops after the first match. In previous example, even if `smart-fan` has the intermediate certificate `CN = Contoso Intermediate CA`, it doesn't get the associated attributes.
121-
122-
To apply the mapping, create a certificate-to-attribute mapping TOML file as a Kubernetes secret, and reference it in `authenticationMethods.x509.attributes` for the BrokerAuthentication resource.
123-
124-
Then, authorization rules can be applied to clients using X.509 certificates with these attributes.
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).
12596

12697
### With client certificate subject common name as username
12798

0 commit comments

Comments
 (0)