Check provider logo

No potential LLM Jacking attacks detected across all Azure API Management instances

apim_threat_detection_llm_jacking

Severitycritical
Serviceapim
by Prowler

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.

Risk

Concentrated LLM activity from one IP indicates automation or leaked credentials.

  • Availability/cost: rapid token burn and quota exhaustion
  • Confidentiality: exposure of prompts/completions and model details
  • Integrity: abuse of deployment/model actions enabling unauthorized changes or mass content generation
Run this check with Prowler CLI

prowler azure --checks apim_threat_detection_llm_jacking

Recommendation

Adopt defense in depth for LLM APIs:

  • Enforce least privilege; isolate management from inference
  • Prefer managed identities over keys; rotate secrets
  • Apply quotas, rate limiting, and IP allowlisting; use private access
  • Alert on anomalous action diversity; review logs

Tune threshold and minutes for your environment.

Remediation

Native IaC
Terraform
Other
  1. In the Azure portal, open your API Management instance
  2. Go to APIs > All APIs
  3. Click Policies (Inbound processing)
  4. Add a when block to block the offending IP:
    • Condition: @(context.Request.IpAddress == "<OFFENDING_IP>")
    • Action: return-response with status 403 Forbidden
  5. Save the policy
  6. Re-run the scan after the detection window elapses to confirm PASS

Source Code

Resource Type

microsoft.apimanagement/service

References