Gallery › SQL › Azure built-in policies
[Deprecated]: Advanced Threat Protection types should be set to 'All' in SQL Managed Instance advanced data security settings
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.1-deprecated Deprecated
It's recommended to enable all Advanced Threat Protection types on your SQL Managed Instance. Enabling all types protects against SQL injection, database vulnerabilities, and any other anomalous activities.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONSqlManagedInstance_EnsureThreatDetectionTypes_Audit.json · 50 lines
{
"properties": {
"displayName": "[Deprecated]: Advanced Threat Protection types should be set to 'All' in SQL Managed Instance advanced data security settings",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "It's recommended to enable all Advanced Threat Protection types on your SQL Managed Instance. Enabling all types protects against SQL injection, database vulnerabilities, and any other anomalous activities.",
"metadata": {
"version": "1.0.1-deprecated",
"category": "SQL",
"deprecated": true
},
"version": "1.0.1",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Disabled",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Sql/managedInstances"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Sql/managedInstances/securityAlertPolicies",
"name": "default",
"existenceCondition": {
"field": "Microsoft.Sql/managedInstances/securityAlertPolicies/disabledAlerts[*]",
"equals": ""
}
}
}
},
"versions": [
"1.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/bda18df3-5e41-4709-add9-2554ce68c966",
"name": "bda18df3-5e41-4709-add9-2554ce68c966"
}Bylawbda18df3-5e41-4709-add9-2554ce68c966.bylaw.ps1 · 32 lines
# Converted from SqlManagedInstance_EnsureThreatDetectionTypes_Audit.json by ConvertTo-Bylaw.
Policy 'bda18df3-5e41-4709-add9-2554ce68c966' {
Properties @{
DisplayName = '[Deprecated]: Advanced Threat Protection types should be set to ''All'' in SQL Managed Instance advanced data security settings'
Description = 'It''s recommended to enable all Advanced Threat Protection types on your SQL Managed Instance. Enabling all types protects against SQL injection, database vulnerabilities, and any other anomalous activities.'
Version = '1.0.1-deprecated'
Category = 'SQL'
Deprecated = $true
PolicyVersion = '1.0.1'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'Disabled'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Sql/managedInstances'
AuditIfNotExists 'Microsoft.Sql/managedInstances/securityAlertPolicies' -Name 'default' -Effect (Param Effect) {
Require 'disabledAlerts is as required' {
Field disabledAlerts | Must -Exist
Each 'disabledAlerts[*]' {
Element | Must -Be ''
}
}
}
}Source: built-in-policies/policyDefinitions/SQL/SqlManagedInstance_EnsureThreatDetectionTypes_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw