For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-azure-sql-server-ingress-from-any-ip.md.
A documentation index is available at /llms.txt.
Allowing an Azure SQL firewall rule to accept connections from the entire internet (start_ip_address set to 0.0.0.0 and end_ip_address set to 255.255.255.255) exposes database servers to unauthorized access and credential brute-force attacks.
This rule checks Ansible resources using the azure.azcollection.azure_rm_sqlfirewallrule (or azure_rm_sqlfirewallrule) module. Resources with start_ip_address set to 0.0.0.0 and end_ip_address set to 255.255.255.255 are flagged. Restrict firewall rules to specific client IPs or CIDR ranges, or use virtual network-based rules to limit access.
Secure example with a single allowed IP:
- name:Add SQL firewall rule for a specific IPazure.azcollection.azure_rm_sqlfirewallrule:resource_group:myResourceGroupserver_name:my-sql-servername:allow-office-ipstart_ip_address:203.0.113.5end_ip_address:203.0.113.5state:present