BeyondTrust - Secure Remote Access and Privileged Access Management

Executive Summary

This guide offers further documentation on the security risks introduced by the authentication method AWS launched in July 2025 for Amazon Bedrock. Part 1 of this series documented the risks of AWS Bedrock API keys: phantom IAM users with administrative permissions, the misleading scope of AmazonBedrockLimitedAccess, and LLMjacking exposure of up to $18,000/day per region. Part 2 will cover detection, prevention, incident response, and migration to STS.

Detection Strategies

CloudTrail is the primary detection layer for Bedrock API key abuse. This section covers detection signals, events to monitor, and deployment guidance for CloudWatch, EventBridge, and SIEM platforms.

The Primary Signal: callWithBearerToken

When recorded in CloudTrail, every Bedrock API key request carries `additionalEventData.callWithBearerToken = true`. SigV4-authenticated requests do not. The field is the definitive signal for both long-term and short-term keys.

The following table maps the highest-priority alerting scenarios derived from these events to severity and response times:

CloudTrail Event

Severity

Action Required

Response Time

CreateAccessKey on BedrockAPIKey-* user

CRITICAL

Investigate immediately

<5 minutes

callWithBearerToken=true from unknown IP

HIGH

Verify legitimacy

<15 minutes

CreateServiceSpecificCredential for Bedrock

MEDIUM

Audit & document

<1 hour

CreateUser with BedrockAPIKey-* prefix

MEDIUM

Audit & document

<1 hour

callWithBearerToken=true during off-hours

MEDIUM

Review patterns

<1 hour

NA

Deployment: CloudWatch Logs Insights

If you use AWS-native monitoring without an external SIEM, this CloudWatch Logs Insights query surfaces all Bedrock API key activity from CloudTrail:

fields @timestamp, userIdentity.principalId, sourceIPAddress, eventName | filter additionalEventData.callWithBearerToken = true | stats count() by eventName, userIdentity.principalId | sort count desc

Set a CloudWatch alarm that triggers when this query returns more than 100 results per hour. Adjust the threshold based on your environment's normal Bedrock API key usage volume.

BKS provides this query at `detections/cloudwatch-insights/bearer-token-usage.txt`.


Deployment: EventBridge

EventBridge provides a universal routing mechanism that can send alerts to SNS topics (email/SMS), Lambda functions (custom automation), CloudWatch Log Groups (centralized logging), or third-party SIEMs via EventBridge API destinations.

The following pattern is the visibility baseline. It matches every Bedrock API call authenticated with a bearer token (long-term ABSK or short-term bedrock-api-key-) on the runtime APIs captured by default (InvokeModel, InvokeModelWithResponseStream, Converse, ConverseStream):

{"source": ["aws.bedrock"],"detail-type": ["AWS API Call via CloudTrail"],"detail": {"additionalEventData": {"callWithBearerToken": [true]}}}

For the privilege-escalation pivot called out earlier, pair the visibility baseline above with the IAM-lifecycle pattern below. It fires on every iam:CreateAccessKey targeting a BedrockAPIKey-* user. In most environments there is no legitimate reason for that combination, so any match warrants immediate response:

{"source": ["aws.iam"],"detail-type": ["AWS API Call via CloudTrail"],"detail": {"eventSource": ["iam.amazonaws.com"],"eventName": ["CreateAccessKey"],"requestParameters": {"userName": [{"prefix": "BedrockAPIKey-"}]}}}

If you don't have full SIEM integration yet, an EventBridge rule routing to an SNS topic provides immediate alerting with minimal setup.

BKS provides five EventBridge patterns at detections/eventbridge/ covering Bedrock API key usage and creation, phantom user creation, AKIA escalation, and console-login pivot.

Deployment: Generic SIEM

For any SIEM platform that ingests CloudTrail events, the following detection rules provide a starting point.

Baseline API key usage detection:

filter: additionalEventData.callWithBearerToken = truethreshold: adjust based on environment baselineseverity: medium (escalate if source IP is outside known ranges)

Privilege escalation detection:

filter: eventName = "CreateAccessKey"AND requestParameters.userName STARTS WITH "BedrockAPIKey-"severity: highthreshold: any occurrence

Anomalous usage detection:

filter: additionalEventData.callWithBearerToken = trueAND sourceIPAddress NOT IN [known_corporate_ranges]AND eventTime OUTSIDE [normal_operating_hours]severity: high

Bedrock-specific signals to weight heavily when tuning: legitimate traffic typically uses AWS SDK user agents and is `InvokeModel`-heavy; observed LLMjacking traffic uses generic clients (`python-requests`, `aiohttp`, `curl`) and includes destructive actions, like `DeleteGuardrail` or `DeleteModel`.

BKS provides six Sigma rules at `detections/sigma/`, two CloudTrail Lake queries at `detections/cloudtrail-lake/`, and two Athena queries at `detections/athena/` covering the same patterns described in the rules above.

Defense Controls

Service Control Policies

Service Control Policies (SCPs) are the primary preventive control for Bedrock API key risks. The appropriate SCP depends on whether you need Bedrock API keys at all.

If you don't use Bedrock API keys, deploy a lockdown SCP that denies both `iam:CreateServiceSpecificCredential` (creation) and `bedrock:CallWithBearerToken` (usage) across the organization.

Incident Response

Long-term Key Compromise

Three response options for a compromised long-term Bedrock API key, ordered from fastest to most thorough:

Option 1: Inline deny policy (fastest)

Attach an inline deny policy to the phantom user. This blocks all Bedrock API key usage for that user within seconds, without needing to identify the specific credential ID:

Migration to AWS STS

STS temporary credentials are the recommended replacement. They expire in 1-12 hours, create no IAM users, use SigV4 signing, and scope through IAM role policies. They eliminate the entire class of risks in this guide: phantom users, policy scoping gaps, privilege escalation, bearer-token exposure.

Assume a role that has the necessary Bedrock permissions, export the returned temporary credentials, and use Bedrock through any standard AWS SDK or CLI:

# Assume a role with Bedrock permissions aws sts assume-role \ --role-arn arn:aws:iam::ACCOUNT:role/BedrockRole \ --role-session-name bedrock-session \ --duration-seconds 3600 # Export the temporary credentials export AWS_ACCESS_KEY_ID=ASIA... export AWS_SECRET_ACCESS_KEY=... export AWS_SESSION_TOKEN=... # Use Bedrock normally aws bedrock-runtime converse \  --model-id us.anthropic.claude-opus-4-7 \  --messages '[{"role":"user","content":[{"text":"hello"}]}]'

If you cannot fully migrate from Bedrock API keys, these controls reduce risk:

  • Short-term keys only: 12-hour maximum to avoid phantom user creation.

  • CloudTrail alerts: monitor all API key usage through alerts on the callWithBearerToken signal.

  • SCPs against escalation: block IAM access key creation on phantom users to prevent the privilege escalation path.

  • Frequent rotation: rotate keys monthly at minimum.

  • Model invocation logging: enable as both a detective control and an attacker deterrent.

Among these, the SCP denying `bedrock:CallWithBearerToken` is the highest-impact control.

Immediate Action Guide

Step 1: Audit for Phantom Users

Run the Bedrock Keys Security (BKS) toolkit to scan the account for phantom IAM users:

bks scan

Alternatively, query IAM directly:

aws iam list-users | grep BedrockAPIKey

If either command returns results, phantom users exist in the account. For each one found, check its credential status:

aws iam list-service-specific-credentials --user-name BedrockAPIKey-xxxaws iam list-access-keys --user-name BedrockAPIKey-xxx

The results determine the risk level and required action:

  • Active service-specific credentials present: the phantom user is operational and the associated Bedrock API key is still in use.

  • No credentials remain: the user is an orphaned phantom that is safe to clean up using bks cleanup.

  • IAM access keys (AKIA...) present: the privilege-escalation path is exploited or prepared. Investigate immediately.


Step 2: Deploy Detection

Configure CloudTrail monitoring for four event patterns:

  • API key creation: `CreateServiceSpecificCredential` events with `serviceName = bedrock.amazonaws.com`.

  • API key usage: any Bedrock action where `additionalEventData.callWithBearerToken = true`.

  • Phantom user creation: `CreateUser` events where the `userName` starts with `BedrockAPIKey-`.

  • Privilege escalation (CRITICAL): `CreateAccessKey` events targeting `BedrockAPIKey-*` users.

The Detection Strategies section provides query templates for CloudWatch Logs Insights, EventBridge, and generic SIEM platforms.


Step 3: Implement Prevention

If you don't need Bedrock API keys, deploy an SCP that denies both `iam:CreateServiceSpecificCredential` and `bedrock:CallWithBearerToken` across the organization (template: https://github.com/BeyondTrust/bedrock-keys-security/blob/main/scps/1-block-all-keys.json).


Step 4: Restrict If Required

If you need Bedrock API keys:

  • CloudTrail alerts: monitor all usage through alerts on the callWithBearerToken signal.

  • Monthly rotation: rotate keys monthly at minimum.

  • Migrate to STS where feasible (see Migration to AWS STS).

Conclusion

Bedrock API keys solve a real integration problem but introduce a class of risks that most organizations are not equipped to detect by default:

  • Phantom IAM users persist beyond the credential lifecycle, accumulating in accounts with no automated cleanup.

  • A privilege-escalation pivot exists through iam:CreateAccessKey on phantom users, exposing the full policy scope outside the Bedrock authentication boundary.

The detection signals, preventive SCPs and incident response procedures in this guide cover the full lifecycle. Highest-impact controls in priority order:

  • AWS STS temporary credentials. The recommended replacement; eliminates the entire class of risk documented across both parts of this guide.

  • SCP denying bedrock:CallWithBearerToken. The single highest-impact preventive control where Bedrock API keys are unavoidable.

  • SCP denying iam:CreateAccessKey on BedrockAPIKey-* users. Closes the privilege-escalation pivot.

  • CloudTrail alerting on additionalEventData.callWithBearerToken = true. The foundational detection signal; layer higher-confidence rules on top.

For organizations with active Bedrock API key usage, run bks scan first to discover existing phantom IAM users, then implement detection before deploying SCPs that may break in-flight workflows.

Explore More Research from Phantom Labs

Phantom Labs™ researchers "think like attackers" to expose privilege escalation paths and identity attack vectors, helping defenders proactively uncover misconfigurations and detect threats in complex hybrid and cloud environments. Using advanced graph modeling, Phantom Labs researchers map attack paths to privileged access across cloud and on-premises infrastructure.