Skip to content

Commit 37ea08d

Browse files
author
Jill Grant
authored
Merge pull request #290003 from lb4368/cluster-identities
Public documentation for secret archive settings
2 parents f659f8f + ef81a7f commit 37ea08d

File tree

1 file changed

+145
-23
lines changed

1 file changed

+145
-23
lines changed

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

Lines changed: 145 additions & 23 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 must configure their own Key Vault to receive rotated credentials. This configuration 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+
Beginning with the 2024-06-01-public-preview 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

@@ -35,6 +35,7 @@ These examples describe how to configure a managed identity for a Cluster Manage
3535
--fabric-controller-id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName" \
3636
--managed-resource-group-configuration name="my-managed-rg" --tags key1="myvalue1" key2="myvalue2" --resource-group "resourceGroupName" --mi-system-assigned
3737
```
38+
<br/>
3839

3940
- Create or update Cluster Manager with user-assigned identity
4041
```
@@ -44,19 +45,42 @@ These examples describe how to configure a managed identity for a Cluster Manage
4445
--managed-resource-group-configuration name="my-managed-rg" --tags key1="myvalue1" key2="myvalue2" \
4546
--resource-group <Resource Group Name> --mi-user-assigned "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUAI"
4647
```
48+
<br/>
4749

48-
- Add system assigned identity to Cluster Manager
50+
- Add system-assigned identity to Cluster Manager
4951
```
5052
az networkcloud clustermanager update --name <Cluster Manager Name> --resource-group <Resource Group Name> --mi-system-assigned
5153
```
54+
<br/>
5255

53-
- Add user assigned identity to Cluster Manager
56+
- Add user-assigned identity to Cluster Manager
5457
```
5558
az networkcloud clustermanager update --name <Cluster Manager Name> --resource-group <Resource Group Name> \
5659
--mi-user-assigned "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUAI"
5760
```
5861

59-
## Get the Principal ID for the Managed Identity
62+
### Configure Nexus Cluster Secret Archive
63+
64+
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.
65+
66+
Example:
67+
68+
```console
69+
# Set and enable Customer Key Vault on Nexus cluster
70+
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}"
71+
72+
# Show Customer Key Vault setting (secretArchive) on the Nexus cluster
73+
az networkcloud cluster show --ids /subscriptions/<subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.NetworkCloud/clusters/<Nexus Cluster Name> --query secretArchive
74+
```
75+
<br/>
76+
77+
For more help:
78+
79+
```console
80+
az networkcloud cluster update --secret-archive ?? --help
81+
```
82+
83+
### Get the Principal ID for the Cluster Manager Managed Identity
6084

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

@@ -65,6 +89,7 @@ Example:
6589
```console
6690
az networkcloud clustermanager show --ids /subscriptions/<Subscription ID>/resourceGroups/<Cluster Manager Resource Group Name>/providers/Microsoft.NetworkCloud/clusterManagers/<Cluster Manager Name>
6791
```
92+
<br/>
6893

6994
System-assigned identity example:
7095
```
@@ -74,6 +99,7 @@ System-assigned identity example:
7499
"type": "SystemAssigned"
75100
},
76101
```
102+
<br/>
77103

78104
User-assigned identity example:
79105
```
@@ -87,44 +113,140 @@ User-assigned identity example:
87113
}
88114
},
89115
```
116+
<br/>
90117

91-
## Writing Credential Updates to a Customer Key Vault on Nexus Cluster
118+
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.
92119

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.
120+
## Configure Key Vault Using Managed Identity for Cluster
94121

95-
| Role Name | Role Definition ID |
96-
|:-------------------------------------------------------|:-------------------------------------|
97-
| Operator Nexus Key Vault Writer Service Role (Preview) | 44f0a1a8-6fea-4b35-980a-8ff50c487c97 |
122+
> [!IMPORTANT]
123+
> Please note that this method for configuring a key vault for credential rotation is in preview. **This method can only be used with key vaults that do not have firewall enabled.** If your environment requires the key vault firewall be enabled, use the existing [Cluster Manager]() identity method.
98124
99-
Example:
125+
Beginning with the 2024-10-01-preview API, managed identities in the Nexus Cluster resource can be used instead of Cluster Manager. The Cluster managed 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.
100126

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>
127+
> [!NOTE]
128+
> 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)
129+
130+
### Configure Nexus Cluster Secret Archive Settings
131+
132+
The Nexus Cluster _secret-archive-settings_ specify the Azure Key Vault URI where rotated credentials are stored and the managed identity which is used to access it.
133+
134+
These examples describe how to configure a managed identity for a Nexus Cluster and configure it as part of _secret-archive-settings_.
135+
136+
> [!NOTE]
137+
> 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.
138+
139+
- Create Nexus Cluster with system-assigned identity to access Key Vault for rotated credentials.
140+
```azurecli-interactive
141+
az networkcloud cluster create --name "<cluster-name>" \
142+
--resource-group "<cluster-resource-group>" \
143+
...
144+
--mi-system-assigned \
145+
--secret-archive-settings identity-type="SystemAssignedIdentity" vault-uri="https://<key vault name>.vault.azure.net/"
146+
...
147+
--subscription "<subscription>"
148+
```
149+
<br/>
150+
151+
- Create Nexus Cluster with user-assigned identity to access Key Vault for rotated credentials.
152+
```azurecli-interactive
153+
az networkcloud cluster create --name "<cluster-name>" \
154+
--resource-group "<cluster-resource-group>" \
155+
...
156+
--mi-user-assigned "<user-assigned-identity-resource-id>" \
157+
--secret-archive-settings identity-type="UserAssignedIdentity" identity-resource-id="<user-assigned-identity-resource-id>" vault-uri="https://<key vault name>.vault.azure.net/"
158+
...
159+
--subscription "<subscription>"
160+
```
161+
<br/>
162+
163+
- Update existing Nexus Cluster with system-assigned identity to access Key Vault for rotated credentials.
164+
```azurecli-interactive
165+
az networkcloud cluster update --ids <cluster-resource-id> \
166+
--mi-system-assigned \
167+
--secret-archive-settings identity-type="SystemAssignedIdentity" vault-uri="https://<key vault name>.vault.azure.net/"
168+
```
169+
<br/>
170+
171+
- Update existing Nexus Cluster with user-assigned identity
172+
```azurecli-interactive
173+
az networkcloud cluster update --ids <cluster-resource-id> \
174+
--mi-user-assigned "<user-assigned-identity-resource-id>" \
175+
--secret-archive-settings identity-type="UserAssignedIdentity" identity-resource-id="<user-assigned-identity-resource-id>" vault-uri="https://<key vault name>.vault.azure.net/"
176+
```
177+
<br/>
178+
179+
For more help:
180+
181+
```azurecli-interactive
182+
az networkcloud cluster update --secret-archive-settings '??' --help
103183
```
184+
<br/>
104185

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.
186+
### Get the Principal ID for the Cluster Managed Identity
187+
188+
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.
106189

107190
Example:
108191

109192
```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}"
193+
az networkcloud cluster show --ids <cluster-resource-id>
194+
```
195+
<br/>
112196

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
197+
System-assigned identity example:
198+
```
199+
"identity": {
200+
"principalId": "2cb564c1-b4e5-4c71-bbc1-6ae259aa5f87",
201+
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
202+
"type": "SystemAssigned"
203+
},
115204
```
205+
<br/>
116206

117-
For more help:
207+
User-assigned identity example:
208+
```
209+
"identity": {
210+
"type": "UserAssigned",
211+
"userAssignedIdentities": {
212+
"/subscriptions/<subscriptionID>/resourcegroups/<resourceGroupName>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<userAssignedIdentityName>": {
213+
"clientId": "e67dd610-99cf-4853-9fa0-d236b214e984",
214+
"principalId": "8e6d23d6-bb6b-4cf3-a00f-4cd640ab1a24"
215+
}
216+
}
217+
},
218+
```
219+
<br/>
220+
221+
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.
222+
223+
## Grant Managed Identity Access to a Key Vault for Credential Rotation
224+
225+
> [!NOTE]
226+
> A user-assigned managed identity may be created and assigned access to the key vault before the Nexus Cluster is created and prior to deployment. A system-assigned identity must be granted access to the key vault after cluster creation but before deployment.
227+
228+
- 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.
229+
230+
| Role Name | Role Definition ID |
231+
|:-------------------------------------------------------|:-------------------------------------|
232+
| Operator Nexus Key Vault Writer Service Role (Preview) | 44f0a1a8-6fea-4b35-980a-8ff50c487c97 |
233+
234+
<br/>
235+
Example:
118236

119237
```console
120-
az networkcloud cluster update --secret-archive ?? --help
238+
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>
121239
```
240+
<br/>
241+
242+
If using a user-assigned managed identity, proceed to [add permission to user-assigned identity](#add-a-permission-to-user-assigned-identity)
122243

123244
## Add a permission to User-assigned identity
124245

125-
When using a User-assigned identity, add the following role assignment to the UAI resource:
246+
When using a user-assigned managed identity to access a Key Vault, a customer is required to provision access to that identity for the Nexus platform.
247+
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's a known limitation of the platform that will be addressed in the future.
126248

127-
1. Open the Azure Portal and locate the User-assigned identity in question.
249+
1. Open the Azure portal and locate the User-assigned identity in question.
128250
2. Under **Access control (IAM)**, click **Add role assignment**.
129251
3. Select **Role**: Managed Identity Operator. (See the permissions that the role provides [managed-identity-operator](/azure/role-based-access-control/built-in-roles/identity#managed-identity-operator)).
130252
4. Assign access to: **User, group, or service principal**.

0 commit comments

Comments
 (0)