π‘οΈ Azure PostgreSQL Flexible Server Firewall Rules allow access to Azure servicesπ’
- Contextual name: π‘οΈ Flexible Server Firewall Rules allow access to Azure servicesπ’
- ID:
/ce/ca/azure/postgresql-database/disable-flexible-server-allows-access-to-azure-services - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicβ
- π§ prod.logic.yamlπ’
Similar Policiesβ
- Cloud Conformity: Disable 'Allow access to Azure services' for PostgreSQL database servers
- Internal:
dec-x-bf1f13f6
Similar Internal Rulesβ
| Rule | Policies | Flags |
|---|---|---|
| βοΈ dec-x-bf1f13f6 | 1 |
Descriptionβ
Descriptionβ
Disable access from Azure services to
PostgreSQL flexible server.Rationaleβ
If access from Azure services is enabled, the server's firewall will accept connections from all Azure resources, including resources not in your subscription. This is usually not a desired configuration. Instead, set up firewall rules to allow access from specific network ranges or VNET rules to allow access from specific virtual networks.
Auditβ
From Azure Portalβ
- Login to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for PostgreSQL flexible servers.- For each database, under
Settings, clickNetworking.- Under
Firewall rules, ensureAllow public access from any Azure service within Azure to this serveris not checked.From Azure CLIβ
Ensure the below command does not return a rule with a name beginning
AllowAllAzureServicesAndResourcesWithinAzureIpsor with"startIpAddress": "0.0.0.0"or"endIpAddress": "0.0.0.0":az postgres flexible-server firewall-rule list --resource-group <resourceGroup> --name <serverName>
... [see more](description.md)
Remediationβ
Remediationβ
From Azure Portalβ
- Login to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for PostgreSQL flexible servers.- For each database, under
Settings, clickNetworking.- Under
Firewall rules, uncheckAllow public access from any Azure service within Azure to this server.- Click
Save.From Azure CLIβ
Using the firewall rule name from the
Audit from Azure CLIsteps, use the below command to delete theAllowAllAzureServicesAndResourcesWithinAzureIpsrule for PostgreSQL flexible server:az postgres flexible-server firewall-rule delete --resource-group <resourceGroup> --name <serverName> --rule-name <ruleName>Type
yand press enter toconfirm.From PowerShellβ
Using the firewall rule name from the
Audit from PowerShellsteps, use the below command to delete theAllowAllAzureServicesAndResourcesWithinAzureIpsrule for PostgreSQL flexible server:Remove-AzPostgreSqlFlexibleServerFirewallRule -ResourceGroupName <resourceGroup> -ServerName <serverName> -Name <ruleName>
... [see more](remediation.md)