Gallery › App Service › Azure built-in policies
[Deprecated]: Remote debugging should be turned off for API Apps
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.0-deprecated Deprecated
Remote debugging requires inbound ports to be opened on API apps. Remote debugging should be turned off. We recommend all customers who are still using API Apps to implement the built-in policy called 'App Service apps should have remote debugging turned off', which is scoped to include API apps in addition to Web Apps.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDisableRemoteDebugging_ApiApp_Audit.json · 58 lines
{
"properties": {
"displayName": "[Deprecated]: Remote debugging should be turned off for API Apps",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Remote debugging requires inbound ports to be opened on API apps. Remote debugging should be turned off. We recommend all customers who are still using API Apps to implement the built-in policy called 'App Service apps should have remote debugging turned off', which is scoped to include API apps in addition to Web Apps.",
"metadata": {
"version": "1.0.0-deprecated",
"category": "App Service",
"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"
},
{
"field": "kind",
"like": "*api"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Web/sites/config",
"name": "web",
"existenceCondition": {
"field": "Microsoft.Web/sites/config/remoteDebuggingEnabled",
"equals": "false"
}
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/e9c8d085-d9cc-4b17-9cdc-059f1f01f19e",
"name": "e9c8d085-d9cc-4b17-9cdc-059f1f01f19e"
}Bylawe9c8d085-d9cc-4b17-9cdc-059f1f01f19e.bylaw.ps1 · 34 lines
# Converted from DisableRemoteDebugging_ApiApp_Audit.json by ConvertTo-Bylaw.
Policy 'e9c8d085-d9cc-4b17-9cdc-059f1f01f19e' {
Properties @{
DisplayName = '[Deprecated]: Remote debugging should be turned off for API Apps'
Description = 'Remote debugging requires inbound ports to be opened on API apps. Remote debugging should be turned off. We recommend all customers who are still using API Apps to implement the built-in policy called ''App Service apps should have remote debugging turned off'', which is scoped to include API apps in addition to Web Apps.'
Version = '1.0.0-deprecated'
Category = 'App Service'
Deprecated = $true
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
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 like *api' {
Field kind | Must -Not -BeLike '*api' -IfPresent
}
}
AuditIfNotExists 'Microsoft.Web/sites/config' -Name 'web' -Effect (Param Effect) {
Require 'remoteDebuggingEnabled is false' {
Field remoteDebuggingEnabled | Must -Be 'false'
}
}
}Source: built-in-policies/policyDefinitions/App Service/DisableRemoteDebugging_ApiApp_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw