nuclei-templates/cloud/azure/postgresql/azure-postgres-connection-t...

56 lines
2.1 KiB
YAML

id: azure-postgres-connection-throttling-disabled
info:
name: Azure PostgreSQL Server Connection Throttling Disabled
author: princechaddha
severity: medium
description: |
Ensure that "connection_throttling" server parameter is enabled for all PostgreSQL database servers provisioned within your Microsoft Azure cloud account. The "connection_throttling" parameter enables temporary connection throttling per IP address for too many invalid login failures.
impact: |
Disabling the "connection_throttling" server parameter exposes your PostgreSQL databases to potential brute force or DDoS attacks by not limiting the rate of failed login attempts.
remediation: |
Enable the "connection_throttling" server parameter on your Azure PostgreSQL servers to prevent excessive failed login attempts and mitigate potential attacks.
reference:
- https://docs.microsoft.com/en-us/azure/postgresql/concepts-server-parameters
tags: cloud,devops,azure,microsoft,postgresql,azure-cloud-config
flow: |
code(1);
for (let ServerData of iterate(template.serverList)) {
ServerData = JSON.parse(ServerData);
set("name", ServerData.name);
set("resourceGroup", ServerData.resourceGroup);
code(2);
}
self-contained: true
code:
- engine:
- sh
- bash
source: |
az postgres server list --output json --query '[*].{"name":name,"resourceGroup":resourceGroup}'
extractors:
- type: json
name: serverList
internal: true
json:
- '.[]'
- engine:
- sh
- bash
source: |
az postgres server configuration show --server-name "$name" --resource-group "$resourceGroup" --name connection_throttling --query 'value'
matchers-condition: and
matchers:
- type: word
words:
- 'off'
extractors:
- type: dsl
dsl:
- 'name + " in " + resourceGroup + " has connection throttling disabled"'
# digest: 4a0a00473045022100c288cf082b9bf3d0a253e6f8e0f2bdfbd18b63a156e4b9a5dd4654b8cf56868502204fb9a87257f8ea06b83cdc4519e98878a1d554021f0f69b7991f4ef627db61a2:922c64590222798bb761d5b6d8e72950