last sync: 2021-Jan-20 16:06:14 UTC

Azure Policy definition

SQL Auditing settings should have Action-Groups configured to capture critical activities

Name SQL Auditing settings should have Action-Groups configured to capture critical activities
Azure Portal
Id 7ff426e2-515f-405a-91c8-4f2333442eb5
Version 1.0.0
details on versioning
Category SQL
Microsoft docs
Description The AuditActionsAndGroups property should contain at least SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP, BATCH_COMPLETED_GROUP to ensure a thorough audit logging
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: AuditIfNotExists
Allowed: (AuditIfNotExists, Disabled)
Used RBAC Role none
History none
Used in Initiatives
Initiative DisplayName Initiative Id Initiative Category State
[Preview]: Azure Security Benchmark v1 42a694ed-f65e-42b2-aa9e-8052e9740a92 Regulatory Compliance Preview
CIS Microsoft Azure Foundations Benchmark 1.1.0 1a5bb27d-173f-493e-9568-eb56638dde4d Regulatory Compliance GA
Json
{
  "properties": {
    "displayName": "SQL Auditing settings should have Action-Groups configured to capture critical activities",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "The AuditActionsAndGroups property should contain at least SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP, BATCH_COMPLETED_GROUP to ensure a thorough audit logging",
    "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.Sql/servers"
      },
      "then": {
      "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Sql/servers/auditingSettings",
          "name": "default",
          "existenceCondition": {
            "allOf": [
              {
                "not": {
                "field": "Microsoft.Sql/servers/auditingSettings/auditActionsAndGroups[*]",
                  "notEquals": "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"
                }
              },
              {
                "not": {
                "field": "Microsoft.Sql/servers/auditingSettings/auditActionsAndGroups[*]",
                  "notEquals": "FAILED_DATABASE_AUTHENTICATION_GROUP"
                }
              },
              {
                "not": {
                "field": "Microsoft.Sql/servers/auditingSettings/auditActionsAndGroups[*]",
                  "notEquals": "BATCH_COMPLETED_GROUP"
                }
              }
            ]
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/7ff426e2-515f-405a-91c8-4f2333442eb5",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "7ff426e2-515f-405a-91c8-4f2333442eb5"
}