Description
Enable connection throttling on PostgreSQL flexible servers.
Rationaleβ
Enabling connection_throttling helps PostgreSQL limit concurrent connections that could lead to a Denial of Service (DoS) attack by exhausting connection resources. A system can also fail or be degraded by an overload of legitimate users. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.
Auditβ
From Azure Portalβ
- Log in to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for PostgreSQL flexible servers. - For each database, under Settings, click
Server parameters. - In the filter bar, type
connection_throttle.enable. - Ensure that
VALUEforconnection_throttle.enableis set toON.
From Azure CLIβ
Ensure the following command returns a value of ON:
az postgres flexible-server parameter show \
--resource-group {{resource-group-name}} \
--server-name {{server-name}} \
--name connection_throttle.enable
From PowerShellβ
Ensure the following command returns a Value of ON:
Get-AzPostgreSqlFlexibleServerConfiguration `
-ResourceGroupName {{resource-group-name}} `
-ServerName {{server-name}} `
-Name connection_throttle.enable
From Azure Policyβ
If referencing a digital copy of this Benchmark, clicking a Policy ID will open a link to the associated Policy definition in Azure.
- Policy ID: dacf07fa-0eea-4486-80bc-b93fae88ac40 - Name:
Connection throttling should be enabled for PostgreSQL flexible servers
Default Valueβ
By default, connection_throttle.enable is disabled (set to off).
Referencesβ
- https://learn.microsoft.com/en-us/rest/api/postgresql/flexibleserver/configurations/list-by-server
- https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-configure-server-parameters-using-portal
- https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-logging-threat-detection#lt-3-enable-logging-for-security-investigation
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/get-azpostgresqlflexibleserverconfiguration?view=azps-12.2.0#example-1-get-specified-postgresql-configuration-by-name
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/update-azpostgresqlflexibleserverconfiguration?view=azps-12.2.0#example-1-updatae-specified-postgresql-configuration-by-name