Bylaw

Gallery › Security Center › Azure built-in policies

[Deprecated]: Vulnerabilities in security configuration on your machines should be remediated

Converted Policy AuditIfNotExists Disabled Mode All Version 3.2.1-deprecated Deprecated

Servers which do not satisfy the configured baseline will be monitored by Azure Security Center as recommendations, This policy is deprecated because it depends on the Azure Monitoring agent, which has also been deprecated. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.

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

Azure Policy JSONASC_OSVulnerabilities_Audit.json · 58 lines
{
  "properties": {
    "displayName": "[Deprecated]: Vulnerabilities in security configuration on your machines should be remediated",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Servers which do not satisfy the configured baseline will be monitored by Azure Security Center as recommendations, This policy is deprecated because it depends on the Azure Monitoring agent, which has also been deprecated. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.",
    "metadata": {
      "version": "3.2.1-deprecated",
      "category": "Security Center",
      "deprecated": true
    },
    "version": "3.2.1",
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "Disabled",
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "in": [
          "Microsoft.Compute/virtualMachines",
          "Microsoft.ClassicCompute/virtualMachines"
        ]
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Security/assessments",
          "name": "c476dc48-8110-4139-91af-c8d940896b98",
          "existenceCondition": {
            "field": "Microsoft.Security/assessments/status.code",
            "in": [
              "NotApplicable",
              "Healthy"
            ]
          }
        }
      }
    },
    "versions": [
      "3.2.1",
      "3.2.0",
      "3.1.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15",
  "name": "e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15"
}
Bylawe1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15.bylaw.ps1 · 34 lines
# Converted from ASC_OSVulnerabilities_Audit.json by ConvertTo-Bylaw.
Policy 'e1e5fd5d-3e4c-4ce1-8661-7d1873ae6b15' {

    Properties @{
        DisplayName   = '[Deprecated]: Vulnerabilities in security configuration on your machines should be remediated'
        Description   = 'Servers which do not satisfy the configured baseline will be monitored by Azure Security Center as recommendations, This policy is deprecated because it depends on the Azure Monitoring agent, which has also been deprecated. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.'
        Version       = '3.2.1-deprecated'
        Category      = 'Security Center'
        Deprecated    = $true
        PolicyVersion = '3.2.1'
        Mode          = 'All'
    }

    Parameter Effect @{
        Type          = 'string'
        AllowedValues = @('AuditIfNotExists', 'Disabled')
        Default       = 'Disabled'
        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.Compute/virtualMachines', 'Microsoft.ClassicCompute/virtualMachines') -IfPresent
        }
    }

    AuditIfNotExists 'Microsoft.Security/assessments' -Name 'c476dc48-8110-4139-91af-c8d940896b98' -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_OSVulnerabilities_Audit.json in Azure/azure-policy, under the MIT licence.