{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/f2cd0583-da5f-4edc-a4ad-1a237643c228')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/f2cd0583-da5f-4edc-a4ad-1a237643c228')]",
      "properties": {
        "alertDetailsOverride": {
          "alertDescriptionFormat": "Takedown {{TakedownId}} waiting for customer ({{ActionRequired}}). Status: {{Status}}.",
          "alertDisplayNameFormat": "Netcraft Takedown waiting - {{TakedownId}}"
        },
        "alertRuleTemplateName": "f2cd0583-da5f-4edc-a4ad-1a237643c228",
        "customDetails": {
          "AttackType": "AttackType",
          "GroupId": "GroupId",
          "IsAuthorized": "IsAuthorized",
          "IsEscalated": "IsEscalated",
          "IsMaliciousDomain": "IsMaliciousDomain",
          "IsMaliciousHostname": "IsMaliciousHostname",
          "Threat": "Threat"
        },
        "description": "Identifies Netcraft Takedown records where action is waiting on the customer\n(`EventType == \"takedown\"` and `ActionRequired` is not `no`).\n",
        "displayName": "Netcraft Takedown - Waiting for customer",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "URL",
            "fieldMappings": [
              {
                "columnName": "ThreatUrl",
                "identifier": "Url"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "ThreatIp",
                "identifier": "Address"
              }
            ]
          },
          {
            "entityType": "DNS",
            "fieldMappings": [
              {
                "columnName": "ThreatDomain",
                "identifier": "DomainName"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "AlertPerResult"
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NetcraftIntegrationGateway/Analytic%20Rules/NetcraftTakedown_Blocked.yaml",
        "query": "NetcraftTakedown_Unique\n| where IngestedAt > ago(15m)\n| where EventType == \"takedown\"\n| where isnotempty(ActionRequired) and ActionRequired != \"no\"\n| extend\n    ThreatUrl = iff(Threat matches regex @\"(?i)^https?://\", Threat, \"\"),\n    ThreatIp = iff(isnotempty(parse_ipv4(Threat)) or isnotempty(parse_ipv6(Threat)), Threat, \"\")\n| extend\n    ThreatDomain = iff(isempty(ThreatUrl) and isempty(ThreatIp) and Threat !has \"@\" and Threat matches regex @\"^[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$\", Threat, \"\")\n| project\n    TimeGenerated,\n    EventId,\n    Subject,\n    TakedownId,\n    GroupId,\n    AttackType,\n    Threat,\n    ThreatUrl,\n    ThreatIp,\n    ThreatDomain,\n    Status,\n    ActionRequired,\n    IsAuthorized,\n    IsEscalated,\n    IsMaliciousDomain,\n    IsMaliciousHostname\n",
        "queryFrequency": "PT15M",
        "queryPeriod": "PT4H",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion",
          "ResourceDevelopment"
        ],
        "techniques": [
          "T1583"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
