Bylaw

Gallery › Security Center › Azure built-in policies

[Deprecated]: Sensitive data in your SQL databases should be classified

Converted Policy AuditIfNotExists Disabled Mode Indexed Version 3.0.0-deprecated Deprecated

Azure Security Center monitors the data discovery and classification scan results for your SQL databases and provides recommendations to classify the sensitive data in your databases for better monitoring and security

ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.

Azure Policy JSONASC_SQLDbDataClassification_Audit.json · 56 lines
{
  "properties": {
    "displayName": "[Deprecated]: Sensitive data in your SQL databases should be classified",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Azure Security Center monitors the data discovery and classification scan results for your SQL databases and provides recommendations to classify the sensitive data in your databases for better monitoring and security",
    "metadata": {
      "version": "3.0.0-deprecated",
      "category": "Security Center",
      "deprecated": true
    },
    "version": "3.0.0",
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "AuditIfNotExists",
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "in": [
          "Microsoft.Sql/servers/databases",
          "Microsoft.Sql/managedInstances/databases"
        ]
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Security/assessments",
          "name": "b0df6f56-862d-4730-8597-38c0fd4ebd59",
          "existenceCondition": {
            "field": "Microsoft.Security/assessments/status.code",
            "in": [
              "NotApplicable",
              "Healthy"
            ]
          }
        }
      }
    },
    "versions": [
      "3.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/cc9835f2-9f6b-4cc8-ab4a-f8ef615eb349",
  "name": "cc9835f2-9f6b-4cc8-ab4a-f8ef615eb349"
}
Bylawcc9835f2-9f6b-4cc8-ab4a-f8ef615eb349.bylaw.ps1 · 34 lines
# Converted from ASC_SQLDbDataClassification_Audit.json by ConvertTo-Bylaw.
Policy 'cc9835f2-9f6b-4cc8-ab4a-f8ef615eb349' {

    Properties @{
        DisplayName   = '[Deprecated]: Sensitive data in your SQL databases should be classified'
        Description   = 'Azure Security Center monitors the data discovery and classification scan results for your SQL databases and provides recommendations to classify the sensitive data in your databases for better monitoring and security'
        Version       = '3.0.0-deprecated'
        Category      = 'Security Center'
        Deprecated    = $true
        PolicyVersion = '3.0.0'
        Mode          = 'Indexed'
    }

    Parameter Effect @{
        Type          = 'string'
        AllowedValues = @('AuditIfNotExists', 'Disabled')
        Default       = 'AuditIfNotExists'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the policy'
    }

    Resource * {

        Require 'type is not one of 2 values' {
            Field type | Must -Not -BeIn @('Microsoft.Sql/servers/databases', 'Microsoft.Sql/managedInstances/databases') -IfPresent
        }
    }

    AuditIfNotExists 'Microsoft.Security/assessments' -Name 'b0df6f56-862d-4730-8597-38c0fd4ebd59' -Effect (Param Effect) {
        Require 'status.code is one of 2 values' {
            Field status.code | Must -BeIn @('NotApplicable', 'Healthy')
        }
    }
}

Source: built-in-policies/policyDefinitions/Security Center/ASC_SQLDbDataClassification_Audit.json in Azure/azure-policy, under the MIT licence.