PostgreSQL Database configuration ‘connection_throttling’ should be on

Description

Enabling connection_throttling helps the PostgreSQL Database to Set the verbosity of logged messages which in turn generates query and error logs with respect to concurrent connections, that could lead to a successful Denial of Service (DoS) attack by exhausting connection resources.

Remediation Steps

Azure Portal

Azure CLI

  • To enable connection_throttling:

az postgres server configuration set --resource-group <resourceGroupName> --server-name <serverName> --name connection_throttling --value on

Azure Resource Manager

{
  "name": "connection_throttling",
  "properties": {
    "value": "on"
  }
}

Example Configuration

{
  "type": "Microsoft.DBforPostgreSQL/servers/configurations",
  "apiVersion": "2017-12-01",
  "name": "connection_throttling",
  "properties": {
    "value": "on"
  }
  # other required fields here
}

Terraform

Example Configuration

resource "azurerm_postgresql_configuration" "example" {
  name  = "connection_throttling"
  value = "on"

  # other required fields here
}