Skip to content

Commit b00f68f

Browse files
committed
keyvault IP access rules, secure by default
1 parent d174388 commit b00f68f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

{{cookiecutter.__src_folder_name}}/infra/core/security/keyvault.bicep

+9-10
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,26 @@ param tags object = {}
55

66
param principalId string = ''
77

8-
// Allow public network access to Key Vault
9-
param allowPublicNetworkAccess bool = false
8+
@description('List of IP addresses or IP address ranges in CIDR format that are allowed to access the key vault.')
9+
param ipRules array = []
1010

1111
// Allow all Azure services to bypass Key Vault network rules
1212
param allowAzureServicesAccess bool = true
1313

14-
param networkAcls object = {
15-
bypass: allowAzureServicesAccess ? 'AzureServices' : 'None'
16-
defaultAction: allowPublicNetworkAccess ? 'Allow' : 'Deny'
17-
ipRules: []
18-
virtualNetworkRules: []
19-
}
20-
2114
resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
2215
name: name
2316
location: location
2417
tags: tags
2518
properties: {
2619
tenantId: subscription().tenantId
2720
sku: { family: 'A', name: 'standard' }
28-
networkAcls: networkAcls
21+
networkAcls: {
22+
bypass: allowAzureServicesAccess ? 'AzureServices' : 'None'
23+
defaultAction: 'Deny'
24+
ipRules: ipRules
25+
virtualNetworkRules: []
26+
}
27+
enableRbacAuthorization: true
2928
accessPolicies: !empty(principalId) ? [
3029
{
3130
objectId: principalId

0 commit comments

Comments
 (0)