Skip to content

Commit 817d8b9

Browse files
Merge pull request #273728 from schaffererin/userstory248782
Updated role assignment commands
2 parents 45fb554 + 6bbaeea commit 817d8b9

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

articles/aks/csi-secrets-store-identity-access.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,21 @@ In this security model, the AKS cluster acts as token issuer. Microsoft Entra ID
6060
6161
3. Create a role assignment that grants the workload identity permission to access the key vault secrets, access keys, and certificates using the [`az role assignment create`][az-role-assignment-create] command.
6262
63+
> [!IMPORTANT]
64+
>
65+
> * If your key vault is set with `--enable-rbac-authorization` and you're using `key` or `certificate` type, assign the [`Key Vault Certificate User`](../key-vault/general/rbac-guide.md#azure-built-in-roles-for-key-vault-data-plane-operations) role to give permissions.
66+
> * If your key vault is set with `--enable-rbac-authorization` and you're using `secret` type, assign the [`Key Vault Secrets User`](../key-vault/general/rbac-guide.md#azure-built-in-roles-for-key-vault-data-plane-operations) role.
67+
> * If your key vault isn't set with `--enable-rbac-authorization`, you can use the [`az keyvault set-policy`][az-keyvault-set-policy] command with the `--key-permissions get`, `--certificate-permissions get`, or `--secret-permissions get` parameter to create a key vault policy to grant access for keys, certificates, or secrets. For example:
68+
>
69+
> ```azurecli-interactive
70+
> az keyvault set-policy --name $KEYVAULT_NAME --key-permissions get --object-id $IDENTITY_OBJECT_ID
71+
> ```
72+
6373
```azurecli-interactive
6474
export KEYVAULT_SCOPE=$(az keyvault show --name $KEYVAULT_NAME --query id -o tsv)
6575
66-
az role assignment create --role "Key Vault Administrator" --assignee $USER_ASSIGNED_CLIENT_ID --scope $KEYVAULT_SCOPE
76+
# Example command for key vault with RBAC enabled using `key` type
77+
az role assignment create --role "Key Vault Certificate User" --assignee $USER_ASSIGNED_CLIENT_ID --scope $KEYVAULT_SCOPE
6778
```
6879
6980
4. Get the AKS cluster OIDC Issuer URL using the [`az aks show`][az-aks-show] command.
@@ -197,13 +208,24 @@ In this security model, you can grant access to your cluster's resources to team
197208
az identity show -g <resource-group> --name <identity-name> --query 'clientId' -o tsv
198209
```
199210
200-
2. Create a role assignment that grants the identity permission access to the key vault secrets, access keys, and certificates using the [`az role assignment create`][az-role-assignment-create] command.
211+
2. Create a role assignment that grants the identity permission to access the key vault secrets, access keys, and certificates using the [`az role assignment create`][az-role-assignment-create] command.
212+
213+
> [!IMPORTANT]
214+
>
215+
> * If your key vault is set with `--enable-rbac-authorization` and you're using `key` or `certificate` type, assign the [`Key Vault Certificate User`](../key-vault/general/rbac-guide.md#azure-built-in-roles-for-key-vault-data-plane-operations) role.
216+
> * If your key vault is set with `--enable-rbac-authorization` and you're using `secret` type, assign the [`Key Vault Secrets User`](../key-vault/general/rbac-guide.md#azure-built-in-roles-for-key-vault-data-plane-operations) role.
217+
> * If your key vault isn't set with `--enable-rbac-authorization`, you can use the [`az keyvault set-policy`][az-keyvault-set-policy] command with the `--key-permissions get`, `--certificate-permissions get`, or `--secret-permissions get` parameter to create a key vault policy to grant access for keys, certificates, or secrets. For example:
218+
>
219+
> ```azurecli-interactive
220+
> az keyvault set-policy --name $KEYVAULT_NAME --key-permissions get --object-id $IDENTITY_OBJECT_ID
221+
> ```
201222
202223
```azurecli-interactive
203224
export IDENTITY_OBJECT_ID="$(az identity show -g <resource-group> --name <identity-name> --query 'principalId' -o tsv)"
204225
export KEYVAULT_SCOPE=$(az keyvault show --name <key-vault-name> --query id -o tsv)
205226
206-
az role assignment create --role "Key Vault Administrator" --assignee $IDENTITY_OBJECT_ID --scope $KEYVAULT_SCOPE
227+
# Example command for key vault with RBAC enabled using `key` type
228+
az role assignment create --role "Key Vault Certificate User" --assignee $USER_ASSIGNED_CLIENT_ID --scope $KEYVAULT_SCOPE
207229
```
208230
209231
3. Create a `SecretProviderClass` using the following YAML. Make sure to use your own values for `userAssignedIdentityID`, `keyvaultName`, `tenantId`, and the objects to retrieve from your key vault.
@@ -341,4 +363,4 @@ In this article, you learned how to create and provide an identity to access you
341363
[az-identity-create]: /cli/azure/identity#az-identity-create
342364
[az-role-assignment-create]: /cli/azure/role/assignment#az-role-assignment-create
343365
[az-aks-disable-addons]: /cli/azure/aks#az-aks-disable-addons
344-
366+
[az-keyvault-set-policy]: /cli/azure/keyvault#az-keyvault-set-policy

0 commit comments

Comments
 (0)