Volume 11 · Chapter 9 — Banking Production Support and Troubleshooting

Security Incident Response on AWS

Goutham Mayaluri 4 min read AWSCloudSecurityBankingTroubleshootingProduction

9.1 Introduction

Security incidents - compromised credentials, a breached instance, exposed data - demand a specific response, and the exam tests knowing the AWS mechanics of detection, containment, eradication, and recovery. This chapter covers security incident response using the detective and automation services from earlier volumes.

9.2 Detection and the Response Lifecycle

Security incident response follows a lifecycle:detect,contain,eradicate,recover, andlearn. Detection comes fromGuardDuty(threat findings from logs),CloudTrail(the audit trail of what was done),Config(configuration changes), andSecurity Hub(aggregated findings) - often a GuardDuty finding (compromised credentials, crypto-mining, unusual API calls) is the trigger. The key principle: because CloudTrail records everything, you can reconstruct exactly what a compromised identity did, and because these findings can emit events, containment can be automated. Preparation - having logging, detection, and runbooks in place before an incident - is what makes fast response possible.

flowchart LR
  Detect[Detect - GuardDuty/CloudTrail/Config/Security Hub] --> Contain[Contain - isolate SG, revoke sessions, disable keys]
  Contain --> Erad[Eradicate - rotate credentials, patch, remove access]
  Erad --> Recover[Recover - restore from clean backup, redeploy]
  Recover --> Learn[Learn - forensics via Detective, postmortem]
  EB[EventBridge] -.automate containment.-> Contain

9.3 Containing Compromised Credentials and Instances

Forcompromised credentials(leaked access keys, a compromised role): immediately deactivate or delete the access keys, revoke active sessions (attach a deny-all policy or use the role’s session revocation), rotate the credentials, and review CloudTrail for what the identity did. This is a strong argument for using short-lived role credentials (nothing long-lived to leak). For acompromised EC2 instance: isolate it by moving it to a restrictive “quarantine” security group (no inbound/outbound except forensics), detach it from Auto Scaling so it isn’t terminated, snapshot its EBS volume and capture memory for forensics, and then replace it from a clean golden AMI. The exam pattern: isolate with a restrictive security group, preserve evidence (snapshot), and rotate/replace - contain first, investigate on a copy.

9.4 Automated Containment and Recovery

Containment can be automated for speed. A GuardDuty finding emits an event thatEventBridgeroutes to aLambdaorStep Functionsworkflow that automatically isolates the instance (swaps its security group), disables the compromised credential, snapshots for forensics, opens anOpsCenter/Security Hub item, and notifies responders - all in seconds, before a human is even paged.Detectivethen helps investigate root cause by visualizing the related activity.Recoveryrestores from known-clean backups (immutable, Vault-Locked) and redeploys from IaC, and thelearnphase produces a blameless postmortem. This automated detect-contain-investigate- recover pipeline is the professional-level security operations design the exam favours over manual response.

9.5 Banking Production Scenario

A bank’s GuardDuty detects anomalous API calls from a role, emitting an event. EventBridge triggers a Step Functions runbook that immediately attaches a deny-all session policy to contain the credential, isolates the associated instance into a quarantine security group, detaches it from its Auto Scaling group, snapshots its volume for forensics, opens a Security Hub finding, and pages the security team - within seconds. Analysts use Detective to trace the activity and CloudTrail to see exactly what the identity did. Because credentials are short-lived roles, the blast radius is small. Recovery redeploys clean instances from a golden AMI and restores any affected data from immutable backups. A blameless postmortem hardens the environment. This automated, evidence-preserving incident response is exactly the professional-level security operations the certification targets.

9.6 Chapter Revision Notes

  • Lifecycle: detect (GuardDuty/CloudTrail/Config/Security Hub) → contain → eradicate → recover → learn; preparation (logging, detection, runbooks) enables fast response.
  • Compromised credentials: deactivate keys, revoke sessions, rotate, review CloudTrail; short-lived role credentials limit blast radius.
  • Compromised instance: isolate with a quarantine security group, detach from Auto Scaling, snapshot for forensics, replace from a clean golden AMI - contain first, investigate on a copy.
  • Automate containment: GuardDuty → EventBridge → Lambda/Step Functions to isolate, disable credentials, snapshot, and notify in seconds; Detective for root-cause investigation.
  • Recover from immutable (Vault-Locked) backups and redeploy from IaC; finish with a blameless postmortem.