heroui logo

AWS Bedrock AgentCore Code Interpreter Accesses Instance Metadata Credentials

Elastic Detection Rules

View Source
Summary
This rule detects when AWS Bedrock AgentCore Code Interpreter sessions submit code or shell commands that attempt to retrieve IAM execution-role credentials from the microVM metadata service (MMDS) or return AWS temporary credentials. It monitors the aws_bedrock_agentcore.code_interpreter_application_logs data stream for Code Interpreter invocations and inspects: (1) process.command_line for references to MMDS endpoints (169.254.169.254 or IPv6 equivalents) or metadata paths (latest/api/token, latest/meta-data/iam, security-credentials, x-aws-ec2-metadata-token); (2) the Code Interpreter request_payload.code for similar MMDS references; and (3) stdout or stderr for credential indicators (AccessKeyId, SecretAccessKey, Token, SessionToken). A match indicates potential credential access via the execution role attached to the interpreter, which could allow re-use of credentials outside the sandbox. The rule uses event.ingested timestamps, triggers on InvokeCodeInterpreter, and has a high severity with a risk score of 73. It is designed to help identify unauthorized credential access originating from a Bedrock Code Interpreter and to link activity to the caller’s session and tool, enabling rapid containment and investigation.
Categories
  • Cloud
Data Sources
  • Application Log
  • Process
ATT&CK Techniques
  • T0098
  • T1552
  • T1552.005
Created: 2026-11-25