Skip to content

'az keyvault role assignment' does not check for valid OIDs #25990

@sfusinaz

Description

@sfusinaz

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

The below command should validate the --assignee parameter before creating the role assignment.

Related command

az keyvault role assignment create --hsm-name "YourMHSM" --role 'Managed HSM Crypto User' --assignee 'application_object_id' --scope /keys/keyname

Describe the bug

In the above, we can specify any Application ID as assignee and the command will execute. This triggers an error when accessing the key's RBAC assignments in the portal. The portal bug is currently being investigated.

To Reproduce

  1. Create a MHSM and a key.
  2. In az cli, assign a role on the key (with scope /keys/keyname), and pick an application id instead.
  3. In the portal, opening the above key RBAC details will trigger an error preventing the user from managing the key's RBAC.

Expected behavior

The command should not create a role assignment if given an invalid OID.
Following the docs, Application IDs should not be allowed: Managed HSM role management

"To allow a security principal (such as a user, a service principal, group or a managed identity) to perform managed HSM data plane operations, they must be assigned a role that permits performing those operations."

Additional context

msedge_XOpNhXAr5h

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamKeyVaultaz keyvaultService AttentionThis issue is responsible by Azure service team.act-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions