PIVTR-D
RAWS playbook · Compute and containers

Amazon Bedrock abused

The attacker uses stolen AWS credentials or an Amazon Bedrock API key to run paid models at your cost, often called LLMjacking, or to read and change agents, knowledge bases and guardrails. A typical run lists the models on offer, invokes them in several Regions, and builds up token charges before any bill shows them. Block the key or credential and deny Bedrock access first, then turn on invocation logging so later calls are recorded.

Look here

LogSearch for
CloudTrail management events (on by default)Model calls in event history. InvokeModel, InvokeModelWithResponseStream, Converse and ConverseStream are management events. Repeat per Region: aws cloudtrail lookup-events --region <region> --lookup-attributes AttributeKey=EventSource,AttributeValue=bedrock.amazonaws.com --start-time <utc-start> --end-time <utc-end>
CloudTrail, model access and loggingModel discovery, access requests and logging changes: ListFoundationModels, PutUseCaseForModelAccess, CreateFoundationModelAgreement, GetModelInvocationLoggingConfiguration, DeleteModelInvocationLoggingConfiguration, CreateProvisionedModelThroughput
CloudTrail, Bedrock API keysLong-term keys created or changed: CreateServiceSpecificCredential, ResetServiceSpecificCredential, UpdateServiceSpecificCredential. List every Bedrock key: aws iam list-service-specific-credentials --all-users --service-name bedrock.amazonaws.com
CloudTrail, agents, knowledge bases, guardrailsChanges to agents, knowledge bases and guardrails: UpdateGuardrail, DeleteGuardrail, UpdateAgent, CreateAgentActionGroup, UpdateAgentActionGroup, UpdateKnowledgeBase, CreateDataSource, UpdateDataSource
CloudTrail data events (off by default)Agent, knowledge base, flow and guardrail calls, once you add these resource types to a trail's advanced event selectors: InvokeAgent (AWS::Bedrock::AgentAlias), Retrieve and RetrieveAndGenerate (AWS::Bedrock::KnowledgeBase), InvokeFlow, ApplyGuardrail
Model invocation logs (off by default)Prompts and responses, in the log group or bucket the configuration names. The setting is per Region: aws bedrock get-model-invocation-logging-configuration --region <region>
CloudWatch AWS/BedrockCall and token volume by ModelId, per Region: Invocations, InputTokenCount, OutputTokenCount and InvocationThrottles
GuardDuty AI Protection (must be turned on; covers Bedrock and SageMaker AI)Findings for unusual model use, cost harvesting and prompt injection: Impact:IAMUser/AnomalousModelInvocation, Impact:IAMUser/CostHarvesting, Impact:IAMUser/PromptInjection.Direct

Contain

#Item
1Export Bedrock and IAM events for each Region and save the logging configuration. See Evidence
2Attach a service control policy (SCP) to the account that denies bedrock:* and bedrock-mantle:* to all but the responder role and the workloads you keep running
3Block API key calls. Attach a policy that denies bedrock:CallWithBearerToken and bedrock-mantle:CallWithBearerToken to the key's IAM user, or to the identity that generated a short-term key
4Deactivate each long-term key: aws iam update-service-specific-credential --user-name <user> --service-specific-credential-id <id> --status Inactive
5Invalidate short-term keys by denying * to the generating identity when aws:TokenIssueTime is before now. Short-term keys cannot be revoked one by one
6Contain the credential behind the calls with the IAM user access keys or EC2 instance role playbook
7Turn on invocation logging in each affected Region. The file names a log group and role or a bucket, and sets textDataDeliveryEnabled to true: aws bedrock put-model-invocation-logging-configuration --region <region> --logging-config file://logging.json

Eradicate and recover

#Item
1Restore guardrails, agents, action groups and data sources from infrastructure code
2Remove documents the attacker added to knowledge base sources, then re-sync the data source: aws bedrock-agent start-ingestion-job --knowledge-base-id <kb> --data-source-id <ds>
3Deny unused models in an SCP by foundation model Amazon Resource Name (ARN). After delete-foundation-model-agreement, the next invocation creates access again
4Limit long-term keys with an SCP on iam:CreateServiceSpecificCredential that uses these condition keys: iam:ServiceSpecificCredentialAgeDays, iam:ServiceSpecificCredentialServiceName
5Give the Legal advisor the prompts and knowledge base reads in the window for notification deadlines
6Turn on GuardDuty AI Protection and Cost Anomaly Detection before return to service
7Delete attacker long-term keys destructive. Deleting a key leaves its IAM user behind, so delete that user next: aws iam delete-service-specific-credential --user-name <user> --service-specific-credential-id <id>
8Delete attacker Provisioned Throughput destructive once its commitment term ends: aws bedrock delete-provisioned-model-throughput --provisioned-model-id <id>
Watch out
  • Invocation logs contain full prompts and responses. Bodies over 100 KB go to S3 as separate objects, and a CloudWatch Logs destination writes them only when it has an S3 location for large data. Restrict who can read them.
  • Cost Anomaly Detection reads Cost Explorer data, which lags by up to 24 hours, and needs 10 days of history for a new service. Watch the CloudWatch token metrics for the live view.
  • A deny on bedrock:CallWithBearerToken alone leaves the Mantle endpoint open. Deny both actions.
  • Provisioned Throughput cannot be deleted before its commitment term ends, so its charge continues after containment.

AWS documentation: Bedrock CloudTrail logging, model invocation logging, API keys and handling compromised keys, model access, runtime CloudWatch metrics, API operation lists; GuardDuty AI Protection and its finding types; Cost Anomaly Detection; CLI reference for the Bedrock and IAM commands used. Bedrock CloudTrail logging, model invocation logging, compromised API keys and GuardDuty AI Protection checked October 2026; other topics checked September 2026.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.