|
1 | 1 | ---
|
2 |
| -reviewed: 2023-02-18 |
| 2 | +reviewed: 2024-06-17 |
3 | 3 | severity: Important
|
4 | 4 | pillar: Security
|
5 |
| -category: Identity and access management |
| 5 | +category: SE:05 Identity and access management |
6 | 6 | resource: Key Vault
|
7 | 7 | online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.KeyVault.AccessPolicy/
|
8 | 8 | ---
|
@@ -32,15 +32,17 @@ Consider assigning access to Key Vault data based on the principle of least priv
|
32 | 32 |
|
33 | 33 | To deploy Key Vaults that pass this rule:
|
34 | 34 |
|
35 |
| -- Avoid assigning `purge` and `all` permissions for Key Vault objects. |
36 |
| - Use specific permissions such as `get` and `set`. |
| 35 | +- Use Azure RBAC as the authorization system instead. _OR_ |
| 36 | +- Configure the access policies by setting `properties.accessPolicies`: |
| 37 | + - Avoid assigning `purge` and `all` permissions for Key Vault objects. |
| 38 | + Use specific permissions such as `get` and `set`. |
37 | 39 |
|
38 | 40 | For example:
|
39 | 41 |
|
40 | 42 | ```json
|
41 | 43 | {
|
42 | 44 | "type": "Microsoft.KeyVault/vaults",
|
43 |
| - "apiVersion": "2022-07-01", |
| 45 | + "apiVersion": "2023-07-01", |
44 | 46 | "name": "[parameters('name')]",
|
45 | 47 | "location": "[parameters('location')]",
|
46 | 48 | "properties": {
|
@@ -73,13 +75,15 @@ For example:
|
73 | 75 |
|
74 | 76 | To deploy Key Vaults that pass this rule:
|
75 | 77 |
|
76 |
| -- Avoid assigning `purge` and `all` permissions for Key Vault objects. |
77 |
| - Use specific permissions such as `get` and `set`. |
| 78 | +- Use Azure RBAC as the authorization system instead. _OR_ |
| 79 | +- Configure the access policies by setting `properties.accessPolicies`: |
| 80 | + - Avoid assigning `purge` and `all` permissions for Key Vault objects. |
| 81 | + Use specific permissions such as `get` and `set`. |
78 | 82 |
|
79 | 83 | For example:
|
80 | 84 |
|
81 | 85 | ```bicep
|
82 |
| -resource vault 'Microsoft.KeyVault/vaults@2022-07-01' = { |
| 86 | +resource vault 'Microsoft.KeyVault/vaults@2023-07-01' = { |
83 | 87 | name: name
|
84 | 88 | location: location
|
85 | 89 | properties: {
|
@@ -108,8 +112,13 @@ resource vault 'Microsoft.KeyVault/vaults@2022-07-01' = {
|
108 | 112 | }
|
109 | 113 | ```
|
110 | 114 |
|
| 115 | +<!-- external:avm avm/res/key-vault/vault accessPolicies --> |
| 116 | + |
111 | 117 | ## LINKS
|
112 | 118 |
|
113 |
| -- [Automate and use least privilege](https://learn.microsoft.com/azure/architecture/framework/security/security-principles#automate-and-use-least-privilege) |
| 119 | +- [SE:05 Identity and access management](https://learn.microsoft.com/azure/well-architected/security/identity-access) |
| 120 | +- [Provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control](https://learn.microsoft.com/azure/key-vault/general/rbac-guide) |
| 121 | +- [Azure role-based access control vs. access policies](https://learn.microsoft.com/azure/key-vault/general/rbac-access-policy) |
| 122 | +- [Migrate from vault access policy to an Azure role-based access control permission model](https://learn.microsoft.com/azure/key-vault/general/rbac-migration) |
114 | 123 | - [Best practices to use Key Vault](https://learn.microsoft.com/azure/key-vault/general/best-practices)
|
115 | 124 | - [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.keyvault/vaults)
|
0 commit comments