Description:
Azure SQL Server Firewall Rules determine which IP addresses or networks are allowed to access SQL databases. Creating or updating these rules can expand access to new networks, expose workloads to the internet, or permit unauthorized inbound connections. Configuring an Activity Log Alert for Create or Update operations on SQL Server Firewall Rules ensures visibility into access control changes and enables timely investigation by security teams.
Rationale:
This rule verifies whether an Activity Log Alert is configured to detect Create or Update SQL Server Firewall Rule operations using the event Microsoft.Sql/servers/firewallRules/write. If no alert exists, the environment is marked NON_COMPLIANT. Monitoring changes to SQL Firewall Rules is critical because unauthorized or accidental modifications can expose sensitive databases to untrusted networks and increase the risk of exploitation.
Impact:
Ensures real-time detection of suspicious or unauthorized SQL firewall changes.
Improves compliance with auditing requirements for access control.
Helps incident responders investigate network access-related anomalies.
Reduces the risk of accidental exposure of SQL databases to untrusted networks.
Default Value:
Azure does not automatically configure Activity Log Alerts for SQL firewall rule write operations. Administrators must manually create monitoring alerts in Azure Monitor.
Pre-Requisites:
PermissionManagerRulesMicrosoft.Insights/activityLogAlerts/write,
Microsoft.Sql/servers/firewallRules/read, Microsoft.Resources/subscriptions/resourceGroups/read
Existing Action Group (email, SMS, webhook, Teams, etc.)
Test Plan:
Sign in to the Azure Portal at https://portal.azure.com
Navigate to Monitor
Select Alerts and Open Alert rules
Verify an Activity Log Alert exists for Create or Update SQL Server Firewall Rule
Verify the alert scope includes the required subscription
Verify that an Action Group is associated
If the alert does not exist, follow the implementation steps
Implementation Steps:
Sign in to the Azure Portal at https://portal.azure.com
Navigate to Monitor
Select Alerts
Click Create and select Alert rule
Set the Scope to the required subscription
Under Condition, click See all signals, search for Create or Update SQL Server Firewall Rule, and select the signal.
Associate an existing Action Group or create a new one
Provide an alert rule name and resource group
Click Review + Create
Click Create
Backout Plan:
Sign in to the Azure Portal at https://portal.azure.com
Navigate to Monitor
Select Alerts
Open Alert rules
Locate the Create or Update SQL Server Firewall Rule alert
Delete the alert rule
Confirm the deletion
Reference:
- https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-types
- https://learn.microsoft.com/azure/defender-for-cloud/concept-security-solutions
- https://learn.microsoft.com/azure/security-benchmark/azure-security-benchmark-monitoring-logging
- https://learn.microsoft.com/azure/governance/policy/samples/cis-azure-1-3-0


