6.3 Ensure no SQL Databases allow ingress 0.0.0.0/0 (ANY IP)

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

Ensure that no SQL Databases allow ingress from 0.0.0.0/0 (ANY IP).

Rationale:

SQL Server includes a firewall to block access to unauthorized connections. More granular IP addresses can be defined by referencing the range of addresses available from specific datacenters.

By default, for a SQL server, a Firewall exists with StartIp of 0.0.0.0 and EndIP of 0.0.0.0 allowing access to all the Azure services.

Additionally, a custom rule can be set up with StartIp of 0.0.0.0 and EndIP of 255.255.255.255 allowing access from ANY IP over the Internet.

In order to reduce the potential attack surface for a SQL server, firewall rules should be defined with more granular IP addresses by referencing the range of addresses available from specific datacenters.

Impact:

Impact: Disabling Allow access to Azure Services will break all connections to SQL server and Hosted Databases unless custom IP specific rules are not added in Firewall Policy.

Solution

From Azure Console

Go to SQL servers

For each SQL server

Click on Firewall / Virtual Networks

Set Allow access to Azure services to 'OFF'

Set firewall rules to limit access to only authorized connections

Using Azure PowerShell
Disable Default Firewall Rule Allow access to Azure services :
Remove-AzureRmSqlServerFirewallRule -FirewallRuleName 'AllowAllWindowsAzureIps' -ResourceGroupName <resource group name> -ServerName <server name>
Remove custom Firewall rule:
Remove-AzureRmSqlServerFirewallRule -FirewallRuleName '<firewallRuleName>' -ResourceGroupName <resource group name> -ServerName <server name>
Set the appropriate firewall rules:

Set-AzureRmSqlServerFirewallRule -ResourceGroupName <resource group name> -ServerName <server name> -FirewallRuleName '<Fw rule Name>' -StartIpAddress '<IP Address other than 0.0.0.0>' -EndIpAddress '<IP Address other than 0.0.0.0 or 255.255.255.255>'

Default Value:

By default, setting Allow access to Azure Services is set to ON allowing access to all Windows Azure IP ranges.

See Also

https://workbench.cisecurity.org/files/3459