-- ThreatDeck detection pack (cloudtrail-sql) version 2026.11.22-19df9531 -- Generated 2026-11-22. 6 queries. -- Source: https://threatdeck.net/detections/ . Hunting queries are starting points: tune before alerting. Defensive use only. -- ATT&CK ids are MITRE ATT&CK Enterprise v20.1. Adapted rules keep their original licence (see attribution lines). -- Bedrock model-access enablement APIs called with a long-term access key -- id: llmjacking-bedrock-model-access-apis-from-access-key | maturity: alert | techniques: LLM10, AML.T0034, AML.T0012, AML.T0040 -- MITRE ATT&CK: T1078.004, T1496.004 -- log source: AWS CloudTrail Lake event data store (management events) -- page: https://threatdeck.net/detections/llmjacking-bedrock-model-access-apis-from-access-key/ -- source: https://permiso.io/blog/exploiting-hosted-models -- source: https://sysdig.com/blog/growing-dangers-of-llmjacking/ -- source: https://docs.aws.amazon.com/bedrock/latest/userguide/logging-using-cloudtrail.html -- source: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-limitations.html SELECT eventTime, eventName, awsRegion, sourceIPAddress, userAgent, errorCode, userIdentity.arn AS principal, userIdentity.accessKeyId AS access_key_id FROM $EDS_ID WHERE eventSource = 'bedrock.amazonaws.com' AND eventName IN ('GetFoundationModelAvailability', 'PutUseCaseForModelAccess', 'GetUseCaseForModelAccess', 'CreateFoundationModelAgreement', 'PutFoundationModelEntitlement', 'ListFoundationModelAgreementOffers') AND userIdentity.accessKeyId LIKE 'AKIA%' AND eventTime > date_add('day', -30, now()) ORDER BY eventTime DESC -- Bedrock reconnaissance burst: model, availability and logging checks in one hour -- id: llmjacking-bedrock-recon-sequence | maturity: hunt | techniques: LLM10, AML.T0034, AML.T0040, AML.T0069 -- MITRE ATT&CK: T1526, T1078.004 -- log source: AWS CloudTrail Lake event data store (management events) -- page: https://threatdeck.net/detections/llmjacking-bedrock-recon-sequence/ -- source: https://sysdig.com/blog/llmjacking-stolen-cloud-credentials-used-in-new-ai-attack/ -- source: https://sysdig.com/blog/growing-dangers-of-llmjacking/ -- source: https://permiso.io/blog/exploiting-hosted-models -- source: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-limitations.html SELECT userIdentity.arn AS principal, sourceIPAddress, date_trunc('hour', eventTime) AS hour_bucket, count(DISTINCT eventName) AS distinct_apis, array_agg(DISTINCT eventName) AS apis, count(*) AS calls FROM $EDS_ID WHERE eventSource = 'bedrock.amazonaws.com' AND eventType = 'AwsApiCall' AND eventName IN ('ListFoundationModels', 'GetFoundationModelAvailability', 'ListFoundationModelAgreementOffers', 'ListInferenceProfiles', 'GetModelInvocationLoggingConfiguration', 'GetUseCaseForModelAccess', 'InvokeModel', 'InvokeModelWithResponseStream', 'Converse', 'ConverseStream') AND eventTime > date_add('day', -7, now()) GROUP BY userIdentity.arn, sourceIPAddress, date_trunc('hour', eventTime) HAVING count(DISTINCT eventName) >= 3 AND count_if(eventName IN ('GetModelInvocationLoggingConfiguration', 'GetFoundationModelAvailability', 'ListFoundationModelAgreementOffers')) > 0 ORDER BY distinct_apis DESC, calls DESC -- Bedrock calls from a long-term access key with a browser, empty or scripting user agent -- id: llmjacking-bedrock-access-key-unusual-user-agent | maturity: hunt | techniques: LLM10, AML.T0034, AML.T0012 -- MITRE ATT&CK: T1078.004, T1496.004 -- log source: AWS CloudTrail Lake event data store (management events) -- page: https://threatdeck.net/detections/llmjacking-bedrock-access-key-unusual-user-agent/ -- source: https://permiso.io/blog/exploiting-hosted-models -- source: https://docs.aws.amazon.com/bedrock/latest/userguide/logging-using-cloudtrail.html SELECT userIdentity.accessKeyId AS access_key_id, userIdentity.arn AS principal, userAgent, count(*) AS calls, count(DISTINCT eventName) AS distinct_apis, array_agg(DISTINCT sourceIPAddress) AS source_ips, min(eventTime) AS first_seen, max(eventTime) AS last_seen FROM $EDS_ID WHERE eventSource = 'bedrock.amazonaws.com' AND eventType = 'AwsApiCall' AND userIdentity.accessKeyId LIKE 'AKIA%' AND (userAgent IS NULL OR userAgent = '' OR userAgent LIKE 'Mozilla/%' OR userAgent LIKE 'axios/%' OR userAgent LIKE '%aiohttp%' OR userAgent LIKE 'python-urllib3/%') AND eventTime > date_add('day', -30, now()) GROUP BY userIdentity.accessKeyId, userIdentity.arn, userAgent ORDER BY calls DESC -- Bedrock invocation volume far above a principal's own baseline -- id: llmjacking-bedrock-invocation-volume-spike | maturity: hunt | techniques: LLM10, AML.T0034, AML.T0040 -- MITRE ATT&CK: T1496.004 -- log source: AWS CloudTrail Lake event data store (management events) -- page: https://threatdeck.net/detections/llmjacking-bedrock-invocation-volume-spike/ -- source: https://sysdig.com/blog/growing-dangers-of-llmjacking/ -- source: https://docs.aws.amazon.com/bedrock/latest/userguide/logging-using-cloudtrail.html -- source: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-limitations.html SELECT h.principal, h.hour_bucket, h.invocations, h.models, h.regions, b.baseline_avg, b.baseline_hours FROM ( SELECT userIdentity.arn AS principal, date_trunc('hour', eventTime) AS hour_bucket, count(*) AS invocations, count(DISTINCT element_at(requestParameters, 'modelId')) AS models, count(DISTINCT awsRegion) AS regions FROM $EDS_ID WHERE eventSource = 'bedrock.amazonaws.com' AND eventType = 'AwsApiCall' AND eventName IN ('InvokeModel', 'InvokeModelWithResponseStream', 'Converse', 'ConverseStream') AND errorCode IS NULL AND eventTime > date_add('day', -1, now()) GROUP BY userIdentity.arn, date_trunc('hour', eventTime) ) h LEFT JOIN ( SELECT principal, avg(invocations) AS baseline_avg, count(*) AS baseline_hours FROM ( SELECT userIdentity.arn AS principal, date_trunc('hour', eventTime) AS hour_bucket, count(*) AS invocations FROM $EDS_ID WHERE eventSource = 'bedrock.amazonaws.com' AND eventType = 'AwsApiCall' AND eventName IN ('InvokeModel', 'InvokeModelWithResponseStream', 'Converse', 'ConverseStream') AND errorCode IS NULL AND eventTime > date_add('day', -14, now()) AND eventTime <= date_add('day', -1, now()) GROUP BY userIdentity.arn, date_trunc('hour', eventTime) ) past GROUP BY principal ) b ON h.principal = b.principal WHERE h.invocations > 100 AND (b.baseline_avg IS NULL OR h.invocations > 5 * b.baseline_avg) ORDER BY h.invocations DESC -- One source IP using several AWS principals against Bedrock -- id: llmjacking-bedrock-many-keys-one-source-ip | maturity: hunt | techniques: AML.T0140, LLM10, AML.T0034, AML.T0012 -- MITRE ATT&CK: T1496.004, T1078.004 -- log source: AWS CloudTrail Lake event data store (management events, ideally organization-wide) -- page: https://threatdeck.net/detections/llmjacking-bedrock-many-keys-one-source-ip/ -- source: https://sysdig.com/blog/llmjacking-stolen-cloud-credentials-used-in-new-ai-attack/ -- source: https://permiso.io/blog/exploiting-hosted-models -- source: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-limitations.html SELECT sourceIPAddress, count(DISTINCT userIdentity.arn) AS principals, count(DISTINCT recipientAccountId) AS accounts, count(*) AS calls, array_agg(DISTINCT userAgent) AS user_agents, min(eventTime) AS first_seen, max(eventTime) AS last_seen FROM $EDS_ID WHERE eventSource = 'bedrock.amazonaws.com' AND eventType = 'AwsApiCall' AND eventName IN ('InvokeModel', 'InvokeModelWithResponseStream', 'Converse', 'ConverseStream') AND eventTime > date_add('day', -7, now()) GROUP BY sourceIPAddress HAVING count(DISTINCT userIdentity.arn) >= 3 ORDER BY principals DESC, calls DESC -- Burst of Bedrock guardrail interventions from one principal and source -- id: bedrock-guardrail-intervention-burst | maturity: hunt | techniques: LLM01, AML.T0054, AML.T0051 -- MITRE ATT&CK: T1699 -- log source: AWS CloudTrail Lake event data store with Bedrock guardrail data events (AWS::Bedrock::Guardrail) -- page: https://threatdeck.net/detections/bedrock-guardrail-intervention-burst/ -- source: https://docs.aws.amazon.com/bedrock/latest/userguide/logging-using-cloudtrail.html -- source: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-limitations.html -- source: https://github.com/elastic/detection-rules/blob/main/rules/integrations/aws_bedrock/aws_bedrock_guardrails_multiple_violations_by_single_user.toml SELECT userIdentity.arn AS principal, sourceIPAddress, date_trunc('hour', eventTime) AS hour_bucket, count(*) AS interventions, array_agg(DISTINCT element_at(requestParameters, 'source')) AS sources FROM $EDS_ID WHERE eventSource = 'bedrock.amazonaws.com' AND eventName = 'ApplyGuardrail' AND eventCategory = 'Data' AND element_at(responseElements, 'action') = 'GUARDRAIL_INTERVENED' AND eventTime > date_add('day', -7, now()) GROUP BY userIdentity.arn, sourceIPAddress, date_trunc('hour', eventTime) HAVING count(*) >= 20 ORDER BY interventions DESC