Ensure that the firewall associated with your Microsoft Azure SQL servers is not configured to allow unrestricted inbound access (i.e., 0.0.0.0) in order to protect against unauthorized connections. By default, a Microsoft SQL server firewall contains a Start IP of 0.0.0.0 and an End IP of 0.0.0.0, allowing access to all Microsoft Azure services. Additionally, a custom rule can be set up with Start IP of 0.0.0.0 and End IP of 255.255.255.255 to allow access from any IP address over the Internet. To reduce the potential attack surface for your Azure SQL servers, firewall rules should be configured with granular IPs by referencing the range of IP addresses available from specific, authorized networks.
This rule resolution is part of the Conformity Security & Compliance tool for Azure.
Allowing unrestricted SQL database access can increase opportunities for malicious activities such as hacking and loss of data.
Enabling Allow Azure services and resources to access this server feature for SQL servers in the Azure Portal automatically creates a firewall rule with the source 0.0.0.0, which, while not exposing the server directly to the public Internet, permits access from a wide range of Microsoft-managed services and resources across different Azure tenants. Although this configuration may appear similar to public access, it does not grant access to the public Internet and differs in both scope and security risk profile.
Audit
To determine if the firewall configured for your Microsoft Azure SQL server allows unrestricted SQL access, perform the following operations:
Remediation / Resolution
To update your Microsoft SQL server firewall configuration in order to limit access to authorized networks and connections only, perform the following operations:
References
- Azure Official Documentation
- Azure SQL Database and Azure Synapse Analytics network access controls
- Use virtual network service endpoints and rules for servers in Azure SQL Database
- Azure PowerShell Documentation
- Get-AzSqlServer
- Get-AzSqlServerFirewallRule
- Remove-AzSqlServerFirewallRule
- Set-AzSqlServerFirewallRule