last sync: 2020-Aug-07 14:05:09 UTC

Azure Policy

Diagnostic logs in App Services should be enabled

Policy DisplayName Diagnostic logs in App Services should be enabled
Policy Id b607c5de-e7d9-4eee-9e5c-83f1bcee4fa0
Policy Category App Service
Policy Description Audit enabling of diagnostic logs on the app. This enables you to recreate activity trails for investigation purposes if a security incident occurs or your network is compromised
Policy Mode All
Policy Type BuiltIn
Policy in Preview FALSE
Policy Deprecated FALSE
Policy Effect Default: AuditIfNotExists
Allowed: (AuditIfNotExists,Disabled)
Roles used none
Policy Changes no changes
Used in Policy Initiative(s)
Initiative DisplayName Initiative Id
Enable Monitoring in Azure Security Center 1f3afdf9-d0c9-4c3d-847f-89da613e70a8
[Preview]: Azure Security Benchmark 42a694ed-f65e-42b2-aa9e-8052e9740a92
HITRUST/HIPAA a169a624-5599-4385-a696-c8d643089fab
Policy Rule
{
  "properties": {
    "displayName": "Diagnostic logs in App Services should be enabled",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Audit enabling of diagnostic logs on the app. This enables you to recreate activity trails for investigation purposes if a security incident occurs or your network is compromised",
    "metadata": {
      "version": "1.0.0",
      "category": "App Service"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "defaultValue": "AuditIfNotExists"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Web/sites"
          },
          {
            "field": "kind",
            "notContains": "functionapp"
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Web/sites/config",
          "existenceCondition": {
            "allOf": [
              {
                "field": "Microsoft.Web/sites/config/detailedErrorLoggingEnabled",
                "equals": "true"
              },
              {
                "field": "Microsoft.Web/sites/config/httpLoggingEnabled",
                "equals": "true"
              },
              {
                "field": "Microsoft.Web/sites/config/requestTracingEnabled",
                "equals": "true"
              }
            ]
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/b607c5de-e7d9-4eee-9e5c-83f1bcee4fa0",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "b607c5de-e7d9-4eee-9e5c-83f1bcee4fa0"
}