Bylaw

Gallery › Monitoring › Azure built-in policies

[Preview]: Configure Azure Defender for SQL agents on virtual machines

Converted Initiative Version 1.0.0-preview Preview

Configure virtual machines to automatically install the Azure Defender for SQL agents where the Azure Monitor Agent is installed. Security Center collects events from the agents and uses them to provide security alerts and tailored hardening tasks (recommendations). Creates a resource group and Log Analytics workspace in the same region as the machine. This policy only applies to VMs in a few regions.

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

Azure Policy JSONAzureDefenderForSql.json · 78 lines
{
  "properties": {
    "displayName": "[Preview]: Configure Azure Defender for SQL agents on virtual machines",
    "policyType": "BuiltIn",
    "description": "Configure virtual machines to automatically install the Azure Defender for SQL agents where the Azure Monitor Agent is installed. Security Center collects events from the agents and uses them to provide security alerts and tailored hardening tasks (recommendations). Creates a resource group and Log Analytics workspace in the same region as the machine. This policy only applies to VMs in a few regions.",
    "metadata": {
      "category": "Monitoring",
      "version": "1.0.0-preview",
      "preview": true
    },
    "version": "1.0.0-preview",
    "parameters": {
      "enableCollectionOfSqlQueriesForSecurityResearch": {
        "type": "Boolean",
        "metadata": {
          "displayName": "Enable collection of SQL queries for security research",
          "description": "Enable or disable the collection of SQL queries for security research."
        },
        "allowedValues": [
          true,
          false
        ],
        "defaultValue": true
      },
      "effect": {
        "type": "string",
        "defaultValue": "DeployIfNotExists",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the initiative."
        },
        "allowedValues": [
          "DeployIfNotExists",
          "Disabled"
        ]
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2ada9901-073c-444a-9a9a-91865174f0aa",
        "definitionVersion": "1.*.*-preview",
        "policyDefinitionReferenceId": "ASC_DeployAzureDefenderForSqlAdvancedThreatProtectionWindowsAgent",
        "parameters": {
          "enableCollectionOfSqlQueriesForSecurityResearch": {
            "value": "[parameters('enableCollectionOfSqlQueriesForSecurityResearch')]"
          },
          "azureDefenderForSqlExtensionTypeToInstall": {
            "value": "AdvancedThreatProtection.Windows"
          },
          "effect": {
            "value": "[parameters('effect')]"
          }
        }
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2ada9901-073c-444a-9a9a-91865174f0aa",
        "definitionVersion": "1.*.*-preview",
        "policyDefinitionReferenceId": "ASC_DeployAzureDefenderForSqlVulnerabilityAssessmentWindowsAgent",
        "parameters": {
          "enableCollectionOfSqlQueriesForSecurityResearch": {
            "value": "[parameters('enableCollectionOfSqlQueriesForSecurityResearch')]"
          },
          "azureDefenderForSqlExtensionTypeToInstall": {
            "value": "VulnerabilityAssessment.Windows"
          },
          "effect": {
            "value": "[parameters('effect')]"
          }
        }
      }
    ],
    "versions": [
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/39a366e6-fdde-4f41-bbf8-3757f46d1611",
  "name": "39a366e6-fdde-4f41-bbf8-3757f46d1611"
}
Bylaw39a366e6-fdde-4f41-bbf8-3757f46d1611.bylaw.ps1 · 49 lines
# Converted from AzureDefenderForSql.json by ConvertTo-Bylaw.
Initiative '39a366e6-fdde-4f41-bbf8-3757f46d1611' {

    Properties @{
        DisplayName   = '[Preview]: Configure Azure Defender for SQL agents on virtual machines'
        Description   = 'Configure virtual machines to automatically install the Azure Defender for SQL agents where the Azure Monitor Agent is installed. Security Center collects events from the agents and uses them to provide security alerts and tailored hardening tasks (recommendations). Creates a resource group and Log Analytics workspace in the same region as the machine. This policy only applies to VMs in a few regions.'
        Category      = 'Monitoring'
        Version       = '1.0.0-preview'
        Preview       = $true
        PolicyVersion = '1.0.0-preview'
    }

    Parameter EnableCollectionOfSqlQueriesForSecurityResearch @{
        Type          = 'Boolean'
        AllowedValues = @($true, $false)
        Default       = $true
        DisplayName   = 'Enable collection of SQL queries for security research'
        Description   = 'Enable or disable the collection of SQL queries for security research.'
    }
    Parameter Effect @{
        Type          = 'string'
        AllowedValues = @('DeployIfNotExists', 'Disabled')
        Default       = 'DeployIfNotExists'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the initiative.'
    }

    PolicyDefinition @{
        Id          = '2ada9901-073c-444a-9a9a-91865174f0aa'
        ReferenceId = 'ASC_DeployAzureDefenderForSqlAdvancedThreatProtectionWindowsAgent'
        Version     = '1.*.*-preview'
        Parameters  = [ordered]@{
            enableCollectionOfSqlQueriesForSecurityResearch = (Param EnableCollectionOfSqlQueriesForSecurityResearch)
            azureDefenderForSqlExtensionTypeToInstall       = 'AdvancedThreatProtection.Windows'
            effect                                          = (Param Effect)
        }
    }

    PolicyDefinition @{
        Id          = '2ada9901-073c-444a-9a9a-91865174f0aa'
        ReferenceId = 'ASC_DeployAzureDefenderForSqlVulnerabilityAssessmentWindowsAgent'
        Version     = '1.*.*-preview'
        Parameters  = [ordered]@{
            enableCollectionOfSqlQueriesForSecurityResearch = (Param EnableCollectionOfSqlQueriesForSecurityResearch)
            azureDefenderForSqlExtensionTypeToInstall       = 'VulnerabilityAssessment.Windows'
            effect                                          = (Param Effect)
        }
    }
}

Members (2)

Source: built-in-policies/policySetDefinitions/Monitoring/AzureDefenderForSql.json in Azure/azure-policy, under the MIT licence.