Skip to content

Commit 6e133c8

Browse files
committed
Public documentation for secret archive settings
1 parent 33278b8 commit 6e133c8

File tree

1 file changed

+157
-22
lines changed

1 file changed

+157
-22
lines changed

articles/operator-nexus/how-to-credential-manager-key-vault.md

Lines changed: 157 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.custom: template-how-to, devx-track-azurecli
1111

1212
# Set up Key Vault for Managed Credential Rotation in Operator Nexus
1313

14-
Azure Operator Nexus utilizes secrets and certificates to manage component security across the platform. The Operator Nexus platform handles the rotation of these secrets and certificates. By default, Operator Nexus stores the credentials in a managed Key Vault. To keep the rotated credentials in their own Key Vault, the user has to set up the Key Vault for the Azure Operator Nexus instance. Once created, the user needs to add a role assignment on the Customer Key Vault to allow the Operator Nexus Platform to write updated credentials, and additionally link the Customer Key Vault to the Nexus Cluster Resource.
14+
Azure Operator Nexus utilizes secrets and certificates to manage component security across the platform. The Operator Nexus platform handles the rotation of these secrets and certificates. By default, Operator Nexus stores the credentials in a managed Key Vault. To keep the rotated credentials in their own Key Vault, the user has the option to configure their own Key Vault to receive rotated credentials. This requires the user to set up the Key Vault for the Azure Operator Nexus instance. Once created, the user needs to add a role assignment on the Customer Key Vault to allow the Operator Nexus Platform to write updated credentials, and additionally link the Customer Key Vault to the Nexus Cluster Resource.
1515

1616
## Prerequisites
1717

@@ -22,9 +22,9 @@ Azure Operator Nexus utilizes secrets and certificates to manage component secur
2222
> [!NOTE]
2323
> A single Key Vault can be used for any number of clusters.
2424
25-
## Configure Managed Identity for Cluster Manager
25+
## Configure Key Vault Using Managed Identity for Cluster Manager
2626

27-
Beginning with the 2024-06-01-public-preview API, managed identities are used in the Cluster Manager for write access to rotated credentials to a key vault. The Cluster Manager identity can be system-assigned or [user-assigned](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities), and can be managed directly via APIs or via CLI.
27+
Starting with the 2024-07-01 API version, managed identities in the Cluster Manager are used for write access to deliver rotated credentials to a key vault. The Cluster Manager identity may be system-assigned or [user-assigned](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities), and can be managed directly via APIs or via CLI.
2828

2929
These examples describe how to configure a managed identity for a Cluster Manager.
3030

@@ -45,18 +45,38 @@ These examples describe how to configure a managed identity for a Cluster Manage
4545
--resource-group <Resource Group Name> --mi-user-assigned "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUAI"
4646
```
4747

48-
- Add system assigned identity to Cluster Manager
48+
- Add system-assigned identity to Cluster Manager
4949
```
5050
az networkcloud clustermanager update --name <Cluster Manager Name> --resource-group <Resource Group Name> --mi-system-assigned
5151
```
5252

53-
- Add user assigned identity to Cluster Manager
53+
- Add user-assigned identity to Cluster Manager
5454
```
5555
az networkcloud clustermanager update --name <Cluster Manager Name> --resource-group <Resource Group Name> \
5656
--mi-user-assigned "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUAI"
5757
```
5858

59-
## Get the Principal ID for the Managed Identity
59+
### Configure Nexus Cluster Secret Archive
60+
61+
Register the Customer Key Vault as the secret archive for the Nexus cluster. The key vault resource ID must be configured in the cluster and enabled to store the secrets of the cluster.
62+
63+
Example:
64+
65+
```console
66+
# Set and enable Customer Key Vault on Nexus cluster
67+
az networkcloud cluster update --ids /subscriptions/<subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.NetworkCloud/clusters/<Nexus Cluster Name> --secret-archive "{key-vault-id:<Key Vault Resource ID>,use-key-vault:true}"
68+
69+
# Show Customer Key Vault setting (secretArchive) on the Nexus cluster
70+
az networkcloud cluster show --ids /subscriptions/<subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.NetworkCloud/clusters/<Nexus Cluster Name> --query secretArchive
71+
```
72+
73+
For more help:
74+
75+
```console
76+
az networkcloud cluster update --secret-archive ?? --help
77+
```
78+
79+
### Get the Principal ID for the Cluster Manager Managed Identity
6080

6181
Once a managed identity is configured, use the CLI to view the identity and the associated principal ID data within the cluster manager.
6282

@@ -88,41 +108,156 @@ User-assigned identity example:
88108
},
89109
```
90110

91-
## Writing Credential Updates to a Customer Key Vault on Nexus Cluster
111+
Refer to [_Grant Managed Identity Access to a Key Vault for Credential Rotation_](#grant-managed-identity-access-to-a-key-vault-for-credential-rotation) to assign the appropriate role to the Managed Identity Principal ID.
92112

93-
- Assign the *Operator Nexus Key Vault Writer Service Role*. Ensure that *Azure role-based access control* is selected as the permission model for the key vault on the *Access configuration* view. Then from the *Access Control* view, select to add a role assignment.
113+
## Configure Key Vault Using Managed Identity for Cluster
94114

95-
| Role Name | Role Definition ID |
96-
|:-------------------------------------------------------|:-------------------------------------|
97-
| Operator Nexus Key Vault Writer Service Role (Preview) | 44f0a1a8-6fea-4b35-980a-8ff50c487c97 |
115+
> [!IMPORTANT]
116+
> Please note that this method for configuring a key vault for credential rotation is in preview. **This method can only be used with key vault that do not have firewall enabled.** If your environment requires the key vault firewall be enabled, use the existing [Cluster Manager]() identity method.
98117
99-
Example:
118+
Beginning with the 2024-10-01-preview API, managed identities in the Nexus Cluster resource can be used instead of Cluster Manager. The Cluster identity may be system-assigned or [user-assigned](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities), and can be managed directly via APIs or via CLI.
100119

101-
```console
102-
az role assignment create --assignee <Managed Identity Principal Id> --role 44f0a1a8-6fea-4b35-980a-8ff50c487c97 --scope /subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.KeyVault/vaults/<Key Vault Name>
120+
> [!NOTE]
121+
> If Nexus Cluster managed identity is configured for the key vault, then these settings will supersede settings configured in [_Configure Key Vault Using Managed Identity for Cluster Manager_](#configure-key-vault-using-managed-identity-for-cluster-manager)
122+
123+
These examples describe how to configure a managed identity for a Nexus Cluster.
124+
125+
- Create Nexus Cluster with system-assigned identity
126+
```azurecli-interactive
127+
az networkcloud cluster create --name "<cluster-name>" \
128+
--resource-group "<cluster-resource-group>" \
129+
...
130+
--mi-system-assigned \
131+
...
132+
--subscription "<subscription>"
133+
```
134+
135+
- Create Nexus Cluster with user-assigned identity
136+
```azurecli-interactive
137+
az networkcloud cluster create --name "<cluster-name>" \
138+
--resource-group "<cluster-resource-group>" \
139+
...
140+
--mi-user-assigned "<user-assigned-identity-resource-id>" \
141+
...
142+
--subscription "<subscription>"
143+
```
144+
145+
- Update existing Nexus Cluster with system-assigned identity
146+
```azurecli-interactive
147+
az networkcloud cluster update --ids <cluster-resource-id> --mi-system-assigned
103148
```
104149

105-
- User associates the Customer Key Vault with the Operator Nexus cluster. The key vault resource ID must be configured in the cluster and enabled to store the secrets of the cluster.
150+
- Update existing Nexus Cluster with user-assigned identity
151+
```azurecli-interactive
152+
az networkcloud cluster update --ids <cluster-resource-id> --mi-user-assigned "<user-assigned-identity-resource-id>"
153+
```
154+
155+
### Configure Nexus Cluster Secret Archive Settings
156+
157+
Register the Key Vault URI and managed identity to be used in the secret archive settings for the Nexus cluster.
158+
159+
> [!NOTE]
160+
> Secret archive settings specify the Key Vault URI, not the Key Vault resource ID, and the managed identity specfied must be configured for the Nexus Cluster.
161+
162+
Example:
163+
164+
- Using a system-assigned identity:
165+
166+
```azurecli
167+
az rest --method PATCH --url ${CLUSTER_ID}?api-version=2024-10-01-preview --body @./sami-body.json
168+
```
169+
170+
The request body (sami-body.json) example:
171+
172+
```azurecli
173+
{
174+
"properties": {
175+
"secretArchiveSettings": {
176+
"vaultUri": "https://<key vault name>.vault.azure.net/",
177+
"associatedIdentity": {
178+
"identityType": "SystemAssignedIdentity"
179+
}
180+
}
181+
}
182+
}
183+
```
184+
185+
- Using a user-assigned identity:
186+
187+
```azurecli
188+
az rest --method PATCH --url ${CLUSTER_ID}?api-version=2024-10-01-preview --body @./uami-body.json
189+
```
190+
191+
The request body (uami-body.json) example:
192+
193+
```azurecli
194+
{
195+
"properties": {
196+
"secretArchiveSettings": {
197+
"vaultUri": "https://<key vault name>.vault.azure.net/",
198+
"associatedIdentity": {
199+
"identityType": "UserAssignedIdentity",
200+
"userAssignedIdentityResourceId": "<user-assigned-identity-resource-id>"
201+
}
202+
}
203+
}
204+
}
205+
```
206+
207+
### Get the Principal ID for the Cluster Managed Identity
208+
209+
Once a managed identity is configured for the Nexus Cluster, use the CLI to view the identity and get the _principalId_ for the managed identity specified in the secret archive settings.
106210

107211
Example:
108212

109213
```console
110-
# Set and enable Customer Key Vault on Nexus cluster
111-
az networkcloud cluster update --ids /subscriptions/<subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.NetworkCloud/clusters/<Nexus Cluster Name> --secret-archive "{key-vault-id:<Key Vault Resource ID>,use-key-vault:true}"
214+
az networkcloud cluster show --ids <cluster-resource-id>
215+
```
112216

113-
# Show Customer Key Vault setting (secretArchive) on the Nexus cluster
114-
az networkcloud cluster show --ids /subscriptions/<subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.NetworkCloud/clusters/<Nexus Cluster Name> --query secretArchive
217+
System-assigned identity example:
218+
```
219+
"identity": {
220+
"principalId": "2cb564c1-b4e5-4c71-bbc1-6ae259aa5f87",
221+
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
222+
"type": "SystemAssigned"
223+
},
115224
```
116225

117-
For more help:
226+
User-assigned identity example:
227+
```
228+
"identity": {
229+
"type": "UserAssigned",
230+
"userAssignedIdentities": {
231+
"/subscriptions/<subscriptionID>/resourcegroups/<resourceGroupName>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<userAssignedIdentityName>": {
232+
"clientId": "e67dd610-99cf-4853-9fa0-d236b214e984",
233+
"principalId": "8e6d23d6-bb6b-4cf3-a00f-4cd640ab1a24"
234+
}
235+
}
236+
},
237+
```
238+
239+
Refer to [_Grant Managed Identity Access to a Key Vault for Credential Rotation_](#grant-managed-identity-access-to-a-key-vault-for-credential-rotation) to assign the appropriate role to the Managed Identity Principal ID.
240+
241+
## Grant Managed Identity Access to a Key Vault for Credential Rotation
242+
243+
- Assign the *Operator Nexus Key Vault Writer Service Role*. Ensure that *Azure role-based access control* is selected as the permission model for the key vault on the *Access configuration* view. Then from the *Access Control* view, select to add a role assignment.
244+
245+
| Role Name | Role Definition ID |
246+
|:-------------------------------------------------------|:-------------------------------------|
247+
| Operator Nexus Key Vault Writer Service Role (Preview) | 44f0a1a8-6fea-4b35-980a-8ff50c487c97 |
248+
249+
Example:
118250

119251
```console
120-
az networkcloud cluster update --secret-archive ?? --help
252+
az role assignment create --assignee <Managed Identity Principal Id> --role 44f0a1a8-6fea-4b35-980a-8ff50c487c97 --scope /subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.KeyVault/vaults/<Key Vault Name>
121253
```
122254

255+
If using a user-assigned managed identity, proceed to [add permission to user-assigned identity](#add-a-permission-to-user-assigned-identity)
256+
123257
## Add a permission to User-assigned identity
124258

125-
When using a User-assigned identity, add the following role assignment to the UAI resource:
259+
When using a user-assigned managed identity, a customer is required to provision access to that identity for the Nexus platform.
260+
Specifically, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action` permission needs to be added to the User-assigned identity for `AFOI-NC-MGMT-PME-PROD` Microsoft Entra ID. It is a known limitation of the platform that will be addressed in the future.
126261

127262
1. Open the Azure Portal and locate the User-assigned identity in question.
128263
2. Under **Access control (IAM)**, click **Add role assignment**.

0 commit comments

Comments
 (0)