CloudTrail Lake SQLHunting query: tune before alertingCloud AI abuse: Amazon Bedrock (LLMjacking)
One source IP using several AWS principals against Bedrock
LLMjacking operators run reverse proxies (Sysdig observed OAI Reverse Proxy) that rotate many stolen keys behind one service, so a single source address invokes Bedrock with several different principals or accounts. Run this against an organization-level event data store to see cross-account reuse.
- Log source
- AWS CloudTrail Lake event data store (management events, ideally organization-wide)
- Techniques
- AML.T0140 Centralized AI Service Request Routing · LLM10 Unbounded Consumption · AML.T0034 Cost Harvesting · AML.T0012 Valid Accounts
- MITRE ATT&CK
- T1496.004Cloud Service HijackingT1078.004Cloud Accounts
- Reviewed
- 2026-11-10
Query · CloudTrail Lake SQL
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 Other platforms
Microsoft Sentinel / Defender (KQL)
Microsoft Sentinel / Log Analytics: AWSCloudTrail (Amazon Web Services S3 connector)
AWSCloudTrail
| where TimeGenerated > ago(7d)
| where EventSource == "bedrock.amazonaws.com" and EventTypeName == "AwsApiCall"
| where EventName in (dynamic(["InvokeModel", "InvokeModelWithResponseStream", "Converse", "ConverseStream"]))
| summarize Principals = dcount(UserIdentityArn), Accounts = dcount(RecipientAccountId), Calls = count(),
UserAgents = make_set(UserAgent, 20), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by SourceIpAddress
| where Principals >= 3
| order by Principals desc, Calls desc Splunk (SPL)
Splunk: AWS CloudTrail (Splunk Add-on for AWS, sourcetype aws:cloudtrail) · Set index= to the index that holds your CloudTrail data.
index=aws sourcetype=aws:cloudtrail eventSource="bedrock.amazonaws.com" eventType="AwsApiCall"
eventName IN ("InvokeModel", "InvokeModelWithResponseStream", "Converse", "ConverseStream") earliest=-7d
| stats dc(userIdentity.arn) AS principals dc(recipientAccountId) AS accounts count AS calls
values(userAgent) AS user_agents min(_time) AS first_seen max(_time) AS last_seen BY sourceIPAddress
| where principals >= 3
| convert ctime(first_seen) ctime(last_seen)
| sort - principals - calls Expected false positives
- Corporate NAT gateways, VPN egress or shared CI runners where many identities share an address
- AWS service principals and VPC endpoints that report AWS-internal source addresses
Sources
- Sysdig: LLMjacking — stolen cloud credentials used in new AI attack (May 2024)
- Permiso: Exploiting hosted models — LLMjacking on Amazon Bedrock (Oct 2024)
- AWS docs: CloudTrail Lake SQL constraints (Trino SQL)
Reviewed against vendor documentation, not tested in your environment. Defensive use only.