Edit

Simulate alerts for SQL servers on machines

Microsoft Defender for Cloud provides a SQL alert simulation feature that helps organizations and security teams validate deployments and test detection, response, and automation workflows without creating actual security risks.

The simulation uses a custom script extension named Sql-SimulateAlert to inject telemetry records on target machines. Target machines include Azure Virtual Machines (VMs) or Arc-connected machines. Each simulated alert includes runtime context such as host, SQL instance, database, and process information. You can use these alerts to validate your end-to-end security response flows. This process is safe and doesn't affect your resources.

You can simulate the following security scenarios:

  • Brute force authentication
  • Authentication from suspicious application
  • SQL injection
  • Principal anomaly
  • Shell external source anomaly
  • Shell obfuscation

The simulation runs locally on the machine through the Custom Script Extension without executing external malicious payloads. All generated alerts contain complete machine and resource identifiers, SQL instance names, database information, process details, and telemetry data required by playbooks and security automation workflows.

Prerequisites

Simulate alerts

The SqlAlertSimulationClient reads details from the target resource, such as subscription, resource group, machine name, and location.

It then builds an Azure Resource Manager (ARM) template that deploys a custom script extension on the machine. The extension runs a PowerShell command that starts the Defender for SQL simulate helper with the chosen attack settings. The helper creates alert data and sends it to Defender for Cloud. These alerts can then trigger your automation and response connectors.

  1. Sign in to the Azure portal.

  2. Search for and select Azure SQL.

  3. Select SQL Server on Azure VMS or SQL Server instances (Azure Arc).

    Screenshot that shows how to navigate to your SQL virtual machine.

  4. Select the relevant database.

  5. Select Security > Microsoft Defender for Cloud.

  6. Select the Security Alerts tab, and then select Simulate Alerts.

    Screenshot of the Microsoft Defender for SQL page with the Security Alerts tab and Simulate Alerts button highlighted.

  7. Select an alert type.

    Screenshot that shows the different types of alerts that can be selected.

  8. Enter the required information for the selected alert type. For example, username and password for authentication attacks.

  9. Select Simulate Alerts.

The alert appears after a few minutes. You can use the alert to validate your security monitoring setup.

Verify that the alert is generated

After you simulate an alert, verify that the alert is generated.

  1. In the Azure portal, search for and select Azure SQL.

  2. Select SQL Server on Azure VMS or SQL Server instances (Azure Arc).

  3. Select the relevant database.

  4. Select Security > Microsoft Defender for Cloud.

  5. Select the Security Alerts tab.

  6. Select Check for alerts on this resource in Microsoft Defender for Cloud.

    Screenshot of the Microsoft Defender for SQL page with the Security Alerts tab and the link to check the resource's alerts in Defender for Cloud highlighted.

Verify that the simulated alert appears in the list of alerts for the resource and manage and respond to the security alert.

Next step