-
Notifications
You must be signed in to change notification settings - Fork 678
[New Rule] AWS Bedrock API Key Phantom User Activity Outside Bedrock #6385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bryans3c
wants to merge
2
commits into
main
Choose a base branch
from
rule/aws-bedrock-phantom-user-activity-outside-bedrock
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
.../integrations/aws/privilege_escalation_bedrock_phantom_user_activity_outside_bedrock.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| [metadata] | ||
| creation_date = "2026/07/06" | ||
| integration = ["aws"] | ||
| maturity = "production" | ||
| updated_date = "2026/07/06" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| Identifies an Amazon Bedrock API key phantom user (an IAM user whose name starts with "BedrockAPIKey-") acting as the | ||
| caller of a non-Bedrock API request, such as IAM, STS, EC2, VPC, or KMS calls. These users are provisioned by AWS to back | ||
| a Bedrock bearer token and carry the AmazonBedrockLimitedAccess managed policy, which also grants IAM, VPC, and KMS | ||
| reconnaissance. A phantom user performing activity outside of Bedrock indicates its credentials are being used beyond | ||
| their intended scope, which is the privilege-escalation path realized: an attacker who created standard IAM access keys | ||
| for the phantom user is now using them for reconnaissance or lateral movement outside the Bedrock authentication boundary. | ||
| """ | ||
| false_positives = [ | ||
| """ | ||
| Bedrock API key phantom users are not intended to perform non-Bedrock activity, so matches should be rare. If a phantom | ||
| user is deliberately repurposed for other tasks, confirm the principal in "aws.cloudtrail.user_identity.arn" and the | ||
| activity, and exclude the identity after validation. | ||
| """, | ||
| ] | ||
| from = "now-30m" | ||
| language = "esql" | ||
| license = "Elastic License v2" | ||
| name = "AWS Bedrock API Key Phantom User Activity Outside Bedrock" | ||
| note = """## Triage and analysis | ||
|
|
||
| ### Investigating AWS Bedrock API Key Phantom User Activity Outside Bedrock | ||
|
|
||
| Amazon Bedrock API key phantom users ("BedrockAPIKey-*") exist only to back a Bedrock bearer token and carry the AmazonBedrockLimitedAccess managed policy. That policy grants Bedrock control-plane actions plus IAM, VPC, and KMS reconnaissance, so if an attacker adds standard IAM access keys (or a console login) to the phantom user, those credentials can be used for reconnaissance and lateral movement well beyond Bedrock. | ||
|
|
||
| This rule fires when a "BedrockAPIKey-*" user is the caller of an API request whose service is not Bedrock. Because the phantom user has no legitimate reason to act outside Bedrock, such activity is the privilege-escalation path realized. | ||
|
|
||
| ### Possible investigation steps | ||
|
|
||
| - Review "aws.cloudtrail.user_identity.arn", "event.provider", and "event.action" to understand what non-Bedrock activity the phantom user performed. | ||
| - Inspect "source.ip"/"source.as.number" and "user_agent.original", and determine whether the phantom user holds IAM access keys or a login profile (the escalation pivot). | ||
| - Review the full sequence of the phantom user's actions for reconnaissance (IAM/EC2/STS enumeration) or attempts to access other resources. | ||
| - Correlate with the credential-addition event (CreateAccessKey/CreateLoginProfile on the same user). | ||
|
|
||
| ### False positive analysis | ||
|
|
||
| - Phantom users are not meant to perform non-Bedrock activity, so this should be rare. Validate any intentional repurposing before excluding the identity. | ||
|
|
||
| ### Response and remediation | ||
|
|
||
| - If unauthorized, disable and remove the phantom user's IAM access keys and login profile, and delete the phantom user after preserving forensic evidence. | ||
| - Review the account for resources the phantom user may have accessed or modified. | ||
| - Deploy an SCP denying "iam:CreateAccessKey" and "iam:CreateLoginProfile" on "arn:aws:iam::*:user/BedrockAPIKey-*" to prevent the pivot. | ||
| """ | ||
| references = [ | ||
| "https://www.beyondtrust.com/blog/entry/aws-bedrock-security-guide-api-keys-detection-response", | ||
| "https://www.beyondtrust.com/blog/entry/aws-bedrock-security-api-keys", | ||
| "https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html", | ||
| ] | ||
| risk_score = 73 | ||
| rule_id = "56788ae8-794b-4ade-affd-534aa5c9e28d" | ||
| setup = "This rule requires AWS CloudTrail logs ingested via the Elastic AWS integration. See https://docs.elastic.co/integrations/aws/cloudtrail for setup details." | ||
| severity = "high" | ||
| tags = [ | ||
| "Domain: Cloud", | ||
| "Domain: LLM", | ||
| "Data Source: AWS", | ||
| "Data Source: AWS CloudTrail", | ||
| "Data Source: Amazon Web Services", | ||
| "Data Source: AWS IAM", | ||
| "Data Source: Amazon Bedrock", | ||
| "Use Case: Threat Detection", | ||
| "Tactic: Privilege Escalation", | ||
| "Resources: Investigation Guide", | ||
| ] | ||
| timestamp_override = "event.ingested" | ||
| type = "esql" | ||
|
|
||
| query = ''' | ||
| FROM logs-aws.cloudtrail-* METADATA _id, _version, _index | ||
| | WHERE aws.cloudtrail.user_identity.arn RLIKE """.*:user/BedrockAPIKey-.*""" | ||
|
|
||
| AND event.provider != "bedrock.amazonaws.com" | ||
| AND event.provider != "signin.amazonaws.com" | ||
|
Comment on lines
+79
to
+81
|
||
| | KEEP _id, _version, _index, @timestamp, aws.*, cloud.*, event.*, source.*, user.*, user_agent.* | ||
| ''' | ||
|
|
||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
| [[rule.threat.technique]] | ||
| id = "T1078" | ||
| name = "Valid Accounts" | ||
| reference = "https://attack.mitre.org/techniques/T1078/" | ||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1078.004" | ||
| name = "Cloud Accounts" | ||
| reference = "https://attack.mitre.org/techniques/T1078/004/" | ||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0004" | ||
| name = "Privilege Escalation" | ||
| reference = "https://attack.mitre.org/tactics/TA0004/" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.