01 Run keyvault list command (Windows/macOS/Linux) using custom query filters to list the names of all Key Vault instances created in the current Azure subscription:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
az keyvault list
--query '[*].name'
02 The command output should return the requested Azure Key Vault instance names:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
[
"cc-production-key-vault",
"cc-data-warehouse-vault"
]
03 Run keyvault show command (Windows/macOS/Linux) using the name of the Key Vault instance that you want to examine as identifier parameter and custom query filters to describe the permissions configured for each access policy principal associated with the selected vault:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
az keyvault show
--name "cc-production-key-vault"
--query 'properties.accessPolicies[*].{"PrincipalId":objectId, "permissions":permissions}'
04 The command output should return the permissions configured for each assigned policy principal. Each access policy is represented by a JSON object where the principal is identified by the "PrincipalId" attribute value:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
[
{
"PrincipalId": "abcdabcd-1234-abcd-1234-abcd1234abcd",
"permissions": {
"certificates": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore",
"ManageContacts",
"ManageIssuers",
"GetIssuers",
"ListIssuers",
"SetIssuers",
"DeleteIssuers",
"Purge"
],
"keys": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore",
"Decrypt",
"Encrypt",
"UnwrapKey",
"WrapKey",
"Verify",
"Sign",
"Purge"
],
"secrets": [
"Get",
"List",
"Set",
"Delete",
"Recover",
"Backup",
"Restore",
"Purge"
],
"storage": null
}
},
{
"PrincipalId": "abcd1234-abcd-1234-abcd-abcd1234abcd",
"permissions": {
"certificates": [
"List"
],
"keys": [
"List"
],
"secrets": [
"List"
],
"storage": null
}
}
]
05 The complete list of key, secret and certificate permissions that an access policy principal can have over a Microsoft Azure Key Vault:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
"permissions": {
"certificates": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore",
"ManageContacts",
"ManageIssuers",
"GetIssuers",
"ListIssuers",
"SetIssuers",
"DeleteIssuers",
"Purge"
],
"keys": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore",
"Decrypt",
"Encrypt",
"UnwrapKey",
"WrapKey",
"Verify",
"Sign",
"Purge"
],
"secrets": [
"Get",
"List",
"Set",
"Delete",
"Recover",
"Backup",
"Restore",
"Purge"
]
}
06 Compare the complete list of permissions that can be configured for an access policy principal described at step no. 5 with the "permissions" list returned by the keyvault show command output at step no. 4. If a policy principal (identified by "PrincipalId") is configured to use all the key, secret and certificate permissions listed at step no. 5, the user, group or application represented by the verified principal has full permissions to access and manage the selected Azure Key Vault.
07 Repeat steps no. 3 – 6 for each Microsoft Azure Key Vault available in the current subscription.
08 Repeat steps no. 1 – 7 for each subscription created in your Microsoft Azure cloud account.