last sync: 2021-Sep-24 16:09:49 UTC

Azure Policy definition

Log connections should be enabled for PostgreSQL database servers

Name Log connections should be enabled for PostgreSQL database servers
Azure Portal
Id eb6f77b9-bd53-4e35-a23d-7f65d5f0e442
Version 1.0.0
details on versioning
Category SQL
Microsoft docs
Description This policy helps audit any PostgreSQL databases in your environment without log_connections setting enabled.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: AuditIfNotExists
Allowed: (AuditIfNotExists, Disabled)
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2019-10-03 22:58:00 add eb6f77b9-bd53-4e35-a23d-7f65d5f0e442
Used in Initiatives
Initiative DisplayName Initiative Id Initiative Category State
CIS Microsoft Azure Foundations Benchmark v1.1.0 1a5bb27d-173f-493e-9568-eb56638dde4d Regulatory Compliance GA
CIS Microsoft Azure Foundations Benchmark v1.3.0 612b5213-9160-4969-8578-1518bd2a000c Regulatory Compliance GA
JSON
{
  "displayName": "Log connections should be enabled for PostgreSQL database servers",
  "policyType": "BuiltIn",
  "mode": "Indexed",
  "description": "This policy helps audit any PostgreSQL databases in your environment without log_connections setting enabled.",
  "metadata": {
    "version": "1.0.0",
    "category": "SQL"
  },
  "parameters": {
    "effect": {
      "type": "String",
      "metadata": {
        "displayName": "Effect",
        "description": "Enable or disable the execution of the policy"
      },
      "allowedValues": [
        "AuditIfNotExists",
        "Disabled"
      ],
      "defaultValue": "AuditIfNotExists"
    }
  },
  "policyRule": {
    "if": {
      "field": "type",
      "equals": "Microsoft.DBforPostgreSQL/servers"
    },
    "then": {
      "effect": "[parameters('effect')]",
      "details": {
        "type": "Microsoft.DBforPostgreSQL/servers/configurations",
        "name": "log_connections",
        "existenceCondition": {
          "field": "Microsoft.DBforPostgreSQL/servers/configurations/value",
          "equals": "ON"
        }
      }
    }
  }
}