iac.htora.dev · security templates

Home/Refreshers/Incident response on AWS: refresher

Incident response on AWS

What CloudTrail records by default, how to follow a key or a role session, and the first moves for each kind of compromise.

Remember

  1. Event history keeps 90 days of management events per Region with no trail. Data events, such as S3 reads, need a trail and cost extra.
  2. AKIA is a long-term user key. ASIA is temporary; the AssumeRole event that issued it records it in responseElements.
  3. sourceIdentity names the person and survives every chained role.
  4. Revoking a role's sessions denies every credential issued before now. It does not work on service-linked roles.
  5. Identity Center role sessions last up to 12 hours after the user is disabled. Keep a deny in place that long.

Commands

Everything one key didaws cloudtrail lookup-events --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=<key>
New access keysaws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateAccessKey
Deactivate a keyaws iam update-access-key --user-name <user> --access-key-id <key> --status Inactive
Snapshot every volumeaws ec2 create-snapshots --instance-specification InstanceId=<id>

Watch out

  • Changing a security group does not end open connections. A network ACL does.
  • Termination protection does not stop an Auto Scaling group or a Spot interruption.
  • Event history is per Region. Check the ones you do not use.
Check it worked

A test access key made in a sandbox account appears in the lookup within minutes.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.