Gallery › Security Center › Azure built-in policies
[Deprecated]: [Deprecated]: Audit Web Applications that are not using custom domains
Converted Policy AuditIfNotExists Disabled Mode All Version 1.0.0-deprecated Deprecated
Use of custom domains protects a web application from common attacks such as phishing and other DNS-related attacks.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_UsedCustomDomains_WebApp_Audit_Deprecated.json · 77 lines
{
"properties": {
"displayName": "[Deprecated]: [Deprecated]: Audit Web Applications that are not using custom domains",
"policyType": "BuiltIn",
"mode": "All",
"description": "Use of custom domains protects a web application from common attacks such as phishing and other DNS-related attacks.",
"metadata": {
"version": "1.0.0-deprecated",
"category": "Security Center",
"deprecated": true
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allof": [
{
"field": "type",
"equals": "microsoft.Web/sites"
},
{
"anyof": [
{
"field": "kind",
"equals": "app"
},
{
"field": "kind",
"equals": "WebApp"
},
{
"field": "kind",
"equals": "app,linux"
},
{
"field": "kind",
"equals": "app,linux,container"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Security/complianceResults",
"name": "UsedCustomDomains",
"existenceCondition": {
"field": "Microsoft.Security/complianceResults/resourceStatus",
"in": [
"OffByPolicy",
"Healthy"
]
}
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/dd2ea520-6b06-45c3-806e-ea297c23e06a",
"name": "dd2ea520-6b06-45c3-806e-ea297c23e06a"
}Bylawdd2ea520-6b06-45c3-806e-ea297c23e06a.bylaw.ps1 · 46 lines
# Converted from ASC_UsedCustomDomains_WebApp_Audit_Deprecated.json by ConvertTo-Bylaw.
Policy 'dd2ea520-6b06-45c3-806e-ea297c23e06a' {
Properties @{
DisplayName = '[Deprecated]: [Deprecated]: Audit Web Applications that are not using custom domains'
Description = 'Use of custom domains protects a web application from common attacks such as phishing and other DNS-related attacks.'
Version = '1.0.0-deprecated'
Category = 'Security Center'
Deprecated = $true
PolicyVersion = '1.0.0'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'microsoft.Web/sites' {
Require 'kind is not app' {
Field kind | Must -Not -Be 'app' -IfPresent
}
Require 'kind is not WebApp' {
Field kind | Must -Not -Be 'WebApp' -IfPresent
}
Require 'kind is not app,linux' {
Field kind | Must -Not -Be 'app,linux' -IfPresent
}
Require 'kind is not app,linux,container' {
Field kind | Must -Not -Be 'app,linux,container' -IfPresent
}
}
AuditIfNotExists 'Microsoft.Security/complianceResults' -Name 'UsedCustomDomains' -Effect (Param Effect) {
Require 'resourceStatus is one of 2 values' {
Field resourceStatus | Must -BeIn @('OffByPolicy', 'Healthy')
}
}
}Source: built-in-policies/policyDefinitions/Security Center/ASC_UsedCustomDomains_WebApp_Audit_Deprecated.json in Azure/azure-policy, under the MIT licence.
Bylaw