{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "description": "ThreatDeck AI detection pack for Microsoft Sentinel: 4 scheduled analytics rules (alert-ready detections with KQL). Rules are created disabled; review the queries and enable them. Source: https://threatdeck.net/detections/",
    "version": "2026.11.22-47e3dc72",
    "generated": "2026-11-22",
    "ruleCount": 4
  },
  "parameters": {
    "workspace": {
      "type": "string",
      "metadata": {
        "description": "Name of the Log Analytics workspace where Microsoft Sentinel is enabled"
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.SecurityInsights/alertRules",
      "apiVersion": "2025-09-01",
      "scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('workspace'))]",
      "name": "a14edc19-ad10-4a9e-afc8-89368913409a",
      "kind": "Scheduled",
      "properties": {
        "displayName": "ThreatDeck: Bedrock model-access enablement APIs called with a long-term access key",
        "description": "Attackers holding stolen IAM user keys enable models themselves: they submit a use-case form (PutUseCaseForModelAccess), create an agreement (CreateFoundationModelAgreement) and request the entitlement (PutFoundationModelEntitlement). Permiso notes these are normally driven by the console, so calls made with a long-term key (AKIA…) are rare in legitimate use. MITRE ATT&CK: T1078.004 Cloud Accounts; T1496.004 Cloud Service Hijacking. Expected false positives: Infrastructure-as-code or scripts that enable Bedrock model access with an IAM user key; Break-glass IAM users used by administrators from the CLI. Details: https://threatdeck.net/detections/llmjacking-bedrock-model-access-apis-from-access-key/ (ThreatDeck pack 2026.11.22-47e3dc72).",
        "severity": "Medium",
        "enabled": false,
        "query": "let access_apis = dynamic([\"GetFoundationModelAvailability\", \"PutUseCaseForModelAccess\", \"GetUseCaseForModelAccess\",\n                             \"CreateFoundationModelAgreement\", \"PutFoundationModelEntitlement\", \"ListFoundationModelAgreementOffers\"]);\nAWSCloudTrail\n| where EventSource == \"bedrock.amazonaws.com\"\n| where EventName in (access_apis)\n| where UserIdentityAccessKeyId startswith \"AKIA\"\n| project TimeGenerated, EventName, AWSRegion, SourceIpAddress, UserAgent, ErrorCode,\n          UserIdentityArn, UserIdentityAccessKeyId, RecipientAccountId\n| order by TimeGenerated desc",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0,
        "suppressionDuration": "PT5H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion",
          "Persistence",
          "PrivilegeEscalation",
          "InitialAccess",
          "Impact"
        ],
        "techniques": [
          "T1078",
          "T1496"
        ],
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "identifier": "FullName",
                "columnName": "UserIdentityArn"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "identifier": "Address",
                "columnName": "SourceIpAddress"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "AlertPerResult"
        }
      }
    },
    {
      "type": "Microsoft.SecurityInsights/alertRules",
      "apiVersion": "2025-09-01",
      "scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('workspace'))]",
      "name": "36fbd0ad-e05f-4c1e-a5e5-460292451057",
      "kind": "Scheduled",
      "properties": {
        "displayName": "ThreatDeck: Bedrock model invocation logging configuration deleted",
        "description": "Sysdig observed LLMjacking actors calling DeleteModelInvocationLoggingConfiguration to stop prompts and responses being written to CloudWatch Logs and S3 before abusing the account. Deleting the configuration is rare outside planned changes and removes the only record of prompt content. MITRE ATT&CK: T1685.002 Disable or Modify Cloud Log. Expected false positives: Planned changes to Bedrock logging made by the platform team. Details: https://threatdeck.net/detections/llmjacking-bedrock-invocation-logging-deleted/ (ThreatDeck pack 2026.11.22-47e3dc72).",
        "severity": "High",
        "enabled": false,
        "query": "AWSCloudTrail\n| where EventSource == \"bedrock.amazonaws.com\"\n| where EventName == \"DeleteModelInvocationLoggingConfiguration\"\n| project TimeGenerated, UserIdentityArn, UserIdentityAccessKeyId, SourceIpAddress, UserAgent, AWSRegion,\n          RecipientAccountId, ErrorCode",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0,
        "suppressionDuration": "PT5H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion"
        ],
        "techniques": [
          "T1685"
        ],
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "identifier": "FullName",
                "columnName": "UserIdentityArn"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "identifier": "Address",
                "columnName": "SourceIpAddress"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "AlertPerResult"
        }
      }
    },
    {
      "type": "Microsoft.SecurityInsights/alertRules",
      "apiVersion": "2025-09-01",
      "scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('workspace'))]",
      "name": "fe4a9dcf-34a7-4987-af9e-7adca1d87d85",
      "kind": "Scheduled",
      "properties": {
        "displayName": "ThreatDeck: Windows script host or HTA connects to an LLM API (PROMPTFLUX pattern)",
        "description": "GTIG describes PROMPTFLUX, a VBScript dropper that sends a hard-coded API key to the Gemini API to have its own code rewritten, and PROMPTSTEAL (APT28), which queries a model through the Hugging Face API to generate commands. Legitimate wscript, cscript or mshta traffic to model APIs is very rare. MITRE ATT&CK: T1059.005 Visual Basic; T1218.005 Mshta; T1027.014 Polymorphic Code. Expected false positives: Legacy in-house VBScript automation that calls an AI API (unusual; confirm with the owner). Details: https://threatdeck.net/detections/script-host-calls-llm-api/ (ThreatDeck pack 2026.11.22-47e3dc72).",
        "severity": "Medium",
        "enabled": false,
        "query": "let ai_api_hosts = dynamic([\"api.openai.com\", \"api.anthropic.com\", \"generativelanguage.googleapis.com\", \"api.deepseek.com\",\n                       \"openrouter.ai\", \"router.huggingface.co\"]);\nDeviceNetworkEvents\n| where InitiatingProcessFileName in~ (\"wscript.exe\", \"cscript.exe\", \"mshta.exe\")\n| where isnotempty(RemoteUrl)\n| extend RemoteHost = tolower(tostring(parse_url(iff(RemoteUrl contains \"://\", RemoteUrl, strcat(\"https://\", RemoteUrl))).Host))\n| where RemoteHost in (ai_api_hosts) or RemoteHost endswith \".openai.azure.com\"\n| project TimeGenerated, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName,\n          InitiatingProcessCommandLine, InitiatingProcessParentFileName, RemoteHost, RemoteIP\n| order by TimeGenerated desc",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0,
        "suppressionDuration": "PT5H",
        "suppressionEnabled": false,
        "tactics": [
          "Execution",
          "DefenseEvasion"
        ],
        "techniques": [
          "T1059",
          "T1218",
          "T1027"
        ],
        "entityMappings": [
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "identifier": "HostName",
                "columnName": "DeviceName"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "identifier": "Name",
                "columnName": "InitiatingProcessAccountName"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "identifier": "Address",
                "columnName": "RemoteIP"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "AlertPerResult"
        }
      }
    },
    {
      "type": "Microsoft.SecurityInsights/alertRules",
      "apiVersion": "2025-09-01",
      "scope": "[concat('Microsoft.OperationalInsights/workspaces/', parameters('workspace'))]",
      "name": "a9b72375-8648-428f-a034-650b4ea0dada",
      "kind": "Scheduled",
      "properties": {
        "displayName": "ThreatDeck: PROMPTFLUX artifacts: thinking_robot_log.txt or VBScript written to Startup by a script host",
        "description": "GTIG reports that PROMPTFLUX logs model responses to %TEMP%\\thinking_robot_log.txt and saves each regenerated, obfuscated copy of itself to the Startup folder. Indicators are from GTIG's November 2025 report; later variants may change the file name. MITRE ATT&CK: T1547.001 Registry Run Keys / Startup Folder; T1027.014 Polymorphic Code; T1059.005 Visual Basic. Expected false positives: Login scripts deployed as VBScript into Startup folders by IT (check publisher and content). Details: https://threatdeck.net/detections/promptflux-host-artifacts/ (ThreatDeck pack 2026.11.22-47e3dc72).",
        "severity": "Medium",
        "enabled": false,
        "query": "DeviceFileEvents\n| where ActionType in (\"FileCreated\", \"FileModified\")\n| where FileName =~ \"thinking_robot_log.txt\"\n     or (InitiatingProcessFileName in~ (\"wscript.exe\", \"cscript.exe\")\n         and FolderPath contains @\"\\Start Menu\\Programs\\Startup\\\"\n         and FileName endswith \".vbs\")\n| project TimeGenerated, DeviceName, ActionType, FolderPath, FileName, InitiatingProcessFileName,\n          InitiatingProcessCommandLine, InitiatingProcessAccountName\n| order by TimeGenerated desc",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0,
        "suppressionDuration": "PT5H",
        "suppressionEnabled": false,
        "tactics": [
          "Persistence",
          "PrivilegeEscalation",
          "DefenseEvasion",
          "Execution"
        ],
        "techniques": [
          "T1547",
          "T1027",
          "T1059"
        ],
        "entityMappings": [
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "identifier": "HostName",
                "columnName": "DeviceName"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "identifier": "Name",
                "columnName": "InitiatingProcessAccountName"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "AlertPerResult"
        }
      }
    }
  ]
}
