Gallery › Mission › Azure built-in policies
Control the use of Virtual Network Guardrails for Cloud in Mission Platforms
Converted Initiative Version 1.0.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This policy set deploys the required policy guardrails governing the use of Azure Virtual Networks within the Environment. See the list of policies of the services that are included.
ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.
Azure Policy JSONVNETInitiative.json · 116 lines
{
"properties": {
"displayName": "Control the use of Virtual Network Guardrails for Cloud in Mission Platforms",
"policyType": "BuiltIn",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This policy set deploys the required policy guardrails governing the use of Azure Virtual Networks within the Environment. See the list of policies of the services that are included.",
"metadata": {
"version": "1.0.0",
"category": "Mission"
},
"version": "1.0.0",
"parameters": {
"svcEndpoints_allowedServiceTypes": {
"type": "Array",
"metadata": {
"displayName": "Allowed Service end points service types",
"description": "Enable or disable allowed service endpoint service types"
},
"defaultValue": []
},
"svcEndpoints_subnetDelegationsToExclude": {
"type": "Array",
"metadata": {
"displayName": "Allowed Service end points excluded subnet delegation effect",
"description": "Enable or disable allowed service endpoint subnet delegation exclusion"
},
"defaultValue": []
},
"svcDelegations_allowedServiceNames": {
"type": "Array",
"metadata": {
"displayName": "Allowed Service delegation service names effect",
"description": "Enable or disable allowed Service delegation service names"
},
"defaultValue": [
"Microsoft.Web/serverfarms",
"Microsoft.DBforPostgreSQL/flexibleServers",
"Microsoft.ContainerService/managedClusters",
"Microsoft.Web/hostingEnvironments",
"Microsoft.ContainerInstance/containerGroups",
"Microsoft.ApiManagement/service"
]
},
"allowedVnetPeers": {
"type": "Array",
"metadata": {
"displayName": "Allowed vnet peers List effect",
"description": "Enable or disable allowed listed vnet peers"
},
"defaultValue": []
},
"exemptPeExternalSubIds": {
"type": "Array",
"defaultValue": [],
"metadata": {
"displayName": "Exempt PE External Subscription IDs",
"description": "List of subscription IDs exempt from private endpoint external restrictions"
}
}
},
"policyDefinitions": [
{
"policyDefinitionReferenceId": "VNETAllowedServiceEndPoints",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/918dcd3f-28e6-4fa5-8373-44919b46c98e",
"definitionVersion": "1.*.*",
"parameters": {
"allowedServiceTypes": {
"value": "[parameters('svcEndpoints_allowedServiceTypes')]"
},
"subnetDelegationsToExclude": {
"value": "[parameters('svcEndpoints_subnetDelegationsToExclude')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7ecf8dcc-8f39-4225-9ff8-06a8e75d778b",
"policyDefinitionReferenceId": "VNETAllowedServiceDelegation",
"definitionVersion": "1.*.*",
"parameters": {
"allowedServiceNames": {
"value": "[parameters('svcDelegations_allowedServiceNames')]"
}
}
},
{
"policyDefinitionReferenceId": "VNETAllowedPeers",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9de54b0f-202f-41c3-8c4f-c27a89bc3b57",
"definitionVersion": "1.*.*",
"parameters": {
"allowedVnetPeers": {
"value": "[parameters('allowedVnetPeers')]"
}
}
},
{
"policyDefinitionReferenceId": "VNETRequirePrivateSubnet",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a6d35950-ad6c-46f8-994d-0d236eae0699",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionReferenceId": "VNETRestrictInternalPe",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/ee59ea13-92cf-4d3f-acf4-009bf9702aab",
"definitionVersion": "1.*.*",
"parameters": {
"exemptPeExternalSubIds": {
"value": "[parameters('exemptPeExternalSubIds')]"
}
}
}
],
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policySetDefinitions/b8df66eb-3653-44cf-b445-d5b38cc73d20",
"name": "b8df66eb-3653-44cf-b445-d5b38cc73d20"
}Bylawb8df66eb-3653-44cf-b445-d5b38cc73d20.bylaw.ps1 · 81 lines
# Converted from VNETInitiative.json by ConvertTo-Bylaw.
Initiative 'b8df66eb-3653-44cf-b445-d5b38cc73d20' {
Properties @{
DisplayName = 'Control the use of Virtual Network Guardrails for Cloud in Mission Platforms'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This policy set deploys the required policy guardrails governing the use of Azure Virtual Networks within the Environment. See the list of policies of the services that are included.'
Version = '1.0.0'
Category = 'Mission'
PolicyVersion = '1.0.0'
}
Parameter SvcEndpoints_allowedServiceTypes @{
Type = 'Array'
Default = @()
DisplayName = 'Allowed Service end points service types'
Description = 'Enable or disable allowed service endpoint service types'
}
Parameter SvcEndpoints_subnetDelegationsToExclude @{
Type = 'Array'
Default = @()
DisplayName = 'Allowed Service end points excluded subnet delegation effect'
Description = 'Enable or disable allowed service endpoint subnet delegation exclusion'
}
Parameter SvcDelegations_allowedServiceNames @{
Type = 'Array'
Default = @('Microsoft.Web/serverfarms', 'Microsoft.DBforPostgreSQL/flexibleServers', 'Microsoft.ContainerService/managedClusters', 'Microsoft.Web/hostingEnvironments', 'Microsoft.ContainerInstance/containerGroups', 'Microsoft.ApiManagement/service')
DisplayName = 'Allowed Service delegation service names effect'
Description = 'Enable or disable allowed Service delegation service names'
}
Parameter AllowedVnetPeers @{
Type = 'Array'
Default = @()
DisplayName = 'Allowed vnet peers List effect'
Description = 'Enable or disable allowed listed vnet peers'
}
Parameter ExemptPeExternalSubIds @{
Type = 'Array'
Default = @()
DisplayName = 'Exempt PE External Subscription IDs'
Description = 'List of subscription IDs exempt from private endpoint external restrictions'
}
PolicyDefinition @{
Id = '918dcd3f-28e6-4fa5-8373-44919b46c98e'
ReferenceId = 'VNETAllowedServiceEndPoints'
Version = '1.*.*'
Parameters = [ordered]@{
allowedServiceTypes = (Param SvcEndpoints_allowedServiceTypes)
subnetDelegationsToExclude = (Param SvcEndpoints_subnetDelegationsToExclude)
}
}
PolicyDefinition @{
Id = '7ecf8dcc-8f39-4225-9ff8-06a8e75d778b'
ReferenceId = 'VNETAllowedServiceDelegation'
Version = '1.*.*'
Parameters = @{
allowedServiceNames = (Param SvcDelegations_allowedServiceNames)
}
}
PolicyDefinition @{
Id = '9de54b0f-202f-41c3-8c4f-c27a89bc3b57'
ReferenceId = 'VNETAllowedPeers'
Version = '1.*.*'
Parameters = @{
allowedVnetPeers = (Param AllowedVnetPeers)
}
}
PolicyDefinition -Id 'a6d35950-ad6c-46f8-994d-0d236eae0699' -ReferenceId 'VNETRequirePrivateSubnet' -Version '1.*.*'
PolicyDefinition @{
Id = 'ee59ea13-92cf-4d3f-acf4-009bf9702aab'
ReferenceId = 'VNETRestrictInternalPe'
Version = '1.*.*'
Parameters = @{
exemptPeExternalSubIds = (Param ExemptPeExternalSubIds)
}
}
}Members (5)
- Virtual Network should specify allowed service endpoints
- Virtual Network should Specify the allowed service delegations for subnets
- Virtual Network should Specify allowed Vnet Peers
- Virtual Network should Ensure subnets are secure by default by preventing default outbound access
- Virtual Network should Deny private endpoints linked to services in other tenants
Source: built-in-policies/policySetDefinitions/Mission/VNETInitiative.json in Azure/azure-policy, under the MIT licence.
Bylaw