{
  "$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/88c4b680-db1c-46b9-8ca4-4165c3abf63f')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/88c4b680-db1c-46b9-8ca4-4165c3abf63f')]",
      "properties": {
        "alertRuleTemplateName": "88c4b680-db1c-46b9-8ca4-4165c3abf63f",
        "customDetails": null,
        "description": "Detects Critical and High severity findings older than 7 days that remain\nopen on internet-facing applications. Uses the InternetFacingApps watchlist\nto scope results to externally exposed assets requiring urgent remediation.\n",
        "displayName": "Critical Finding Overdue on Internet-Facing App",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "CloudApplication",
            "fieldMappings": [
              {
                "columnName": "ApplicationId",
                "identifier": "AppId"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/StratoSecure/Analytic%20Rules/S6_CriticalFinding_Overdue.yaml",
        "query": "let maxAgeDays = 7;\nlet InternetFacingList = _GetWatchlist(\"InternetFacingApps\")\n    | project WL_ApplicationId = column_ifexists(\"ApplicationId\", \"\"),\n        WL_AppName = column_ifexists(\"AppName\", \"\"),\n        WL_Owner = column_ifexists(\"Owner\", \"\");\nStratoSecure_Findings_CL\n    | where FixStatus =~ \"open\"\n    | where Severity in (\"Critical\", \"High\")\n    | extend AgeInDays = datetime_diff(\"day\", now(), TimeGenerated)\n    | where AgeInDays > maxAgeDays\n    | join kind=inner InternetFacingList on $left.ApplicationId == $right.WL_ApplicationId\n    | summarize TotalOverdueFindings = count(), OldestAge = max(AgeInDays),\n        RuleIds = make_set(RuleId, 20), EndTime = max(TimeGenerated)\n        by ApplicationId, WL_AppName, WL_Owner, StraTenantId\n    | project TimeGenerated = EndTime, ApplicationId, AppName = WL_AppName, Owner = WL_Owner,\n        StraTenantId, TotalOverdueFindings, OldestAge, RuleIds\n",
        "queryFrequency": "P1D",
        "queryPeriod": "PT1455M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "Impact"
        ],
        "techniques": [
          "T1499"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
