{
  "$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/c4f2a8d1-6e39-4c07-b5a2-1d8e3f7c9a25')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/c4f2a8d1-6e39-4c07-b5a2-1d8e3f7c9a25')]",
      "properties": {
        "alertRuleTemplateName": "c4f2a8d1-6e39-4c07-b5a2-1d8e3f7c9a25",
        "customDetails": {
          "HoursSinceLast": "HoursSinceLastIndicator",
          "Status": "Status"
        },
        "description": "'Detects when no Speculus threat intelligence indicators have been received for more than 24 hours.\nThe Speculus indexer refreshes continuously, so a silent day usually means an expired API key,\na connector misconfiguration, or a feed-side outage rather than an empty feed.'\n",
        "displayName": "Speculus - Threat intelligence feed outage",
        "enabled": true,
        "entityMappings": null,
        "eventGroupingSettings": {
          "aggregationKind": "SingleAlert"
        },
        "incidentConfiguration": {
          "createIncident": true,
          "groupingConfiguration": {
            "enabled": true,
            "lookbackDuration": "P1D",
            "matchingMethod": "AllEntities",
            "reopenClosedIncident": false
          }
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Speculus%20Threat%20Intelligence/Analytic%20Rules/Speculus%20-%20Feed%20Outage%20Detection.yaml",
        "query": "Speculus_Indicators_CL\n| summarize LastReceived = max(TimeGenerated)\n| where isnull(LastReceived) or LastReceived < ago(1d)\n| extend\n    HoursSinceLastIndicator = iff(isnull(LastReceived), long(null), datetime_diff('hour', now(), LastReceived)),\n    Status = iff(isnull(LastReceived), 'No data ever received in query period', 'Feed silent for more than 24 hours')\n",
        "queryFrequency": "PT6H",
        "queryPeriod": "P2D",
        "severity": "Informational",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "P1D",
        "suppressionEnabled": true,
        "tactics": [
          "Impact"
        ],
        "techniques": [
          "T1565"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
