| Attribute | Details | |—|—| | Technique ID | MISCONFIG-012 | | MITRE ATT&CK v18.1 | T1526 – Cloud Service Discovery (misconfig enabling discovery and access); T1530 – Data from Cloud Storage Object (data theft) | | Tactic | Initial Access / Collection | | Platforms | Entra ID / Azure (Azure SQL Database, SQL Managed Instance) | | Severity | Critical | | Technique Status | ACTIVE | | Last Verified | 2026-01-10 | | Affected Versions | Azure SQL logical servers and managed instances with public endpoint and permissive firewall (0.0.0.0/0 or Allow Azure services) | | Patched In | N/A – configuration-based; mitigated via proper firewall, private endpoints, and network isolation | | Author | SERVTEP – Artur Pchelnikau |
0.0.0.0/0 or the broad “Allow Azure services and resources to access this server” rule, the database becomes reachable from a vast number of sources, including other tenants (for legacy behavior) and attacker-controlled hosts. Combined with weak credentials, token theft, or SQL injection in upstream applications, this misconfiguration dramatically increases both the probability and impact of compromise.0.0.0.0 to 255.255.255.255) for troubleshooting and never remove them. Cloud security posture tools and CIS benchmarks explicitly flag these rules as critical misconfigurations.| Framework | Control / ID | Description | |—|—|—| | CIS Benchmark | Azure Foundations controls for SQL firewall | Require restricted IP ranges and disallow 0.0.0.0/0 and AllowAllWindowsAzureIps. | | DISA STIG | Database SRG network controls | Limit remote connections and enforce network access control lists. | | CISA SCuBA | Database and PaaS access restrictions | Limit exposure of cloud databases to the internet. | | NIST 800-53 | AC-4, SC-7 | Boundary protection and system interconnections. | | GDPR | Art. 32 | Data protection by design including network-level controls. | | DORA | Art. 9 | ICT risk management including network and access segmentation. | | NIS2 | Art. 21 | Network and information system security, including access controls. | | ISO 27001 | A.8.20, A.8.21 | Network security and segregation. | | ISO 27005 | Risk Scenario | Database exposed to the internet leading to bulk data breach.
Supported Versions:
# List all SQL servers in a subscription
az sql server list -o table
# List firewall rules for each server
az sql server firewall-rule list \
--resource-group <rg> \
--server <server-name> -o table
What to Look For:
0.0.0.0 and End IP 0.0.0.0 (Allow Azure services).0.0.0.0 to 255.255.255.255.Get-AzSqlServer | ForEach-Object {
Get-AzSqlServerFirewallRule -ResourceGroupName $_.ResourceGroupName -ServerName $_.ServerName |
Select-Object ServerName=@{n='Server';e={$_.ServerName}}, FirewallRuleName, StartIpAddress, EndIpAddress
}
What to Look For:
AllowAllWindowsAzureIps or similar.Supported Versions: Azure SQL Database with public endpoint and 0.0.0.0/0 or broad rules.
Objective: Use internet scanning or OSINT to identify Azure SQL servers with open firewall.
*.database.windows.net endpoints and attempt connections on TCP 1433.Objective: Attempt login using known or guessed SQL logins.
Command (example using sqlcmd):
sqlcmd -S tcp:<server>.database.windows.net,1433 -U <login> -P <password> -d master -Q "SELECT @@version;"
Expected Output:
OpSec & Evasion:
Supported Versions: Any Azure SQL server with Allow Azure services and resources to access this server enabled.
No dedicated Atomic test exists solely for Azure SQL firewall misconfiguration; use credential stuffing or SQL data exfiltration tests against a test database reachable via open firewall to validate detection and logging.
az sql server firewall-rule for rule management.Get-AzSqlServerFirewallRule, Set-AzSqlServerFirewallRule, Remove-AzSqlServerFirewallRule.sqlcmd / Azure Data Studio / application connection strings to validate connectivity.0.0.0.0 or where the range spans the full IPv4 space.resources
| where type == "microsoft.sql/servers/firewallrules"
| extend startIp = tostring(properties.startIpAddress), endIp = tostring(properties.endIpAddress)
| where startIp == "0.0.0.0" or endIp == "255.255.255.255"
Use AzureDiagnostics or SQLSecurityAuditEvents to detect repeated failed logins from varied IPs towards a single server.
Not directly applicable (PaaS service), but on self-hosted SQL Servers in IaaS VMs, use Windows Firewall and Event Log monitoring similar to endpoint guidance.
For IaaS SQL Servers:
sqlcmd usage from non-admin accounts.Key built-in recommendations:
Use these recommendations to identify and remediate misconfigured servers.
For M365-integrated apps using Azure SQL as backend, ensure that privileged access and app credential usage is audited and correlated with SQL access patterns.
Allow Azure services and resources to access this server and remove any firewall rules allowing 0.0.0.0/0.az sql server firewall-rule list --resource-group <rg> --server <server> -o table
# Ensure no rules with 0.0.0.0 or 255.255.255.255
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | Exposure of SQL endpoint | Public SQL endpoint with weak firewall. |
| 2 | Credential Access | Password spray / token theft | Attacker obtains SQL credentials. |
| 3 | Current Step | MISCONFIG-012 – SQL Database Firewall Disabled | Firewall allows attacker to connect from untrusted networks. |
| 4 | Collection | SQL data export | SELECT and bulk export of sensitive tables. |
| 5 | Exfiltration & Impact | Data breach and extortion | Data exfiltration and regulatory impact. |