last sync: 2021-Mar-03 15:53:01 UTC

Azure Policy definition

Resource logs in Virtual Machine Scale Sets should be enabled

Name Resource logs in Virtual Machine Scale Sets should be enabled
Azure Portal
Id 7c1b1214-f927-48bf-8882-84f0af6588b1
Version 2.0.1
details on versioning
Category Compute
Microsoft docs
Description It is recommended to enable Logs so that activity trail can be recreated when investigations are required in the event of an incident or a compromise.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: AuditIfNotExists
Allowed: (AuditIfNotExists, Disabled)
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2021-02-10 14:43:58 change Patch (2.0.0 > 2.0.1) *changes on text case sensitivity are not tracked
Used in Initiatives
Initiative DisplayName Initiative Id Initiative Category State
[Deprecated]: Azure Security Benchmark v1 42a694ed-f65e-42b2-aa9e-8052e9740a92 Regulatory Compliance Deprecated
[Deprecated]: Azure Security Benchmark v2 bb522ac1-bc39-4957-b194-429bcd3bcb0b Regulatory Compliance Deprecated
[Preview]: CIS Microsoft Azure Foundations Benchmark 1.3.0 612b5213-9160-4969-8578-1518bd2a000c Regulatory Compliance Preview
Azure Security Benchmark 1f3afdf9-d0c9-4c3d-847f-89da613e70a8 Security Center GA
HITRUST/HIPAA a169a624-5599-4385-a696-c8d643089fab Regulatory Compliance GA
JSON Changes

Json
{
  "properties": {
    "displayName": "Resource logs in Virtual Machine Scale Sets should be enabled",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "It is recommended to enable Logs so that activity trail can be recreated when investigations are required in the event of an incident or a compromise.",
    "metadata": {
      "version": "2.0.1",
      "category": "Compute"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "defaultValue": "AuditIfNotExists"
      },
      "includeAKSClusters": {
        "type": "Boolean",
        "metadata": {
          "displayName": "Include AKS Clusters",
          "description": "Whether to include AKS Clusters to resource logs extension - True or False"
        },
        "defaultValue": false
      }
    },
    "policyRule": {
      "if": {
        "anyOf": [
          {
            "allOf": [
              {
                "field": "type",
                "equals": "Microsoft.Compute/virtualMachineScaleSets"
              },
              {
              "value": "[parameters('includeAKSClusters')]",
                "equals": true
              }
            ]
          },
          {
            "allOf": [
              {
                "field": "type",
                "equals": "Microsoft.Compute/virtualMachineScaleSets"
              },
              {
              "value": "[parameters('includeAKSClusters')]",
                "equals": false
              },
              {
                "field": "Microsoft.Compute/imagePublisher",
                "notEquals": "microsoft-aks"
              },
              {
                "field": "Microsoft.Compute/imageOffer",
                "notEquals": "aks"
              },
              {
                "field": "Microsoft.Compute/imageSKU",
                "notLike": "aks*"
              }
            ]
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Compute/virtualMachineScaleSets/extensions",
          "existenceCondition": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "field": "Microsoft.Compute/virtualMachineScaleSets/extensions/type",
                    "equals": "IaaSDiagnostics"
                  },
                  {
                    "field": "Microsoft.Compute/virtualMachineScaleSets/extensions/publisher",
                    "equals": "Microsoft.Azure.Diagnostics"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "field": "Microsoft.Compute/virtualMachineScaleSets/extensions/type",
                    "equals": "LinuxDiagnostic"
                  },
                  {
                    "field": "Microsoft.Compute/virtualMachineScaleSets/extensions/publisher",
                    "in": [
                      "Microsoft.OSTCExtensions",
                      "Microsoft.Azure.Diagnostics"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/7c1b1214-f927-48bf-8882-84f0af6588b1",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "7c1b1214-f927-48bf-8882-84f0af6588b1"
}