Bylaw

Gallery › Security Center › Azure built-in policies

Security Center standard pricing tier should be selected

Converted Policy Audit Disabled Mode All Version 1.1.0

The standard pricing tier enables threat detection for networks and virtual machines, providing threat intelligence, anomaly detection, and behavior analytics in Azure Security Center

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

Azure Policy JSONASC_Standard_pricing_tier.json · 57 lines
{
  "properties": {
    "displayName": "Security Center standard pricing tier should be selected",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "The standard pricing tier enables threat detection for networks and virtual machines, providing threat intelligence, anomaly detection, and behavior analytics in Azure Security Center",
    "metadata": {
      "version": "1.1.0",
      "category": "Security Center"
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "Audit",
        "allowedValues": [
          "Audit",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Security/pricings"
          },
          {
            "field": "Microsoft.Security/pricings/deprecated",
            "exists": "false"
          },
          {
            "field": "Microsoft.Security/pricings/pricingTier",
            "exists": "true"
          },
          {
            "field": "Microsoft.Security/pricings/pricingTier",
            "notEquals": "Standard"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.1.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/a1181c5f-672a-477a-979a-7d58aa086233",
  "name": "a1181c5f-672a-477a-979a-7d58aa086233"
}
Bylawa1181c5f-672a-477a-979a-7d58aa086233.bylaw.ps1 · 34 lines
# Converted from ASC_Standard_pricing_tier.json by ConvertTo-Bylaw.
Policy 'a1181c5f-672a-477a-979a-7d58aa086233' {

    Properties @{
        DisplayName   = 'Security Center standard pricing tier should be selected'
        Description   = 'The standard pricing tier enables threat detection for networks and virtual machines, providing threat intelligence, anomaly detection, and behavior analytics in Azure Security Center'
        Version       = '1.1.0'
        Category      = 'Security Center'
        PolicyVersion = '1.1.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.Security/pricings' {

        When {
            Field deprecated | Must -Not -Exist
            Field pricingTier | Must -Exist
        }

        Require 'pricingTier is Standard' {
            Field pricingTier | Must -Be 'Standard'
        }
    }

    Effect (Param Effect)
}

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