{
  "$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/f6ae2eb2-97c9-4e0f-ae73-7420ef80d99d')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/f6ae2eb2-97c9-4e0f-ae73-7420ef80d99d')]",
      "properties": {
        "alertRuleTemplateName": "f6ae2eb2-97c9-4e0f-ae73-7420ef80d99d",
        "customDetails": null,
        "description": "'Searches for triggered Indicators of Exposures.'\n",
        "displayName": "TIE Indicators of Exposures",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "columnName": "HostName",
                "identifier": "HostName"
              },
              {
                "columnName": "DnsDomain",
                "identifier": "DnsDomain"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Tenable%20App/Analytic%20Rules/TIEIndicatorsOfExposures.yaml",
        "query": "// For the query to work properly, make sure you have imported the afad_parser.yaml parser into the workspace\n// Retrieve the parser here: https://aka.ms/sentinel-TenableApp-afad-parser\n// Then, create the Kusto Function with alias afad_parser\nlet SeverityTable=datatable(Severity:string,Level:int) [\n  \"low\", 1,\n  \"medium\", 2,\n  \"high\", 3,\n  \"critical\", 4\n  ];\n  afad_parser\n  | where MessageType == 0\n  | lookup kind=leftouter SeverityTable on Severity\n  | order by Level\n  | extend HostName = tostring(split(Host, '.', 0)[0]), DnsDomain = tostring(strcat_array(array_slice(split(Host, '.'), 1, -1), '.'))\n",
        "queryFrequency": "PT2H",
        "queryPeriod": "PT2H",
        "severity": "Low",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "CredentialAccess"
        ],
        "techniques": [
          "T1110"
        ],
        "templateVersion": "1.0.1",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
