Description
An enabled Azure SQL server alert policy can still exclude threat indicators listed in disabled_alerts.
Potential impact
Excluding SQL injection or data-exfiltration alerts can delay investigation of suspicious database activity.
Remediation
Enable the policy, review each exclusion and keep only documented exceptions. Check Defender for SQL coverage and verify that an alert reaches the responsible team.
Examples
The second example removes both exclusions and enables administrator email. Supply a securely managed SQL administrator password in place of the sample value.
Before
hcl
resource "azurerm_mssql_server" "example" {
name = "my-mssql-server"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
version = "12.0"
administrator_login = "sqladmin"
administrator_login_password = "SuperSecurePassword123!"
}
resource "azurerm_mssql_server_security_alert_policy" "example" {
resource_group_name = azurerm_resource_group.example.name
server_name = azurerm_mssql_server.example.name
state = "Enabled"
storage_endpoint = azurerm_storage_account.example.primary_blob_endpoint
storage_account_access_key = azurerm_storage_account.example.primary_access_key
disabled_alerts = [
"Sql_Injection",
"Data_Exfiltration"
]
retention_days = 20
}
After
hcl
resource "azurerm_mssql_server" "example" {
name = "my-mssql-server"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
version = "12.0"
administrator_login = "sqladmin"
administrator_login_password = "SuperSecurePassword123!"
}
resource "azurerm_mssql_server_security_alert_policy" "example" {
resource_group_name = azurerm_resource_group.example.name
server_name = azurerm_mssql_server.example.name
state = "Enabled"
storage_endpoint = azurerm_storage_account.example.primary_blob_endpoint
storage_account_access_key = azurerm_storage_account.example.primary_access_key
retention_days = 20
email_account_admins_enabled = true
}