generated from mspnp/aks-baseline
-
Notifications
You must be signed in to change notification settings - Fork 92
/
networkWatchersPoliciesDeployment.bicep
32 lines (27 loc) · 1.29 KB
/
networkWatchersPoliciesDeployment.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
targetScope = 'resourceGroup'
/*** EXISTING RESOURCES ***/
@description('Allowed resource types - Policy definition')
resource allowedResourceTypespolicyDefinition 'Microsoft.Authorization/policyDefinitions@2021-06-01' existing = {
name: 'a08ec900-254a-4555-9bf5-e42af04b5c5c'
scope: subscription()
}
/*** RESOURCES ***/
@description('Allowed Resources Policy applied to the network watchers resource group to only allow select networking resources.')
module allowedResourcespolicyAssignment 'resourceGroupPolicyAssignment.bicep' = {
name: 'NetworkWatchers-allowedResourcespolicyAssignment'
scope: resourceGroup()
params: {
builtIn: true
policyDefinitionName: allowedResourceTypespolicyDefinition.name
policyAssignmentDescription: 'List of supported resources for our Network Watcher resource group'
policyAssignmentEnforcementMode: 'DoNotEnforce' // Since this RG may be under existing policy control in your subscription, adding this policy as audit-only.
policyAssignmentParameters: {
listOfResourceTypesAllowed: {
value: [
'Microsoft.Network/networkWatchers'
'Microsoft.Network/networkWatchers/flowLogs'
]
}
}
}
}