
Incident response guide for AWS CloudTrail investigations – Part 2 | Amazon Web Services
Part 2 of AWS's CloudTrail incident-response guide walks through a real multi-stage attack: an SSRF flaw in a web app reached the EC2 IMDSv1 endpoint to steal temporary credentials for an over-privileged "webdev" role, which the attacker then used to probe IAM (failed CreateUser), log into the console without MFA, and pivot cross-Region (us-east-1 to us-east-2) to enumerate and actively invoke the Amazon Nova Pro model via Bedrock's Converse API. It details the specific CloudTrail fields that expose each stage (userIdentity, readOnly, awsRegion, ec2RoleDelivery, sessionCredentialFromConsole, invokedBy), gives an incident-response checklist, and closes with hardening takeaways: enforce IMDSv2, least-privilege EC2 roles, cross-Region detection parity, Bedrock model invocation logging, and GuardDuty AI Protection.
What to do — the IMDSv2 command and its two flags
The summary names "enforce IMDSv2" but not the command or why both flags matter:
aws ec2 modify-instance-metadata-options --http-tokens required --http-put-response-hop-limit 1--http-tokens required forces callers to present a session token obtained via a PUT request, which a basic SSRF cannot perform — this alone would have stopped the attack at step one. --http-put-response-hop-limit 1 keeps the metadata response on the instance, so a request arriving from a container or proxy one hop away never receives credentials. The log field ec2RoleDelivery: "1.0" is the explicit confirmation that IMDSv1 was in use.
For persistence hunting, search the compromised session for these IAM write events specifically: CreateUser, CreateRole, CreateAccessKey, AttachRolePolicy. The failed adm1n CreateUser is the known start; confirm nothing similar succeeded. Correlate CloudTrail timestamps with VPC Flow Logs and application logs on source IP 75.3.231.105. Use IAM Access Analyzer to find and remove the unused permissions that let a web role reach Bedrock.
Forensic deception indicators (not in the summary)
The page's most transferable content is a set of three impersonation tricks threat actors use to mislead investigators — independent of this scenario:
- IAM user named
root: attackers create an ordinary IAM user calledrootto masquerade as the account root user. Distinguish them by thetypefield inuserIdentity, not the name. - Homoglyph role names: a role named
AWSServiceRoIeforSupportuses a capitalIin place of the lowercaselin "Role" to imitate the legitimateAWSServiceRoleForSupportservice-linked role. Actions look AWS-driven but are not. HIDDEN_DUE_TO_SECURITY_REASONSas a real username: CloudTrail normally substitutes this string inuserNamewhen a console sign-in fails on bad input. Attackers register it as an actual username so investigators assume the name was auto-redacted. Usually paired with aCreateUser/CreateRoleevent.
Caveats the page states
CloudTrail records the Converse call and token counts (944 input / 126 output here) but not prompt or response content — only Bedrock model invocation logging captures that. If it wasn't enabled before the incident, that content is unrecoverable; enable it now. The absence of userIdentity.invokedBy is itself evidence: it confirms a principal called Bedrock directly rather than via a service-linked workflow — a distinction that will matter more as agentic Bedrock workloads grow.
Organisations named here
- Amazon Nova Pro
Technologies named here
- Amazon EC2 Instance Metadata Service version 1
- AWS CloudTrail
- Amazon Bedrock
- AWS IAM Access Analyzer
- Amazon Bedrock model invocation logging
- AWS IAM webdev role
- Amazon Bedrock AgentCore Observability
- Web application on Amazon EC2
- Amazon GuardDuty AI Protection
- Amazon CloudWatch
- VPC Flow Logs
- Amazon Athena
- AWS Security Hub
- AWS Security Incident Response
- AWS
- AWS Bedrock
- AWS IAM
Techniques named here
- IMDSv1 credential harvesting
- Permission testing / boundary probing
- Service pivoting
- Region hopping / cross-Region defense evasion
- Console access without MFA
- AI service reconnaissance
- Active model exploitation
- Role/user name imitation
- Root user impersonation
- HIDDEN_DUE_TO_SECURITY_REASONS username spoofing
- Prompt Injection
- SSRF
Related in Cloud & Infra


Orca Security: GenAI Risks in Cloud Environments
.png)
Google API keys keep working after you delete them
