Prerequisites
- Target system, dependencies and environment configured.
Usage
Purpose
Cloud incident response breaks a lot of on-prem instincts. There's often no physical host to seize, the attacker moved through API calls rather than a network, and the "kill switch" is an IAM change, not a network cable. But the cloud also gives you something on-prem rarely does: a near-complete API audit log of everything that happened. This skill covers responding to a cloud incident on its own terms.
When to use it
Any incident where the affected assets are cloud resources — a compromised access key, a public bucket that got hit, an over-permissioned role that was abused, crypto-mining on your compute. It builds on the general IR lifecycle skills but changes how each phase works.
What's different from on-prem
- The log is the crime scene. CloudTrail / Activity Log / Cloud Audit Logs record almost every API call. Reconstruction is possible in a way it rarely is on-prem — if logging was configured beforehand (see the cloudtrail skill).
- Identity is the perimeter. The attacker usually acted as a credential or role, not from a network location. Containment centres on keys, roles, and sessions.
- Containment is an API call. You isolate by revoking credentials, attaching a deny policy, or snapshotting and quarantining an instance — not by pulling cables.
- Resources are ephemeral. An instance may be gone before you look. Snapshot before it disappears; evidence you don't capture is often unrecoverable.
Procedure
- Preserve the logs first. Confirm the audit trail is intact and protect it — an attacker with enough access may try to stop logging or delete the trail. Export/lock the relevant CloudTrail data before anything else; it's your primary evidence.
- Scope via the audit log. Reconstruct what the compromised identity did: which API calls, in which regions, against which resources, over what window.
lookup-events filtered by the principal is the starting point:aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=<principal>
Look for the tell-tale attacker actions: CreateUser, CreateAccessKey, AttachUserPolicy, CreateRole, resource creation in unusual regions.
- Contain the identity. Revoke the compromised access key, and revoke active sessions (an IAM policy that denies actions before a cutoff timestamp) — deactivating a key doesn't kill sessions already assumed from it. Detach abused permissions.
- Preserve resource evidence before it vanishes. Snapshot affected instances/volumes, and isolate rather than terminate — a terminated instance takes its evidence with it. Move it to a quarantine security group with no egress instead of deleting it.
- Hunt for cloud-native persistence — the attacker's footholds live in the control plane, not just on hosts: rogue IAM users/roles, added access keys, modified trust policies, new Lambda functions, altered
CloudTrail/logging config, resource-based policy changes, and cross-account roles.
- Eradicate and recover per the eradication skill, cloud-flavoured: remove the rogue identities and persistence, rotate all potentially-exposed credentials, close the entry vector (the leaked key, the SSRF, the public resource), and rebuild from known-good IaC.
- Check the blast radius across accounts. In a multi-account org, a compromise can pivot via assumed roles — scope beyond the single account.
Cheatsheet
aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=PRINCIPAL
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateAccessKey
CreateUser / CreateAccessKey / CreateLoginProfile (new footholds)
AttachUserPolicy / PutUserPolicy / CreateRole (privilege)
UpdateAssumeRolePolicy (backdoor trust)
StopLogging / DeleteTrail (evidence tampering)
RunInstances in unusual regions (crypto-mining)
aws iam update-access-key --access-key-id AKIA... --status Inactive
aws ec2 create-snapshot --volume-id vol-... # snapshot first
Reading the situation
- Logging was on and intact = you can reconstruct the incident precisely; the audit trail is your biggest advantage. Preserve it before the attacker can.
StopLogging/DeleteTrail in the history = the attacker tried to blind you; assume activity after that point is unlogged and widen your investigation.
- New IAM users, keys, or modified trust policies = cloud-native persistence — a deactivated key means nothing if a rogue role remains. Hunt the control plane, not just hosts.
- A deactivated key but continued attacker activity = sessions were already assumed; you must deny by timestamp, not just disable the key.
- Resources in unfamiliar regions = a classic tell (crypto-mining, staging), and easily missed if you only look where your workloads normally run.
Pitfalls
- Terminating instead of snapshotting. A terminated instance is gone with its evidence. Snapshot, then isolate.
- Deactivating a key but not revoking sessions. Credentials already assumed keep working; kill active sessions with a deny-before-timestamp policy.
- Only looking at hosts. Cloud persistence is in IAM and the control plane — rogue roles, keys, trust policies, Lambda. Missing them means the attacker stays.
- Assuming logging was configured. If the audit trail wasn't set up beforehand, reconstruction may be impossible — which is why the cloudtrail skill is a prerequisite, not an afterthought.
- Single-account tunnel vision. Assumed-role pivots cross account boundaries; scope the whole org.
References
- NIST SP 800-61r2 (incident handling) adapted to cloud
- AWS Incident Response guide / Cloud Security Incident Response whitepaper
- Cloud provider audit-log documentation (CloudTrail, Azure Activity Log, GCP Audit Logs)
- MITRE ATT&CK for Cloud
Inputs
- Relevant source code, logs, network traces, or system specifications.
Outputs
- Analysis findings, security audit report, or generated code artifacts.
1---2name: cloud-incident-response3description: Use when responding to an incident in a cloud environment where there's no server to unplug — the API-driven, identity-centric response that differs from on-prem IR.4---5678## Prerequisites9- Target system, dependencies and environment configured.1011## Usage12### Purpose1314Cloud incident response breaks a lot of on-prem instincts. There's often no physical host to seize, the attacker moved through API calls rather than a network, and the "kill switch" is an IAM change, not a network cable. But the cloud also gives you something on-prem rarely does: a near-complete API audit log of everything that happened. This skill covers responding to a cloud incident on its own terms.1516### When to use it1718Any incident where the affected assets are cloud resources — a compromised access key, a public bucket that got hit, an over-permissioned role that was abused, crypto-mining on your compute. It builds on the general IR lifecycle skills but changes how each phase works.1920### What's different from on-prem2122- **The log is the crime scene.** CloudTrail / Activity Log / Cloud Audit Logs record almost every API call. Reconstruction is possible in a way it rarely is on-prem — *if* logging was configured beforehand (see the cloudtrail skill).23- **Identity is the perimeter.** The attacker usually acted as a credential or role, not from a network location. Containment centres on keys, roles, and sessions.24- **Containment is an API call.** You isolate by revoking credentials, attaching a deny policy, or snapshotting and quarantining an instance — not by pulling cables.25- **Resources are ephemeral.** An instance may be gone before you look. Snapshot before it disappears; evidence you don't capture is often unrecoverable.2627### Procedure28291. **Preserve the logs first.** Confirm the audit trail is intact and protect it — an attacker with enough access may try to stop logging or delete the trail. Export/lock the relevant CloudTrail data before anything else; it's your primary evidence.302. **Scope via the audit log.** Reconstruct what the compromised identity did: which API calls, in which regions, against which resources, over what window. `lookup-events` filtered by the principal is the starting point:31 ```32 aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=<principal>33 ```34 Look for the tell-tale attacker actions: `CreateUser`, `CreateAccessKey`, `AttachUserPolicy`, `CreateRole`, resource creation in unusual regions.353. **Contain the identity.** Revoke the compromised access key, and revoke *active sessions* (an IAM policy that denies actions before a cutoff timestamp) — deactivating a key doesn't kill sessions already assumed from it. Detach abused permissions.364. **Preserve resource evidence before it vanishes.** Snapshot affected instances/volumes, and isolate rather than terminate — a terminated instance takes its evidence with it. Move it to a quarantine security group with no egress instead of deleting it.375. **Hunt for cloud-native persistence** — the attacker's footholds live in the control plane, not just on hosts: rogue IAM users/roles, added access keys, modified trust policies, new Lambda functions, altered `CloudTrail`/logging config, resource-based policy changes, and cross-account roles.386. **Eradicate and recover** per the eradication skill, cloud-flavoured: remove the rogue identities and persistence, rotate all potentially-exposed credentials, close the entry vector (the leaked key, the SSRF, the public resource), and rebuild from known-good IaC.397. **Check the blast radius across accounts.** In a multi-account org, a compromise can pivot via assumed roles — scope beyond the single account.4041### Cheatsheet4243```bash44aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=PRINCIPAL45aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateAccessKey4647CreateUser / CreateAccessKey / CreateLoginProfile (new footholds)48AttachUserPolicy / PutUserPolicy / CreateRole (privilege)49UpdateAssumeRolePolicy (backdoor trust)50StopLogging / DeleteTrail (evidence tampering)51RunInstances in unusual regions (crypto-mining)5253aws iam update-access-key --access-key-id AKIA... --status Inactive5455aws ec2 create-snapshot --volume-id vol-... # snapshot first56```5758### Reading the situation5960- **Logging was on and intact** = you can reconstruct the incident precisely; the audit trail is your biggest advantage. Preserve it before the attacker can.61- **`StopLogging`/`DeleteTrail` in the history** = the attacker tried to blind you; assume activity after that point is unlogged and widen your investigation.62- **New IAM users, keys, or modified trust policies** = cloud-native persistence — a deactivated key means nothing if a rogue role remains. Hunt the control plane, not just hosts.63- **A deactivated key but continued attacker activity** = sessions were already assumed; you must deny by timestamp, not just disable the key.64- **Resources in unfamiliar regions** = a classic tell (crypto-mining, staging), and easily missed if you only look where your workloads normally run.6566### Pitfalls6768- **Terminating instead of snapshotting.** A terminated instance is gone with its evidence. Snapshot, then isolate.69- **Deactivating a key but not revoking sessions.** Credentials already assumed keep working; kill active sessions with a deny-before-timestamp policy.70- **Only looking at hosts.** Cloud persistence is in IAM and the control plane — rogue roles, keys, trust policies, Lambda. Missing them means the attacker stays.71- **Assuming logging was configured.** If the audit trail wasn't set up beforehand, reconstruction may be impossible — which is why the cloudtrail skill is a prerequisite, not an afterthought.72- **Single-account tunnel vision.** Assumed-role pivots cross account boundaries; scope the whole org.7374### References7576- NIST SP 800-61r2 (incident handling) adapted to cloud77- AWS Incident Response guide / Cloud Security Incident Response whitepaper78- Cloud provider audit-log documentation (CloudTrail, Azure Activity Log, GCP Audit Logs)79- MITRE ATT&CK for Cloud8081## Inputs82- Relevant source code, logs, network traces, or system specifications.8384## Outputs85- Analysis findings, security audit report, or generated code artifacts.