Description
A firewall rule with start_ip_address set to 0.0.0.0 and end_ip_address set to 255.255.255.255 covers every IPv4 address. It lets any IPv4 client attempt a connection when the Azure SQL logical server’s public endpoint is enabled. The rule alone cannot enable a disabled endpoint.
Setting both addresses to 0.0.0.0 has a different effect. It creates an Azure services exception that can include other customers’ Azure resources.
Potential impact
A full-range rule removes the IP restriction on connection attempts. Reading or changing data still requires database authentication and permissions. Leaked credentials or excessive permissions can be misused from more locations.
Remediation
- Replace the full range with the source addresses your applications and management tools use. For a public endpoint, use the addresses Azure sees, which may be public addresses.
- For private access only, configure the required private connection before disabling public network access.
- Review server-level and database-level rules, including any Azure services exception. After the change, test required connections and check database permissions.
Examples
These excerpts change only the address range. The server’s public access, private endpoints and authentication are configured separately.
Entire IPv4 range
- name: Create Firewall Rule
azure.azcollection.azure_rm_sqlfirewallrule:
resource_group: myResourceGroup
server_name: firewallrulecrudtest-6285
name: firewallrulecrudtest-5370
start_ip_address: 0.0.0.0
end_ip_address: 255.255.255.255
Narrow private IPv4 range
- name: Create Firewall Rule
azure.azcollection.azure_rm_sqlfirewallrule:
resource_group: myResourceGroup
server_name: firewallrulecrudtest-6285
name: firewallrulecrudtest-5370
start_ip_address: 172.28.10.136
end_ip_address: 172.28.10.138
The second rule lists three private addresses, 172.28.10.136 through 172.28.10.138. Check that Azure actually sees those source addresses. Entering a private range does not create a private connection.