Home/Refreshers/Containment by what was compromised: refresher
Containment by what was compromised
The fastest safe way to cut an attacker off, by what they have, and what each move leaves open.
| Compromised | Contain it by | Still open afterwards |
|---|---|---|
| AWS access key | Deactivating it, then a deny-all policy on its user | Keys and roles it created |
| AWS role sessions | Revoke active sessions on the role | Nothing, once revoked. Without it, sessions last until they expire |
| Google Cloud service account | Disabling its keys or the account, and removing who can impersonate it | Workloads using it break when the account is disabled |
| EC2 instance | Tag incident=<id>: protect, snapshot, memory, isolate | Credentials taken from it, until the role's older sessions are revoked |
| Compute Engine VM | Snapshot, then a deny-all firewall rule by network tag | Its service account, which only changes with the VM stopped |
| Kubernetes pod | Relabel out of its controller, deny-all network policy, cordon the node | Traffic, if the network plugin ignores network policies |
Commands
| Deactivate an AWS key | aws iam update-access-key --user-name <user> --access-key-id <key> --status Inactive |
| Disable a Google Cloud key | gcloud iam service-accounts keys disable <key-id> --iam-account <sa-email> |
| Take a pod out of its controller | kubectl label pod <pod> app- |
| Mark a pod for quarantine | kubectl label pod <pod> quarantine=true |
| Stop new pods on a node | kubectl cordon <node> |
Watch out
- Delete nothing that could be evidence until it has been captured.
- Containment that breaks production needs the commander's call. Agree the limits before the incident.
Check it worked
The attacker's next API call fails. Confirm it in the audit log.