Security Incident and Breach Response Questions
Responding to a confirmed or suspected security incident or data breach where the hard part is coordination, evidence and disclosure: deciding between rapid containment and preserving forensic artifacts (including on Kubernetes nodes and cloud accounts that are also the crime scene), chain of custody and legal holds, separating a security compromise from an operational failure, dividing ownership between operations and the security team, involving legal and compliance, deciding whether a breach is notifiable and who must be told by when (regulators, affected individuals, customers), sequencing notifications when one breach touches several regimes with different clocks, scoping exposure from a misconfiguration, an over-broad internal audience, a supply-chain dependency or a machine learning dataset, briefing executives and customers during a breach, and post-breach analysis and safeguards. The generic detect-contain-eradicate-recover lifecycle and its containment mechanics, hands-on forensic artifact analysis, privacy law as law, vulnerability triage, detection engineering and outage response are covered elsewhere.
A service that processes PII suddenly shows a large unexplained spike in outbound traffic. What do you do in the first hour to limit possible exfiltration, what evidence do you secure before you change anything, and how do you bring the service back safely?
Sample Answer
The idea in plain words
An unexplained outbound spike from a service that holds personal data (PII) is treated as possible exfiltration (data being copied out of the organisation) until something ordinary explains it. The first hour has a fixed order: confirm the spike is real and see where it goes, copy the evidence that a restart would destroy, apply the narrowest control that stops the traffic, then rebuild and return the service only when you can explain what happened or have contained it with controls you trust. "Secure evidence before you change anything" means capturing state that lives only in memory or in open connections, not freezing the service for hours.
Size the risk first (assumed numbers)
Assume the baseline egress is 20 megabits per second (Mbit/s) and the spike is 800 Mbit/s, and the service can read a 250 GB dataset (decimal gigabytes).
- 800 / 8 = 100 megabytes per second (MB/s), because 8 bits make a byte.
- The spike is 800 / 20 = 40 times the baseline.
- 250 GB = 250,000 MB, and 250,000 / 100 = 2,500 s = 41.7 minutes to move the whole dataset.
At 100 MB/s every minute of delay moves about 6 GB (100 x 60 = 6,000 MB), so ten minutes is about 60 GB, nearly a quarter of the dataset, and fifteen minutes is about 90 GB. If this is theft, the entire dataset could leave inside the first hour, which is why the plan below captures the evidence that dies with a connection in a few minutes and blocks the destination as the second step, not the last. If the dataset were 2 TB, the same rate would need about 5.6 hours (2,000,000 / 100 = 20,000 s), and I would have more time for a quieter investigation. These inputs are illustrative.
Minute-by-minute plan
Minutes 0 to 5: is it real and what is it? Check the metric source and time window. Look for ordinary causes in this order: a scheduled backup or export, a data migration, a deploy or autoscaling event that pulls images, a customer running a large legitimate download, a monitoring change that double-counts, and an outbound attack that uses the service as a relay (for example a reflection attack, where the service is tricked into sending large replies to a victim). In flow logs (the network's records of each connection: who talked to whom, on which port, and how many bytes), identify the destination addresses, ports, protocol and which host or container sends the data. Declare an incident if no ordinary cause matches within the five minutes. Page the security on-call and a service owner.
Minutes 5 to 10: capture what a block or restart would destroy. The state that exists only while the connection and process are alive is small and fast to copy. Run the read-only captures below on the affected host (in the commands, evidence/ stands for a mounted evidence volume that is separate from the host's own disk), record the time (date -u), write the output to that evidence location (not the host's own disk), and hash each file. The packet capture runs in the background for two minutes while the quick captures finish. Evidence that survives a network block (disk contents, flow logs, application logs) can wait until after containment.
# evidence/ is the mounted evidence volume, not the host's own disk
date -u > evidence/time.txt
timeout 120 tcpdump -i eth0 -nn -s 0 -w evidence/capture.pcap host 203.0.113.50 &
ss -tunap > evidence/sockets.txt
ps -eo pid,ppid,user,lstart,args > evidence/processes.txt
lsof -nP -i > evidence/open-network-files.txt
wait
sha256sum evidence/*
date -u > evidence/time.txt: saves the time in UTC, which timestamps the capture. Each>sends that command's output to a file on the evidence volume instead of the screen.ss -tunap: lists sockets.-tTCP,-uUDP,-nnumeric addresses (no DNS lookups that would alert the attacker or slow the command),-aall sockets including listeners,-pthe owning process (needs root).ps -eo pid,ppid,user,lstart,args:-eevery process,-ochooses columns: process id, parent id, user, full start time, and full command line. A parent that is a web server or a process started minutes before the spike is a lead.lsof -nP -i:-inetwork files,-nand-Pskip name and port-name lookups.sha256sum evidence/*: run last, afterwaithas paused the shell until the background capture finished, it prints a hash of each saved file to the screen; paste the list into the incident record. A hash is a fingerprint that changes if the file changes, recorded for chain of custody (a record of every hand-off of evidence).tcpdump ...: the trailing&starts it in the background, andtimeout 120stops it after 120 seconds so the capture file is complete before the hashing;-i eth0the interface,-nnno name lookups,-s 0capture whole packets,-wwrite to a file, and the filter limits capture to the suspect address. If the traffic is encrypted, the capture shows who talks to whom and how much, not what is inside.
Illustrative excerpt of ss -tunap output (invented values using a documentation address range, to show what to look for):
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
tcp ESTAB 0 1458304 10.20.4.17:48122 203.0.113.50:443 users:(("python3",pid=2214,fd=7))
tcp ESTAB 0 0 10.20.4.17:5432 10.20.4.31:51044 users:(("postgres",pid=801,fd=12))
Line 1: an outbound connection from a python3 process to an external address with 1,458,304 bytes (about 1.46 MB, from 1,458,304 / 1,000,000) of unsent data queued (Send-Q is bytes not yet acknowledged by the peer), which means a sustained upload. Line 2 is the database serving an internal client, normal. A python3 process that is not the service's own server is the next thing to inspect. The ps and lsof captures let you follow it. Illustrative excerpts (invented values), using the real column headers of each command:
PID PPID USER STARTED COMMAND
2190 1 svc Fri Nov 6 09:02:11 2026 gunicorn: master [orders-api]
2214 2190 svc Fri Nov 6 13:41:07 2026 python3 /tmp/.cache/sync.py
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python3 2214 svc 7u IPv4 88213 0t0 TCP 10.20.4.17:48122->203.0.113.50:443 (ESTABLISHED)
In the ps lines, process 2214 is a child of the web application's master process (PPID 2190), started about 4.5 hours after its parent, and runs a script from /tmp, a place a legitimate service rarely runs code from. In the lsof line, FD 7u is file descriptor 7 open for reading and writing, which matches fd=7 in the ss output, and NAME shows the local address on the left of -> and the remote one on the right. Together they tie the connection to the exact process and its parent.
Memory capture is more disruptive and needs approved tooling; it is worth doing when a process of unknown origin is running, because memory holds keys, decrypted traffic and injected code that vanish on restart. Security decides.
Minutes 10 to 15: first containment, the narrowest control. Block the destination identified in minutes 0 to 5 at the egress firewall or security group. This changes only the network; it does not touch the host's memory, disk or logs, and the socket, process and packet evidence is already saved. Confirm the egress rate falls to baseline and that no new destination takes over.
Minutes 15 to 30: the remaining evidence. Export the network flow logs and application logs for the window, take a disk snapshot through the platform (which copies the disk without stopping the service), hash and record each item.
Minutes 30 to 45: broaden containment. Controls come in two categories; apply the least disruptive that works.
| Category | Examples | Cost to service |
|---|---|---|
| Network level | Block the destination at the egress firewall (a filter on traffic leaving the network) or the security group (a cloud virtual firewall attached to the instance); replace the default outbound rule with an allowlist (only listed destinations are permitted, everything else is denied); sinkhole the destination's DNS (answer lookups for that name with a harmless address so connections fail); move the host to a quarantine segment, an isolated network area that denies outbound traffic | Low if the service needs few external destinations |
| Application level | Revoke and rotate the API keys, database credentials and tokens the host can use; disable the suspect endpoint or feature through a flag; put the service into read-only mode; add a rule to the web application firewall (WAF, a filter in front of a web service that inspects requests and blocks matching ones) | Low to medium, depends on the feature |
Keep the host running and quarantined if it can be, for forensics. A block of one destination does not stop an attacker who has a second one, so keep watching the egress rate and new destinations after each control. An allow-only security group blocks by removing allow rules, and connections already open may continue until they close, which is another reason to verify by the rate and not by the rule change.
Minutes 45 to 60: scope and decide. Find out what the process read (database audit logs, object access logs), whether other hosts show the same destination, and how it got in. Tell counsel and the privacy officer: if personal data left, notification clocks may start, and counsel needs the time of awareness.
Bringing the service back safely
Return the service on new, known-good capacity, not on the suspect host:
- Rebuild from a verified image or a signed build, not from the compromised host's disk.
- Rotate every secret the old host could read, including database, API and cloud credentials, before the new hosts go live.
- Patch or remove the entry point, or at least close it with a compensating control (a control that reduces the risk when the root cause is not yet fixed), such as a WAF rule or disabling the feature.
- Keep the permanent egress allowlist so a repeat spike cannot reach unknown destinations.
- Ramp traffic gradually (a canary, which is a small share of traffic to the new hosts first) with alerts on outbound volume and new destinations, and a defined observation period before closing the incident.
- Keep the quarantined originals until forensics releases them in writing.
Criteria to go back: you can explain the cause or have contained the identified path, the secrets are rotated, and egress is at baseline on clean hosts. If the cause is unknown, return with tighter egress controls and extra monitoring, accept that confidence is lower, and keep the investigation open.
Common mistakes
- Rebooting the host first, which erases memory and active connections.
- Blocking one destination and calling it done, when the attacker has a second one.
- Using name lookups or noisy tools on the suspect host.
- Writing evidence onto the suspect host's own disk.
- Restoring the same disk image and the same credentials.
During an incident you see unusual outbound traffic and unexpected process activity on several hosts, and the signals could be an attack or an operational fault. How do you decide which it is, how do you proceed while that is unresolved, what evidence do you protect, and at what point do you escalate to the security team?
Sample Answer
The idea in plain words
You usually cannot tell an attack from a fault by staring at the symptoms, because both look like "odd traffic and odd processes". What separates them is whether an ordinary explanation fits every signal: a change, a job, a vendor, a release that accounts for the destination, the process and the timing. If one signal has no ordinary explanation, treat the situation as a possible compromise while you keep looking, take the cheap steps that protect evidence, and bring the security team in early, because the cost of a wasted escalation is small and the cost of a missed intrusion is large.
Step 1: Separate the explanations by testing what each predicts
| Signal | Points to an operational fault | Points to an attack |
|---|---|---|
| Timing | Starts within minutes of a deploy, config change, scale event or scheduled job | Starts with no change, often outside normal hours, or repeats at fixed intervals (called beaconing: the compromised host contacts the attacker's server on a timer) |
| Which hosts | Every host running the changed version or role | A subset sharing an exposure (internet-facing, same credentials, same vulnerable service) |
| Destination | A known internal service, a vendor or telemetry endpoint listed in a config | A new domain or address, a rarely seen country or hosting provider, a raw IP address |
| Process | A known binary, installed through the package manager, run by the expected user, started by the service manager (the system program, such as systemd, that starts and supervises services) | A binary in a temporary directory, a deleted binary still running that no package update explains, a shell spawned by the web server user, an unfamiliar interpreter |
| Persistence (how an attacker keeps access after a restart or logout) | Nothing new on disk | New user accounts, SSH keys, scheduled jobs or services appearing |
| Fix | Rollback or restart clears it | It returns after a restart, or a restart destroys the clues |
Read-only checks on a suspect host, with what each flag does:
ls -l /proc/<pid>/exeshows the file the process is running./proc/<pid>/exeis a symbolic link (a pointer) to the program file, and-lis the long listing format, which prints a link asname -> target. If the file was deleted after launch the target is shown with(deleted). Attackers use this pattern to run a binary and remove it, but an ordinary package upgrade also replaces a daemon's file while the old process keeps running, so the same marker appears on a legitimate service that has not been restarted since an update. Read the path: a packaged location such as/usr/sbin/nginx (deleted)that matches a recent package update is an ordinary explanation (restart in a maintenance window), while a temporary or hidden directory such as/tmp/.cache/sync (deleted)has none.dpkg --verify <package>(Debian family) orrpm -V <package>(Red Hat family) compares installed files with the package database (the list the package manager keeps of which files each package installed, with their expected checksums) and flags changed ones.dpkg -S <path>(orrpm -qf <path>) names the package that owns a file and reports an error for a file no package owns, and an unowned binary deserves a second look.sha256sum <file>produces a hash; compare it with the hash of the build artifact from your pipeline.ss -tunaplists network connections and their owning process (-tTCP,-uUDP,-nnumeric,-aall,-pprocess).journalctl --since "2 hours ago"shows what the system logged recently on systemd hosts.
Illustrative excerpts (invented values, documentation address range), first a normal process and a suspicious one from ls -l /proc/<pid>/exe, then a verification line and two log lines:
lrwxrwxrwx 1 root root 0 Nov 6 13:52 /proc/1187/exe -> /usr/sbin/nginx
lrwxrwxrwx 1 svc svc 0 Nov 6 13:52 /proc/2214/exe -> /tmp/.cache/sync (deleted)
??5?????? /usr/sbin/sshd
Nov 06 13:41:07 web-07 sshd[3120]: Accepted publickey for deploy from 198.51.100.23 port 52814 ssh2
Nov 06 13:41:52 web-07 useradd[3188]: new user: name=support2, UID=1002, GID=1002, home=/home/support2
The first process runs a packaged binary. The second runs a hidden file under /tmp that no longer exists on disk. In the dpkg --verify line, the first nine characters report one check each, and dpkg performs only the checksum check, so the 5 in the third place means the file's checksum differs from the package's and sshd was changed after install. Each ? means that check could not be done, not that it passed, and a file that passes every check is not listed at all. The log shows a login from an address nobody recognised followed 45 seconds later by a new account, which is a persistence signal.
Capture the outputs to a separate location with timestamps before drawing conclusions. Checking whether an authorised change record covers the destination and the hosts takes minutes and rules out the commonest false alarm.
Step 2: Proceed while it is unresolved
Act as if it might be an attack, in ways that cost little if it is not:
- Protect evidence now. Snapshot the affected hosts (a read-only copy of the disk through the platform), save the connection and process lists, and export the relevant logs. For a process whose binary shows
(deleted), copy the running program out withcp /proc/<pid>/exe <evidence location>/<pid>.binand record itssha256sum: the file exists only while the process runs, so neither a disk snapshot nor a restart preserves it. If the platform or security team can take a memory image, ask for one on that host. Do all of this before any restart. - Pause automation on the affected hosts only, such as automatic replacement and rebuilds, so the hosts are not wiped while you decide.
- Keep one affected host untouched as a reference host (left exactly as found, so you can compare the others against it), and fix availability on the others only after a snapshot. If none of the signals on a host has resisted an ordinary explanation, restarting a single affected host, after the captures above, is the lowest-risk test of whether a restart clears the problem. If a host shows an attack signal (an unexplained destination, a deleted or temporary-directory binary, a new key), do not restart it before security has seen it: a reboot loses memory-only evidence and can tell an attacker they have been noticed.
- Limit who logs into the suspect hosts, and use individual accounts, because shared or privileged credentials typed on a compromised host can be captured.
- Write down the timeline and the hypotheses with the evidence for and against each.
Step 3: When to escalate to security
Escalate when any one of these is true, without waiting for the investigation to finish:
- A signal has no ordinary explanation after a short timebox, a fixed time limit of 15 to 30 minutes.
- Outbound traffic goes to a destination nobody can account for.
- A process is running from a temporary location, or from a deleted binary, or a new account or key appears.
- The affected hosts hold or can reach sensitive or personal data.
- The behaviour comes back after a clean restart or rollback.
Do not wait for "proof". Ask security as a second pair of eyes, with the evidence you already captured.
The cost of a false alarm versus a missed compromise
Use a simple expected-cost comparison with assumed inputs. Suppose a false escalation costs 2 person-hours (two people for an hour), and a compromise that is missed for days costs 400 person-hours to recover from, not counting legal or customer costs. Escalating is worth it when
p×400>2where p is the probability that this really is an attack. In words: the expected loss from missing an attack (p times 400 person-hours) is compared with the certain cost of escalating (2 person-hours). That gives p>2/400=0.005, or 0.5%. The ratio of the two costs is 400 / 2 = 200 to 1. So even a 1-in-100 chance justifies the call: 0.01 x 400 = 4 person-hours of expected loss, which is more than the 2 spent. These costs are assumptions you would replace with your own, and the conclusion (the bar for escalating is low) holds as long as the missed-compromise cost is much larger than the false-alarm cost.
A worked case through the table
Case A: latency and outbound traffic rise on 12 of 40 hosts 6 minutes after a release. All 12 run the new version and the 28 others are quiet. The destination is a metrics endpoint named in a configuration file under version control, the process is the packaged service binary and dpkg --verify reports nothing, and there are no new accounts. Every row of the table points to a fault, so rolling back is the test. The traffic stops and stays stopped, so security records a stand-down.
Case B: outbound traffic rises on 3 of 40 hosts at 03:10 with no change record. The destination is a raw IP address never seen before, ls -l /proc/<pid>/exe shows a hidden file under /tmp ending in (deleted) on one host, and a new SSH key appears on another. Three rows (destination, process, persistence) point to an attack and none has an ordinary explanation, so the host is snapshotted, nothing is restarted, and security is called immediately.
What evidence flips the call
Toward a fault, and a stand-down: a change record that explains the destination; the destination appears in a configuration file under version control; the affected hosts are exactly those that received the change, and the hosts that did not receive it are quiet; the process binary matches the pipeline artifact's hash and the package manager verifies it; no new accounts, keys or jobs; the behaviour stops on rollback and stays stopped.
Toward an attack: any of the signals in the right-hand column of the table that no change record explains, in particular an unknown destination combined with an unowned binary, or credentials used from somewhere new.
Standing down, and what to still record
Security closes the investigation with a written determination: "Operational fault, caused by [change]. Evidence: [items]." Still record: the timeline, the signals seen, the hypotheses tested, the evidence that decided it, who agreed, the location and retention period of the snapshots and logs kept, and the follow-ups (a detection rule tuned so the same change does not page security again, a configuration owner named for the telemetry endpoint). Keep the evidence for the period your policy sets, since a later finding may reopen the question.
Common mistakes
- Restarting everything to "see if it goes away", which erases the clues and may also make a real attacker invisible.
- Deciding it is an attack from the symptoms alone, and shutting down production without checking the change record.
- Waiting for certainty before involving security.
- Not writing down why the call was made, so the next shift repeats the investigation.
A Kubernetes node is likely compromised and containers on it have been modified. How do you sequence isolating the node, preserving evidence, rotating credentials and replacing it, and what is the trade-off between rebuilding quickly and keeping the node for investigation?
Sample Answer
The idea in plain words
A compromised node holds two kinds of value for the attacker and for you: live access (the attacker can still run code, read mounted secrets and reach the network) and evidence (what was changed, which processes ran, where traffic went). Fast rebuilding removes the access but also deletes the evidence; keeping the node for study preserves evidence but leaves a foothold. The way out is to cut the access first without touching the machine's state, copy the evidence that disappears when pods or the machine are removed, and only then rebuild. Terms: containment is limiting what the attacker can reach; eradication is removing the attacker's foothold; volatile evidence is data that vanishes on reboot or pod deletion (memory, running processes, open network connections, container writable layers); a cordon marks a Kubernetes node unschedulable; a drain evicts its pods, which deletes them from that node. Other terms: the kubelet is the agent on each node that starts and watches its pods; journald is the Linux service that stores system logs; a service account token is the credential a pod uses to call the Kubernetes API, so a stolen one lets the attacker act as that pod; a container's writable layer is where its changes since start are kept on top of the unchanged image; host network means a pod shares the node's own network instead of having a private one; egress is outbound traffic; lateral movement is an attacker using one compromised machine to reach others; a kernel module is code loaded into the operating system's kernel; a legal hold is counsel's instruction to keep records and delete nothing relevant to a legal matter.
The sequence I would run, and why in this order
- Isolate the network, keep the machine running. Cordon the node (
kubectl cordon node-a: no new pods land there) and cut its traffic at a layer the attacker cannot undo from inside the node: the cloud firewall or security group on the node's network interface, set to deny all egress except a forensic collection path (the single allowed route to the evidence storage), rather than editing iptables (the Linux host firewall) on the node, which a root attacker can reverse. An illustrative change: replace the node's security group with one whose only outbound rule is tcp 443 to the collection host 198.51.100.10 and whose only inbound rule is the response team's address. A Kubernetes NetworkPolicy can quarantine individual pods but only if the cluster's network plugin enforces it, and it does not stop a process using the host network. Do not drain yet: draining deletes the pods and their writable layers. - Capture volatile evidence first, ordered by how fast it disappears. Memory image and process list; network connections; then container-level data (below). Use a tool that runs from outside the compromised processes where possible, and assume the node's own binaries may be tampered with. In order of preference: (a) if the node is a virtual machine on infrastructure you control and the platform can capture guest memory, do it from the hypervisor, so nothing runs inside the node; (b) otherwise run a Linux memory acquisition tool you staged in advance from read-only media, as a separate root session, writing to remote storage. Two such tools are AVML, used in current releases as
avml acquire /mnt/evidence/node-a.lime(theacquiresubcommand plus one output file argument; older releases took the file name alone, so run the version you staged; the evidence share is mounted from the collection host), and LiME, a kernel module that must be built for the node's exact kernel version and is loaded withinsmod. AVML needs no kernel module: it reads memory through/dev/crash,/proc/kcoreor/dev/mem, so it is the choice when the hardened image forbids loading modules. If kernel lockdown is enabled, AVML cannot acquire memory either; then fall back to the process list and connection table plus the disk snapshot. Capture the process list and connections withps -eo pid,ppid,user,lstart,args(every process, with parent, owner, start time and full command line) andss -tanp(TCP sockets, all states, numeric addresses, owning process), writing the output to the same remote share and hashing it. - Snapshot the disks. A cloud snapshot of the node's root volume and any attached persistent volumes is a copy taken by the provider with no load on neighbouring pods. Record the snapshot ID, time, and who took it, then hash exports used for analysis (chain of custody).
- Start replacement capacity in parallel, not afterwards. Bring up a new node from a trusted image, schedule fresh pods from image digests (immutable content hashes, not mutable tags) that were verified, and shift traffic. This is what keeps recovery fast while step 2 and 3 run.
- Rotate credentials in dependency order, after isolation. Rotating while the attacker still has a path lets them capture the new secret. Rotate what the node could reach: secrets mounted into pods on that node, the pods' service account tokens, the node's cloud role credentials (cut at the cloud account side), image registry pull secrets, and any key the workloads held. Then check API server and cloud audit logs for use of the old values.
- Remove the node. After the snapshot and memory image are verified readable, terminate the machine. Keep the snapshot under legal hold if counsel says so. Rebuild only from the trusted image.
Pod-level evidence with minimal disruption to neighbouring pods
Take it from the data plane that does not require touching other pods:
- Logs:
kubectl logs <pod> --previous(prints the logs of the previous, terminated instance of the container, which matters when it has restarted and the live logs start empty) for the last crashed container, plus the node's container runtime and kubelet logs (for example via journald) copied off the node. Cluster-wide, export the Kubernetes audit log from the API server (it records who called the API, with what verb on what object) to storage outside the cluster, because an attacker with API access can try to tamper with in-cluster copies. - Filesystem changes: the container's writable layer on the node's disk is captured by the disk snapshot; to see what changed, compare it with the image: modified binaries, new files, new cron entries. Reading from the snapshot copy, not the live node, avoids altering timestamps.
- Pod specs and events:
kubectl get pod <pod> -o yaml(the full object, including image digest and mounts) andkubectl get eventssaved before anything is deleted: they show which image digest, which service account, which mounts. - Persistent volumes: snapshot through the storage API, not by mounting the live volume in a new pod on the compromised node.
- Neighbours: do not exec into neighbouring pods; selecting evidence by node and pod labels keeps the collection read-only for them. Those pods are rescheduled onto clean nodes afterwards anyway.
Worked example (all numbers are assumptions)
Node node-a runs 12 pods, each requesting 0.5 CPU, so the demand to replace is 12 x 0.5 = 6 CPU. The rest of the cluster has 8 CPU of free capacity, so 6 fits (8 - 6 = 2 CPU of headroom) and no new node is needed to rehome the pods; one is added anyway so the cluster is not left tight. Suppose the memory image takes 15 minutes, the root volume snapshot completes in about 10 minutes and runs while the image is being taken, and replacement pods are healthy 10 minutes after they are scheduled. Lay it out by minute, with the assumption that isolation takes 2 minutes and replacement capacity starts at minute 2: minutes 0 to 2, cordon and cut egress at the cloud firewall; minutes 2 to 17, memory image (15 minutes); minutes 2 to 12, root volume snapshot in parallel (10 minutes); minute 2 onward, new node and pods start, and are healthy at minute 2 + 10 = 12, when traffic shifts; minute 17, both copies are done and, once checked readable, the node can be removed. Service is back on clean capacity at minute 12 either way, so keeping the node alive costs no recovery time; the only difference is that the node lives until minute 17 instead of being deleted at minute 2. Then the node stays isolated but alive for roughly 15 minutes of collection, versus drain-and-delete at minute 2. The cost of keeping it is 15 minutes of a single node's capacity plus a window in which the attacker still has local code execution but no network. The cost of not keeping it is losing the memory image, which is the only place unwritten attacker tooling may exist.
The trade-off and my recommendation
Rebuilding quickly wins when the workloads are customer-facing and the node is one of many, and the damage is probably limited to this node. Keeping the node for investigation wins when there are signs the attacker moved laterally (cluster credentials used from the node), when a regulator or law-enforcement inquiry is likely, or when the intrusion path is unknown and the node is the only place it can be learned. I would not choose between them: isolate, take a memory image and disk snapshot (about a quarter of an hour in the example), rebuild immediately, and keep the copies instead of the machine. The exception is a node that already holds credentials with wide cluster rights: rotate those immediately after isolation and before the memory image, since the speed of rotation then matters more than the completeness of the memory image. Isolation still comes first, because rotating while the attacker has a network path lets them capture the new secret.
Common mistakes
- Draining first "to protect the workloads", which deletes the pods and the writable layers.
- Isolating with commands run on the node itself.
- Rotating before the attacker is cut off, or forgetting the cloud role of the node.
- Redeploying from a mutable image tag that the attacker may have changed in the registry.
- Collecting evidence from the live node with its own possibly tampered tools and no record of what was run.
An outage is suspected to have a security cause. The security team asks you to freeze automated remediation and preserve the affected systems, but customers are down. As the person coordinating recovery, how do you balance restoring service against preserving evidence, who decides, and what do you tell customers meanwhile?
Sample Answer
The idea in plain words
Restoring service and preserving evidence look like opposites only if you try to do both on the same machines. The way out is to restore beside, not over: build clean capacity from a known-good image (a server template you have reason to trust, built before the incident) while the suspect systems are frozen, copied and quarantined, and run both tracks in parallel. A security-suspected outage is one where the cause may be an attacker, so the broken machines are also the crime scene. One person (the incident commander, IC, who coordinates and decides but does not debug) owns the recovery sequence; the security lead owns what is held as evidence; a business executive (the executive sponsor, a senior leader who owns the business risk) breaks any tie that costs customers time.
Which routine operations destroy evidence
Automation is built to make broken things disappear, which is exactly wrong when the broken thing is evidence. Freeze these on the suspect hosts only (not across the fleet, so healthy capacity can still heal):
| Routine action | Evidence it destroys |
|---|---|
| Rebuilding or reimaging a host | Disk contents, deleted-file traces, attacker tooling |
| Autoscaling group (a cloud feature that adds and replaces servers automatically) or orchestrator (software such as a container scheduler that restarts and moves workloads) replacing an "unhealthy" instance | The instance and its memory and local disk |
| Auto-heal restarts and container restarts | Process memory, open connections, ephemeral container filesystem |
| Log rotation and log-shipper buffers (the temporary queues that forward logs to central storage) with short retention | The window of events around the intrusion |
| Deploy pipeline pushes and rollbacks that overwrite binaries or configuration | The attacker's modifications, file timestamps |
| Scheduled temp-directory cleanup and disk-space reaper jobs (scripts that delete old files when a disk fills) | Dropped files and staging archives |
| Credential rotation and session expiry done with no capture | Which credentials were in use and from where |
The credential row is a contradiction worth stating: rotation is also a necessary containment step. The rule is to snapshot first, then rotate, and record the time.
The method, in order
- Declare and staff (minute 0). IC (me), a security lead, a service lead, a scribe, a communications lead. Open a bridge on a path that does not depend on the suspect systems.
- Scope the freeze (minutes 0 to 10). The security lead names the exact hosts and accounts to hold, as a written freeze list. An illustrative freeze list (four hosts and one account):
| Asset | Role | Why held | Held by | Release |
|---|---|---|---|---|
| web-07 | app server | first host with the odd outbound traffic | security lead | not released |
| web-12 | app server | same deploy as web-07 | security lead | not released |
| web-15 | app server | same deploy as web-07 | security lead | not released |
| web-19 | app server | same deploy as web-07 | security lead | not released |
| svc-deploy | service account | used for the change at 02:10 | security lead | not released |
Everything not on the list stays under normal automation. A broad "freeze everything" order prolongs the outage and is usually unnecessary.
3. Capture while service work proceeds (minutes 10 to 30). Security takes disk snapshots, memory captures where tooling allows, and exports of logs for the window. The recovery team starts the clean build at the same moment.
4. Build clean capacity beside the suspect nodes. New instances from a known-good image, in a separate network segment with restricted outbound access, with fresh credentials. If the image, the deployment pipeline or the configuration source could be compromised, this track is blocked until security clears them, which is the first thing to ask.
5. Ramp traffic. Canary (a small share of traffic to the new capacity first), watch error rates and outbound traffic, then ramp to full.
6. Release evidence. The security lead gives an explicit written release for each held asset before anyone rebuilds or deletes it.
Worked timeline (assumed figures)
Assume a fleet of 40 hosts serving the failing service, an evidence capture budget of 20 minutes, a clean build of 45 minutes, a canary of 15 minutes and a full ramp of 15 minutes. These are scenario inputs.
- Serial order (capture, then build, then canary and ramp): 20 + 45 + 15 + 15 = 95 minutes.
- Parallel order (capture and build overlap): max(20, 45) + 15 + 15 = 45 + 30 = 75 minutes.
- Saving: 95 - 75 = 20 minutes, which is 20 / 95 = 21% of the serial outage.
The fleet size of 40 does not change the build time, because new hosts are created in parallel. It matters for the capture, whose work grows with the number of hosts held. Assume one person captures one host in 5 minutes. Four suspect hosts take 4 x 5 = 20 minutes, the figure used above. Capturing all 40 would take 40 x 5 = 200 minutes, and then the parallel order is max(200, 45) + 30 = 230 minutes against a serial 200 + 45 + 30 = 275, so the capture is no longer hidden inside the build. That is the numerical reason the freeze list names only suspects.
So preserving evidence does not need to add 20 minutes to the outage; with a parallel clean build it adds none, as long as the build is the longer of the two. The track that breaks this: if the capture takes longer than the build, or if the clean build is blocked by suspected pipeline compromise, the capture is no longer hidden inside the build time and the trade-off becomes real. Then the IC asks security for the minimum capture that is still useful (for example memory and logs from two representative hosts, not all forty) and takes the decision to the executive sponsor.
Who decides
| Question | Decider | Why |
|---|---|---|
| Recovery order, rollbacks, when to ramp | IC | One owner for the recovery sequence |
| Which assets are held and what a capture must include | Security lead | Evidence and attacker risk are their domain |
| Releasing a held asset | Security lead, written | Prevents "we thought it was fine" |
| Accepting extra downtime for a larger capture | Executive sponsor, on IC and security advice | A business risk decision |
| Whether and what to say publicly about cause or data | Communications lead with legal approval | Statements about cause create legal exposure |
What I tell customers meanwhile
State what is known, what is being done, and when the next update comes, and nothing about cause until it is established. An example status update: "We are experiencing a disruption affecting [service]. We are restoring service and expect an update by 15:30 UTC." If asked directly whether it is a security matter, the answer is "We are investigating the cause and will share what we confirm", not a denial and not a confirmation. Saying "no customer data was affected" before it is verified is a statement that may later be shown false; saying "not a security issue" is the same mistake. Each update has a promised next time, and the promise is kept even if the content is "no change".
Briefing executives and legal
Executives get a short update at fixed intervals (for example every 30 minutes): impact, current action, decision needed from them, next update time. Legal and compliance are briefed at declaration, not after: they need the facts to judge whether a legal hold is required (a formal instruction to preserve every record that might matter to a legal matter and delete nothing), whether personal data may be involved, and whether any notification clock (a legal deadline to tell a regulator or affected people, counted from when you become aware) may have started.
How each step is documented
The scribe records, in one timestamped log: each freeze or release (with names), each capture (what, where stored, a hash which is a fingerprint of the file that changes if the file changes, who), each recovery action (who, when), each decision (who, why, alternatives), and each customer message with its approver. The capture items go into an evidence register with chain of custody, a record of every hand-off.
Common mistakes
- Freezing the whole fleet instead of the named suspect hosts, which turns a partial problem into a full outage.
- Letting autoscaling or auto-heal quietly replace the suspect hosts while everyone argues.
- Rebuilding over the failed hosts because it is the fastest path back.
- Telling customers the cause, or denying a security cause, before it is known.
- No written release, so evidence is lost by a well-meaning engineer.
A production incident may have exposed customer data. Outline the first 72 hours: how you coordinate engineering, legal, customer-facing teams and executives, what you contain and preserve, what you tell stakeholders and when, and what longer-term remediation and transparency commitments follow.
Sample Answer
The idea in plain words
In the first 72 hours you run four tracks at the same time: stop the exposure, keep the evidence, find out what data is really involved, and tell each audience the right amount at the right time. The number 72 comes from regulation. Under the EU General Data Protection Regulation (GDPR) Article 33, a controller (the organisation that decides why and how personal data is processed) must notify its supervisory authority (the national data protection regulator) without undue delay and, where feasible, within 72 hours of becoming aware of a personal data breach, unless the breach is unlikely to result in a risk to people's rights and freedoms. Article 34 separately requires telling the affected individuals without undue delay when the risk to them is high. A processor (a vendor handling data on the controller's behalf) must tell the controller without undue delay. Sector rules, national laws and customer contracts add their own clocks, so the legal lead confirms which regimes apply and the answer here is a plan, not legal advice.
The clock runs from awareness, not from the first alert. Regulator guidance describes awareness as having a reasonable degree of certainty that a security incident has compromised personal data. A short, documented investigation to establish that is acceptable, but a plan that quietly starts the count later than the facts justify is the common mistake.
Who does what
- Incident commander (IC): the one person who coordinates and decides. The IC does not debug.
- Technical lead: runs the engineers and security analysts doing containment and scoping.
- Scribe: keeps a timestamped log of facts, decisions and who made them. This log becomes the evidence of what was known when.
- Legal lead and data protection officer (DPO, the person responsible for privacy compliance): decide notifiability and wording. Counsel should direct the forensic work so the findings may be protected by legal privilege (confidential legal advice shielded from disclosure in later disputes; the rules differ by jurisdiction).
- Communications lead: owns the fact sheet, the customer notice, the press statement and the internal briefing.
- Customer-facing lead: support and account management, who need approved answers before customers call.
- Executive sponsor: takes the decisions only executives can take (spend, public statements, regulator contact). Examples: approving a paid credit-monitoring offer for affected people, hiring an outside forensic firm, and signing off the statement to the press.
Use the same channel for all of them: a war room (a dedicated call and chat channel where responders work). If the attacker may be inside corporate chat or email, move the war room to an out-of-band tool first: a channel that does not run on the possibly compromised corporate systems, such as a conference line or messaging service the company does not host, with membership agreed in advance.
The first 72 hours in order
Assumption for the example: the incident is declared and awareness is recorded at T0 = Tuesday 10:00 UTC. T0 plus 72 hours is Friday 10:00 UTC (three whole days). In the table below a blank cell means nothing new starts in that track at that time, not that something was left out. The team sets an internal target to file the first regulator notification at T0 plus 60 hours, which is Thursday 22:00 UTC (Tuesday 10:00 plus 48 hours is Thursday 10:00, plus 12 hours is Thursday 22:00). That leaves 72 minus 60 = 12 hours of slack for approvals.
| Time | Technical track | Legal and compliance | Comms and customers | Executives |
|---|---|---|---|---|
| T+0h (Tue 10:00) | Declare, name IC, open war room, start the log | Told immediately | None yet | Paged |
| T+1h | Capture first: snapshot affected systems, preserve volatile evidence (memory contents and live network connections, which exist only while the machine runs and vanish on reboot), extend log retention | Issue a legal hold (an instruction to stop routine deletion of anything relevant) | Freeze all outside statements | |
| T+2h | Then contain: close the exposure path, revoke credentials; no rebuild until the evidence is hashed | Decide which regimes might apply | Prepare internal holding message | Briefing 1: known, unknown, next update time |
| T+4h (Tue 14:00) | First scoping: which systems, which data fields, which time window | DPO opens the breach record | Brief support and sales: facts only, route questions to comms | |
| T+8h | Identify affected customers and records by query | Draft risk assessment | Draft customer notice and fact sheet | |
| T+12h (Tue 22:00) | Written handoff to the next shift (fatigue causes mistakes) | |||
| T+24h (Wed 10:00) | Confirm or rule out ongoing access | Risk view: is harm to individuals likely? | Status page (the public web page that tells customers what is working and what is not) wording approved | Briefing 2: scope, decisions needed |
| T+36h (Wed 22:00) | Evidence pack for the regulator (the organized set of the log, the snapshot hashes and the timeline that supports the notice) | Decision on notify or document, written down | Customer notice final | |
| T+48h (Thu 10:00) | Notice to affected customers goes out; press statement held ready | |||
| T+60h (Thu 22:00) | First notification to regulator filed; Article 33(4) lets details that are not yet known follow in phases | |||
| T+72h (Fri 10:00) | Statutory deadline; remediation plan with owners and dates | Transparency update | Briefing 3 |
Contain and preserve together
Containment (stopping further exposure) and preservation (keeping evidence) conflict only if you do them in the wrong order. Capture first, which takes minutes: disk snapshots, memory capture where possible (a forensic tool copies the contents of RAM to a file, so it can be examined after the machine is rebuilt), copies of access logs and cloud audit logs (the cloud provider's record of who performed which action on the account), and a retention extension on every log source. Then contain: revoke the credentials, remove the public path, block the network route. Rebuilding or deleting the system before the snapshot destroys the proof of what was accessed, and without that proof you cannot say how many customers are affected. Chain of custody (a written record of every hand-off of the evidence) starts at the snapshot.
What you tell whom, and when
| Audience | What they need | When | Delivered by |
|---|---|---|---|
| Responders | Facts, tasks, handoff notes | Continuous | IC |
| All staff | "Do not discuss outside; send questions to comms; do not delete anything" | T+4h | Comms lead |
| Executives | Known, unknown, decisions needed, next update time | T+2h, T+24h, T+72h | IC with legal |
| Regulator | Nature of breach, categories and approximate numbers, likely consequences, measures taken | By T+72h at the latest | Legal or DPO |
| Affected customers | What data, what to do, support contact | When scope is confirmed, here T+48h (Article 34: without undue delay once risk is high) | Comms with legal |
| Unaffected customers | A short statement that they are not affected, if asked | On demand | Customer-facing lead |
| Press | Reactive statement from the same fact sheet | Only if asked or if public | Comms lead |
Message principles apply to every row: accurate (only confirmed facts, labelled by confidence), no speculation (no guessing at cause, attacker or numbers), and consistent across channels (one version-stamped fact sheet from which the notice, the status page, the support script and the press statement are all copied). A version-stamped fact sheet is one document with a version number and time on it, so everyone can see which copy is current and an old number is not quoted after it was corrected. Always state when the next update will come, even if it will say nothing new.
Why customers before the regulator here. In this plan scope is confirmed at T+36h, and customers can act on a credential reset the same day, so their notice goes at T+48h while the 60 hour regulator target is the latest internal date, not the ordering rule. The order is the legal lead's call. If the regulator filing is ready earlier, file earlier; if customers are likely to contact the regulator first, file the same day or before the customer notice, so the regulator does not learn of the breach from a complaint.
Outage versus breach. An outage is about availability and is described in terms of what stopped working and when it recovers. A breach is about confidentiality, and customers ask a different question: what of mine was seen. Do not file a possible data exposure under "degraded performance" on the status page. Say "security incident" as soon as exposure is plausible, say "may have" until logs prove it, and when you write "we have found no evidence of misuse" state what you checked, so the sentence cannot be read as a guarantee.
A holding statement, with the facts below treated as assumptions of this example: "On Tuesday we identified unauthorised access to a system that stores customer account data. We have closed the access, we are investigating with external specialists, and we will tell every affected customer directly. We will publish our next update by Thursday 10:00 UTC." In this timeline it goes on the status page when the wording is approved at T+24h, and the next update is the customer notice at T+48h. It makes no claim about cause, number or attacker.
After 72 hours: remediation and transparency commitments
- Regulator follow-up: Article 33(4) allows information to be supplied in phases, so file the initial notice on time and add detail later.
- A forensic report and a root cause, with each remediation item given an owner and a date.
- A customer-facing summary of what happened and what changed, published when the investigation closes. Commit to an update cadence (for example weekly for a month) and keep it.
- Support for affected people, such as credential resets or monitoring services, as legal advises.
- A blameless review (a review that studies the system and decisions, not who to punish) and a tracked list of safeguards, reported to executives until each is closed.
Common mistakes
- Starting the clock at the engineers' convenience rather than at awareness.
- Rebuilding the host before the snapshot.
- Letting the IC debug, so nobody coordinates.
- Quoting a number to customers that the regulator filing later contradicts.
- Declaring "no data was accessed" without log evidence for the whole window.
Unlock Full Question Bank
Get access to all 11 Security Incident and Breach Response interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.