Checks/Azure/Test-ApimThreatDetectionLlmJacking.ps1

function Test-ApimThreatDetectionLlmJacking {
    <#
    .SYNOPSIS
        No potential LLM Jacking attacks detected across all Azure API Management instances

    .DESCRIPTION
        **API Management** diagnostic logs in Log Analytics are analyzed for **LLM-related operations**. Requests are grouped by caller IP, the number of distinct monitored actions (e.g., `ChatCompletions_Create`, `ImageGenerations_Create`) within a configurable `minutes` window is measured, and that ratio is compared to a `threshold` to surface anomalous multi-action patterns.

    .PARAMETER Check
        CIEMCheck object containing check metadata.
    #>

    [CmdletBinding()]
    [OutputType([PSCustomObject[]])]
    param(
        [Parameter(Mandatory)]
        [CIEMCheck]$Check
    )

    $ErrorActionPreference = 'Stop'

    # TODO: Implement check logic based on Prowler check: apim_threat_detection_llm_jacking

    [CIEMScanResult]::Create($Check, 'MANUAL', 'This check requires manual implementation. See Prowler check apim_threat_detection_llm_jacking for reference.', 'N/A', 'apim Resources')
}