AWS Bedrock AgentCore Runtime Command Accesses Instance Metadata Credentials

Last updated 7 days ago on 2026-11-25
Created 7 days ago on 2026-11-25

About

Identifies an Amazon Bedrock AgentCore Runtime command that attempts to retrieve IAM execution-role credentials from the microVM metadata service (MMDS), or command output that contains an AWS temporary credential response. The InvokeAgentRuntimeCommand API runs shell commands as root inside Runtime and Harness microVMs, bypassing the agent, model, tools, and guardrails. An attacker with permission to invoke this API can read the attached execution role's credentials from MMDS and reuse them outside AgentCore.
Tags
Domain: CloudData Source: AWSData Source: Amazon Web ServicesPlatform: AWSData Source: AWS BedrockData Source: Amazon BedrockService: AWS BedrockUse Case: Threat DetectionTactic: Credential AccessThreat: IMDS Credential TheftThreat: Unauthorized AI UsageRule Type: ES|QLDomain: GenAIMitre Atlas: AML.T0098Language: esql
Severity
high
Risk Score
73
MITRE ATT&CK™

Credential Access (TA0006)(external, opens in a new tab or window)

False Positive Examples
Authorized security testing or troubleshooting may query the metadata service or print temporary credentials. Confirm the caller and purpose. Production workloads should not retrieve or return raw execution-role credentials.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

aws_bedrock_agentcore(external, opens in a new tab or window)

Query
text code block:
from logs-aws_bedrock_agentcore.runtime_logs-* metadata _id, _version, _index | where ( event.action == "invoke-agent-runtime-command" and TO_LOWER(process.command_line) like ( "*169.254.169.254*", "*fd00:ec2::254*", "*/latest/api/token*", "*/latest/meta-data/iam*", "*security-credentials*", "*x-aws-ec2-metadata-token*" ) ) or ( message like "*AccessKeyId*" and message like "*SecretAccessKey*" and message like ("*Token*", "*SessionToken*") ) | keep _id, _version, _index, @timestamp, aws.*, cloud.*, event.*, message, process.command_line

Install detection rules in Elastic Security

Detect AWS Bedrock AgentCore Runtime Command Accesses Instance Metadata Credentials in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).