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.
You suspect a production host was compromised and the attacker may still be active. Before you isolate or rebuild it, what do you decide to capture and in what order, who else needs to be in the loop, how do you record custody, and how do you weigh that against the cost of leaving the host up?
Sample Answer
The idea in plain words
You are choosing between two risks. Acting fast (isolating or rebuilding the host) limits what the attacker can still do, but powering off or reimaging destroys the most valuable evidence, which lives in memory and live network connections, and it can tell a watching attacker they have been found. Waiting preserves evidence but gives the attacker more time. The way out is usually not either extreme: contain at the network layer (which keeps the machine running and its memory intact), collect mostly in order of how quickly the evidence disappears, and bring in the right people before you touch anything. The decision is made explicitly and recorded, not by reflex.
Terms used here:
- Volatile evidence: data that vanishes when power is lost or state changes: memory contents, running processes, open network connections.
- Order of volatility: collecting the most short-lived evidence first. RFC 3227 (guidelines for evidence collection and archiving) lists it from CPU registers and cache, through routing and ARP tables (the host's records of where to send traffic and which hardware address belongs to which network address), process state and memory, to temporary files, disk, remote logs and archival media. The order follows how fast each kind changes: registers and cache change in nanoseconds, ARP entries age out within minutes, routing state changes whenever the network does, memory changes as programs run, a disk changes only when something is written, and remote logs and archives barely change at all.
- Keylogger: malware that records what is typed. Credential dumper: a tool that extracts passwords or tokens from memory or disk. Domain admin: an account with administrative rights across a whole Windows directory, so its password stolen from one host opens many others.
- Endpoint detection telemetry: the activity records (process starts, connections, file changes) sent by a security agent on each machine to a central console, which hold a copy the attacker cannot edit from the host.
- Quarantine security group: a cloud firewall rule set attached to the host that allows traffic only to and from the response team and denies everything else.
- Chain of custody: the record of who collected, held and moved each item, and when.
- Out-of-band communication: a channel the attacker cannot read, because email, chat and the host's own accounts may be compromised.
What to decide and the order
Minutes 0 to 5: decide and set up.
- Name an incident lead who decides, and a scribe who logs every action with a UTC time.
- Switch to out-of-band communications and a dedicated response account. Do not type admin credentials into the suspect host, because a keylogger or a credential dumper could capture them.
- Bring in the right people (below).
Capture, in this order:
-
Evidence held elsewhere (it is not stored on the host, so an attacker there cannot edit it directly, although a root attacker may stop the agent that ships new data): central log store, endpoint detection telemetry, cloud audit trails, network flow and firewall logs, authentication logs. Export copies now. This is a deliberate exception to the volatility order, because these sources change slowest: it takes about three minutes, needs no access to the host, and gives a clean record from before your own commands (which will themselves appear in the telemetry) and before an attacker holding stolen cloud credentials can delete trails.
-
Volatile state on the host. Use trusted tools from read-only media, since the host's own commands could be replaced by the attacker. In practice that means a response kit prepared in advance: known-good copies of the commands (built to run without depending on the host's libraries) on a write-protected USB drive, a read-only disc, or a read-only network share, run by full path rather than by name so the host's own search path cannot substitute a planted copy. Linux example (flags explained):
bashdate -u # current time in UTC, to anchor everything ss -tanp # sockets: -t TCP, -a all states, -n numeric addresses, -p owning process (needs root) ps -eo pid,ppid,user,lstart,args # -e every process, -o chosen columns: ids, user, start time, full command lineWindows has equivalents:
netstat -ano(-a all connections and listening ports, -n numeric addresses, -o the owning process ID),tasklist(running processes with their process IDs) and an event log export. Keep this part short: the deep method belongs to the forensic examiner.An illustrative excerpt of what the ss and ps commands might show (invented values, not a real capture):
textState Recv-Q Send-Q Local Address:Port Peer Address:Port Process ESTAB 0 0 10.0.4.17:48122 203.0.113.45:443 users:(("python3",pid=4127,fd=5)) LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=811,fd=3)) PID PPID USER STARTED COMMAND 811 1 root Sun Mar 1 02:00:11 2026 /usr/sbin/sshd -D 4127 4090 www-data Mon Mar 2 10:14:03 2026 python3 /tmp/.x/sync.pyRead it by joining the two on the process ID. The established connection to an outside address belongs to pid 4127. The process list shows pid 4127 started recently, runs as the web server's account, runs a script from a hidden directory under /tmp, and was started by process 4090. The listening ssh daemon (pid 811) has been up since the day before and is ordinary. What to record for the examiner is the pair of lines, not a conclusion.
-
Memory image, written to external or remote storage, never to the suspect disk. A memory acquisition tool does this; you need only one, chosen by operating system and kernel, with the examiner's agreement: LiME (a Linux kernel module) or AVML on Linux, WinPmem on Windows. Pick the one your forensic team has already tested, and have it on the response kit. Memory holds encryption keys, injected code and commands that never reached disk.
-
Disk: for a virtual machine or cloud volume take a snapshot, which does not require shutdown. For a physical server image it live or after the memory capture.
-
Hash everything you can at capture (logs, command output, the memory image; a cloud snapshot is recorded by its ID and hashed once an image is read from it) and write a custody entry per item: item ID, source host, method, collector, time in UTC, SHA-256, storage location, hand-offs.
-
Then contain. Isolate at the network layer (a quarantine security group or switch port that allows only the response team's access), not by powering off. A stateful cloud firewall may keep carrying a connection that already exists after a rule change (AWS documents this for security groups), so check the flow logs that traffic to the suspicious destination has stopped, and if it has not, cut it with a stateless rule such as a network ACL scoped to the host's address, which, unlike a security group, breaks connections that are already open. Do not plan on detaching the network interface: on AWS the primary network interface of an instance cannot be detached. Power off or rebuild only after the examiner confirms nothing more is needed.
Who needs to be in the loop
- Incident lead and the host's owner (SRE or application owner): for the decision and the business impact.
- Forensic examiner or the external firm: for method and for taking custody.
- Counsel or the privacy team, if the host holds regulated or customer data, since legal clocks and privilege may begin here.
- A manager with authority to accept the downtime or the risk of waiting.
- HR, only if an insider is suspected.
- Communications and customer teams later. Keep the circle small and need-to-know.
Weighing it against the cost of leaving the host up
Compare what the attacker can do during the capture with what the evidence is worth.
Assumptions: the host has 16 GiB of memory, the memory image goes over a link that sustains 100 MiB per second, and the live commands take about 10 minutes.
- Memory transfer time: 16 GiB is 16 x 1024 = 16,384 MiB, and 16,384 / 100 = 163.84 seconds, or about 2.7 minutes.
- Total capture on the host: 10 minutes of commands, plus 3 minutes for memory (rounded up from 2.7), plus an assumed 4 minutes to snapshot, which is 10 + 3 + 4 = 17 minutes (minutes 8 to 25 in the timeline below).
- Exposure cost: if the observed exfiltration (data being copied out) were 50 MiB per minute, 17 minutes of delay would allow about 50 x 17 = 850 MiB more to leave. The 50 MiB per minute is read from the network side, not from the host: bytes per minute sent to the suspicious destination in the firewall or flow logs. The baseline for the 850 MiB is isolating at minute 8, when capture would start, instead of at minute 25; the first 8 minutes are common to both choices.
Whether 850 MiB matters depends on what the data is. For a web server with a trivial data store, accepting 17 more minutes of exposure to keep the attacker's tools and keys in memory is a good trade. For a database holding customer records that is actively being copied, it is not.
An illustrative rule (it covers only the exposure rate and the data value, and a real decision also weighs backups, the attacker's likely reaction, regulatory data, business criticality and whether a failover is ready): if the attacker is actively destroying data or copying sensitive data at a rate where the capture time is unacceptable, isolate at the network layer first (seconds), then capture; otherwise capture first, then isolate. In both cases the host stays powered on. Reduce the cost of waiting by failing production traffic over to a healthy replica before isolating, so the business impact is not the reason for a hasty rebuild.
Worked timeline (assumed times)
| Minute | Action |
|---|---|
| 0 to 5 | Lead named, scribe starts the log, out-of-band channel opened, owner and counsel called |
| 5 to 8 | Central logs and cloud audit trail exported and hashed (nothing run on the host) |
| 8 to 18 | Live commands run from trusted media, output saved off-host, hashed |
| 18 to 21 | Memory image acquired to remote storage (about 2.7 minutes of transfer plus start-up) |
| 21 to 25 | Volume snapshot taken and its ID recorded (the image read from it is hashed later, in the lab) |
| 25 | Quarantine applied; custody ledger reviewed; decision recorded |
Judgment
I would not power the machine off, and I would not leave it exposed for long either: network isolation after a short, ordered capture is the default. What would flip it: if a destructive payload is running, isolate immediately; if the attacker is thought to monitor and react to isolation, the lead may choose to capture first and plan a coordinated cut-off.
Common mistakes: rebooting "to clear it", logging in with a domain admin account, writing the memory dump to the compromised disk, running tools from the host that the attacker may have replaced, and failing to record what you ran, which makes your own actions indistinguishable from the attacker's.
Your team confirms at 14:00 UTC on a Friday that an attacker read a customer database holding EU residents' personal data and US patient health records. Taking as given that the GDPR requires notice to the regulator within 72 hours of becoming aware and HIPAA requires individual notice without unreasonable delay and within 60 days of discovery, build the notification timeline: who is told what and by when, when the clocks start, which approvals gate each notice, and what you do if facts are still incomplete.
Sample Answer
The idea in plain words
Two different legal clocks start from one event, and they run on different units. The EU rule is counted in hours from the moment the organisation becomes aware of the breach (aware means it has a reasonable degree of certainty that personal data was compromised, not merely that something looks odd). The US health rule is counted in calendar days from discovery and is a ceiling, not a target. The work is to write down the start time, convert both rules into dated deadlines, put internal milestones well inside them, and name who must approve each notice. When facts are incomplete, you notify with what you have and supplement later, rather than waiting for certainty.
Assumptions used throughout (these are scenario inputs, not facts about any real organisation): the confirmation at 14:00 UTC is the moment of awareness and discovery; the date is Friday 2026-11-06; the organisation is the data controller for the EU data (the party that decides why and how the data is processed) and a HIPAA covered entity for the patient records (HIPAA is the US health privacy law; a covered entity is a health plan, a health care provider that transmits health information electronically for billing, or a health care clearinghouse); the EU data and the US patient records are two separate sets of people.
The rules as supplied, and what each one covers
| Dataset | Regime | Who is told | Deadline rule | Clock starts |
|---|---|---|---|---|
| EU residents' personal data | GDPR Article 33 | The supervisory authority (the national data protection regulator) | Within 72 hours of becoming aware, where feasible; not required if the breach is unlikely to result in a risk to people | Awareness |
| EU residents' personal data | GDPR Article 34 | The affected individuals | Without undue delay, when the breach is likely to result in a high risk to them | Awareness |
| US patient health records | HIPAA Breach Notification Rule (45 CFR 164.404) | The affected individuals | Without unreasonable delay and no later than 60 calendar days after discovery | Discovery |
Sector rules, US state laws and customer contracts add their own clocks and some are shorter, so counsel confirms the full list. Two further HIPAA duties also need counsel's check: notice to the US Department of Health and Human Services (HHS, the federal agency that enforces HIPAA) and, for large breaches, to the media. If the organisation is a processor (under the GDPR, a party that handles personal data on behalf of the controller and on its instructions) or a business associate (under HIPAA, a party that handles patient information on behalf of a covered entity) rather than a controller or covered entity, it owes notice to its customer first. GDPR Article 33(2) requires a processor to tell the controller without undue delay.
The method, in order
- Write down the start time. Record who confirmed the breach, on what evidence, and the timestamp in UTC. This is the legal record of when the clock started. Backdating it is wrong, and so is delaying the decision that "we now know" without a good reason, because a regulator can compare your written record with the technical evidence.
- Convert each rule to a dated deadline. For GDPR: deadline = awareness + 72 hours. The rule counts hours, so weekends count. For HIPAA: ceiling = discovery date + 60 calendar days.
- Back-plan internal milestones. Put the submission target several hours before the hard deadline, so one slipped approval does not cause a miss. Each step below depends on the one before it.
- Name the approval gate for every notice. A notice leaves only after the people who can be wrong about it have signed: facts (incident commander and forensics lead), law (privacy counsel and the data protection officer, DPO), and authority (general counsel or an executive). Name a deputy for each approver, because the deadline falls on a Monday and the approvals fall on a weekend.
- Decide what to do with incomplete facts. GDPR Article 33(4) allows the information to be provided in phases without further undue delay, and Article 33(1) requires reasons if the 72 hours are missed. So file the first notice on time with the fields known (the content items listed in GDPR Article 33(3): nature of the breach, categories and approximate numbers of people and records, DPO contact, likely consequences, measures taken), mark unknowns as unknown, and commit to a supplement. HIPAA's 60 days is an outer limit; "without unreasonable delay" means a notice that could be sent on day 20 is late on day 55.
Worked timeline (computed)
Article 33(3) is the part of the GDPR that lists what the regulator notice must contain: the items named in step 5. The Article lists four points, the first of which covers both the nature of the breach and the categories and approximate numbers of people and records. The program builds the deadlines from the assumed start, lists the milestones with their owners, and checks its own arithmetic by recomputing the deadlines a second way (epoch seconds and day ordinals) and confirming that every milestone is in order and before the deadline. Run in Python 3.12 using only the standard library, it prints:
from datetime import datetime, timedelta, timezone, date
import calendar
# Assumed scenario input: breach confirmed Friday 2026-11-06 14:00 UTC.
aware = datetime(2026, 11, 6, 14, 0, tzinfo=timezone.utc)
assert aware.strftime("%A") == "Friday"
GDPR_HOURS = 72 # Art. 33(1): regulator, from becoming aware
HIPAA_DAYS = 60 # 45 CFR 164.404: individuals, ceiling from discovery
gdpr_deadline = aware + timedelta(hours=GDPR_HOURS)
hipaa_ceiling = aware.date() + timedelta(days=HIPAA_DAYS)
# (offset in hours from awareness, step, owner, gate that must pass first)
steps = [
(0, "Breach confirmed; awareness time written in the log", "Incident commander", "none"),
(2, "Counsel and data protection officer briefed; legal hold issued", "Incident commander", "none"),
(18, "Scope v1: datasets, record counts, was data copied out", "Forensics lead", "none"),
(26, "Regulator notice draft with the Art. 33(3) fields", "Privacy counsel", "scope v1"),
(44, "Counsel and DPO review complete", "Counsel, DPO", "draft"),
(52, "Executive approval (a named deputy covers the weekend)", "General counsel", "review"),
(64, "Target submission to the supervisory authority", "DPO", "approval"),
(72, "GDPR hard deadline", "-", "-"),
]
print("GDPR clock starts:", aware.strftime("%a %Y-%m-%d %H:%M UTC"))
print("GDPR deadline :", gdpr_deadline.strftime("%a %Y-%m-%d %H:%M UTC"))
print("HIPAA ceiling :", hipaa_ceiling.strftime("%a %Y-%m-%d"), "(individual notice, calendar days)")
print()
print(f"{'T+h':>4} {'when (UTC)':<17} {'owner':<18} step")
for h, step, owner, gate in steps:
t = aware + timedelta(hours=h)
print(f"{h:>4} {t.strftime('%a %m-%d %H:%M'):<17} {owner:<18} {step}")
submit = aware + timedelta(hours=64)
print()
print("Buffer before GDPR deadline (hours):", (gdpr_deadline - submit) / timedelta(hours=1))
print("Individual-notice internal target (day 14):", (aware.date() + timedelta(days=14)).strftime("%a %Y-%m-%d"))
print("Days of HIPAA ceiling left at that target:", (hipaa_ceiling - (aware.date() + timedelta(days=14))).days)
# Independent recomputation with epoch seconds and ordinal day numbers.
epoch = calendar.timegm((2026, 11, 6, 14, 0, 0))
deadline_epoch = epoch + 72 * 3600
check_deadline = datetime.fromtimestamp(deadline_epoch, tz=timezone.utc)
check_ceiling = date.fromordinal(date(2026, 11, 6).toordinal() + 60)
offsets = [h for h, *_ in steps]
ok = (check_deadline == gdpr_deadline
and check_ceiling == hipaa_ceiling
and offsets == sorted(offsets)
and max(offsets[:-1]) < GDPR_HOURS
and submit < gdpr_deadline)
print("CHECK epoch and ordinal recomputation agree, milestones ordered and before deadline:", ok)
assert ok
# The common wrong reading: 72 hours counted as 3 working days.
d, left = aware, 3
while left:
d += timedelta(days=1)
if d.weekday() < 5:
left -= 1
print("Wrong reading (3 working days) would give:", d.strftime("%a %Y-%m-%d %H:%M UTC"),
"which is", (d - gdpr_deadline) / timedelta(hours=1), "hours late")
Output:
GDPR clock starts: Fri 2026-11-06 14:00 UTC
GDPR deadline : Mon 2026-11-09 14:00 UTC
HIPAA ceiling : Tue 2027-01-05 (individual notice, calendar days)
T+h when (UTC) owner step
0 Fri 11-06 14:00 Incident commander Breach confirmed; awareness time written in the log
2 Fri 11-06 16:00 Incident commander Counsel and data protection officer briefed; legal hold issued
18 Sat 11-07 08:00 Forensics lead Scope v1: datasets, record counts, was data copied out
26 Sat 11-07 16:00 Privacy counsel Regulator notice draft with the Art. 33(3) fields
44 Sun 11-08 10:00 Counsel, DPO Counsel and DPO review complete
52 Sun 11-08 18:00 General counsel Executive approval (a named deputy covers the weekend)
64 Mon 11-09 06:00 DPO Target submission to the supervisory authority
72 Mon 11-09 14:00 - GDPR hard deadline
Buffer before GDPR deadline (hours): 8.0
Individual-notice internal target (day 14): Fri 2026-11-20
Days of HIPAA ceiling left at that target: 46
CHECK epoch and ordinal recomputation agree, milestones ordered and before deadline: True
Wrong reading (3 working days) would give: Wed 2026-11-11 14:00 UTC which is 48.0 hours late
How to read it. The GDPR deadline is Monday 2026-11-09 14:00 UTC, exactly 72 hours after the start. The submission target is T+64 hours, Monday 06:00 UTC, which leaves an 8-hour buffer. The HIPAA ceiling is Tuesday 2027-01-05, 60 calendar days after 2026-11-06. An internal target for individual patient notices of day 14 (Friday 2026-11-20, an assumption) leaves 46 days of the ceiling unspent, which is the point: the ceiling is for emergencies, not planning. The final line shows the usual mistake. Reading 72 hours as three working days moves the deadline to Wednesday 14:00 UTC, which is 48 hours after the real one.
Reading the code
- Epoch seconds are the count of seconds since 1970-01-01 00:00 UTC.
calendar.timegmturns a UTC date and time into that count, so adding72 * 3600(72 hours of 3,600 seconds each, 259,200 seconds) and converting back gives the deadline without usingtimedelta. That is the first independent check. - Day ordinals number every calendar day in one running sequence (day 1 is 0001-01-01).
toordinal()gives the number for 2026-11-06, adding 60 moves 60 days on, andfromordinalturns it back into a date. That is the second independent check. [h for h, *_ in steps]goes through thestepslist; each step is a tuple of four items,h, *_keeps the first (the hour offset) ashand discards the other three. The result is the list of offsets, and the check confirms it is already sorted and that every milestone before the last is under 72.- The final loop moves one day at a time from Friday and counts a day only when
weekday()is below 5 (Monday is 0, Sunday is 6). Saturday and Sunday are skipped, so three counted days end on Wednesday. CHECK ... Truemeans all five tests in theokexpression passed.
Both deadlines can be redone by hand. Friday 14:00 plus 24 hours is Saturday 14:00, plus 48 is Sunday 14:00, plus 72 is Monday 14:00. For HIPAA, November has 30 days, so 30 - 6 = 24 days remain in November after the 6th, December adds 31 for 55, and 5 more days reach 5 January: 24 + 31 + 5 = 60.
Who is told what, by when
| When (UTC) | Notice | Contents and gate |
|---|---|---|
| By Mon 2026-11-09 14:00 (target 06:00) | GDPR Article 33 notice to the supervisory authority for the EU dataset | Fields known so far, unknowns flagged; gate: forensics facts, counsel and DPO review, executive approval |
| Soon after, if risk to people is high | GDPR Article 34 notice to affected EU individuals | Plain language: what happened, likely consequences, what they can do, contact point; gate: DPO and counsel judgement that risk is high |
| Internal target Fri 2026-11-20; ceiling Tue 2027-01-05 | HIPAA notice to affected US patients | Description of what happened, types of information, steps people should take, what the organisation is doing, contact details; gate: privacy officer and counsel |
| As counsel determines | HHS, media, customers under contract, state regulators, card or other sector bodies | Depends on counts, state of residence and contracts |
Whether the EU regulator notice can be skipped depends on the risk judgement in Article 33(1). A confirmed read of a customer database containing personal data is hard to describe as unlikely to result in a risk, and whatever the decision, Article 33(5) requires the breach and the reasoning to be documented.
The judgment
I would file the GDPR notice at the Monday 06:00 UTC target (approval is complete from Sunday 18:00), not at 14:00, with the facts known, and send the supplement as the investigation completes. I would not wait for the full scope, because the rule rewards a prompt partial notice and punishes silence. What would change the plan: if forensics shows the awareness moment was earlier (for example, a reasonably certain finding on Wednesday), the clock started then and the deadline has already moved; if we are a processor, the controller needs our notice first and its own clock follows; if the breach affects 500 or more people, HIPAA requires notice to HHS at the same time as the notices to individuals (45 CFR 164.408), and a breach involving more than 500 residents of one US state adds notice to the media (45 CFR 164.406); breaches below 500 are logged and reported to HHS within 60 days after the end of the calendar year, and US state laws set their own thresholds.
Common mistakes
- Counting the 72 hours from the attacker's first access instead of from awareness, or counting working days instead of hours.
- Treating the 60-day HIPAA figure as the plan instead of the ceiling.
- Treating the EU and US datasets as one population, so that one regime's deadline is applied to the other's people.
- Having no deputy approver, so a weekend absence consumes the buffer.
- Waiting for complete facts before filing anything.
- Quoting the deadlines as legal certainty. They are inputs from the regime text; counsel confirms the applicable law, the controller or processor role and the day-count convention.
Running the code
python3 notification_clock.py
The program uses only the Python standard library (Python 3.12). Save the listing as notification_clock.py and run the command above. It is an illustration of one scenario with a fixed start time and two supplied rules; a real process also handles time zones for the approvers, several affected states, partial scope changes and extensions the regime allows, none of which this program models.
During an incident that may involve personal data exposure, when do you bring in legal and compliance, and why does it matter whether counsel directs the investigation? What do you preserve, and how do you handle the pull between fast containment and keeping evidence intact for regulators and possible litigation?
Sample Answer
The idea in plain words
Bring legal and compliance in at the first credible sign that personal data may have been accessed, not after the technical team is sure. A breach is notifiable when a law or contract requires telling a regulator, the affected people or a customer about it; whether a given breach is notifiable is a legal judgement, not a technical one. Three things depend on that early call: legal deadlines can start running from the moment the organisation is aware, so someone with legal authority has to judge when that is (for example, under the EU GDPR, Article 33, a regulator must be told within 72 hours of becoming aware of a personal data breach, where feasible, unless it is unlikely to result in a risk to people; US state laws, sector rules and contracts add their own clocks, and counsel confirms which apply); the organisation may want its investigation to be privileged (legal communications and work prepared for legal advice that a court may allow it to withhold from an opponent or regulator); and a legal hold (an instruction to stop deleting anything that may be relevant to an investigation or lawsuit) has to be placed before the evidence expires. Fast containment and intact evidence are reconciled by sequencing: copy first, contain second, document both.
When to involve counsel
The trigger is "reasonable suspicion that personal data was accessed, disclosed, lost or altered", not "confirmed breach". Examples that meet it: an alert that a database holding customer records was queried from an unknown address; a laptop with unencrypted personal data reported stolen; a misconfigured storage bucket found to be publicly readable. At that point the incident commander tells the privacy or general counsel and the data protection officer (DPO, the person responsible for privacy compliance in organisations that have one). Waiting for certainty is the common error: by the time everyone is sure, a notification deadline may already be partly spent, and the written record may already contain speculation that counsel would have advised against.
Why it matters whether counsel directs the investigation
- Privilege. In some legal systems, communications between a lawyer and client made to obtain legal advice, and materials prepared in anticipation of litigation, are protected from disclosure. If outside counsel hires the forensic firm under a counsel engagement (the law firm signs the contract with the forensic firm, directs its scope, and receives its report), and the firm reports to counsel, so that the work is carried out to help counsel advise on legal exposure, there is a stronger basis to claim protection for the analysis and the draft conclusions. Whether and how far this works depends on the jurisdiction and on the facts: a report used for ordinary business purposes, or shared widely, may lose protection, and the underlying facts (what logs show, which files were accessed) are never privileged. A concrete contrast: in one structure, the outside law firm hires the forensic firm, the forensic report is addressed to the law firm, and the law firm tells the board and company what it needs to give legal advice. In the other, the IT department hires the forensic firm directly, the report goes to IT and is forwarded to the board, the insurer and the customers; the first has a stronger basis for a privilege claim, the second a weak one. So counsel decides the engagement structure; engineers should not assume privilege exists because a document is labelled "privileged".
- Legal judgement is needed anyway. Whether an event is a notifiable breach, when the organisation became aware, what the regulator and contracts require, and what to say to affected people are legal decisions.
- Control of the narrative record. Counsel can shape who receives the sensitive early drafts and can stop speculative conclusions from circulating in writing.
How to word emails and tickets before counsel has assessed
Write observations, not conclusions. Do not delete or avoid writing; the aim is an accurate, restrained record.
| Avoid | Write instead |
|---|---|
| "We got hacked and the customer data is stolen" | "At 02:10 UTC the audit log shows 1,200 queries to the customers table from account svc-reports at an address not seen before. Investigating." |
| "This happened because Priya forgot to patch" | "Host web-14 was running version 2.3; the fix is in 2.4. Cause under investigation." |
| "No data left the building" | "No evidence yet of data leaving. Logs for the egress path are being reviewed." |
| Forwarding the thread to a wide list | Post in the incident channel with a limited membership and tell counsel where it is |
Keep the working record of the investigation in one place, and mark communications that seek legal advice, for example "Prepared at the request of counsel". Understand that the label alone does not create privilege.
What to preserve
- Logs: authentication, VPN, cloud control-plane audit logs, database audit logs, network flow logs (records of which addresses talked to which, when and how much, without the content), web and application logs, endpoint security tool data, for a window covering well before the first suspected activity.
- System state: disk images or snapshots of affected systems, memory captures and the list of open network connections where the host is still running, configuration and deployment history.
- Business and communication records of the incident: tickets, chat and email of the response, call notes, decision log, status-page history.
- Third-party material: vendor logs, backups and old snapshots that may hold the older copies of data.
- The chain of custody record: for every item, who collected it, when, how, a hash (a fingerprint that changes if the file changes), where it is stored, and each hand-off.
The effect of a legal hold issued mid-incident
A hold suspends any automatic deletion of in-scope material. In practice that means three decisions made at once:
- Log retention. Rolling deletion has to stop for in-scope sources. Arithmetic example with assumed inputs: logs are kept for 30 days, and the first suspected attacker activity was 41 days ago. Logs from the first 41 - 30 = 11 days of the intrusion window have already been deleted. If the hold is issued three days later, a further 3 days are lost, 14 in total, because every day one more day of the window ages out. So the hold goes out the same day, and someone checks cold storage (cheap long-term storage that holds older logs, often beyond the normal retention period), the security information and event management (SIEM) archive (the central log-collection and alerting system, whose older data is often archived separately), and backups for older copies.
- Rebuilds and wipes. Systems in scope are imaged first, and wiped or rebuilt only with a written release. Routine rebuilds on the affected hosts pause; rebuilds on clean replacements proceed.
- Scope and cost. Counsel sets the scope, since over-broad holds are costly and under-broad holds are risky. Retained personal data stays under access control and has a defined review and release date.
Containment versus intact evidence
The pull is real but narrow. Most containment steps (blocking an address, disabling an account, moving a host into a network segment that blocks its traffic, which cuts the egress path, the route by which data leaves the organisation) do not destroy evidence if a snapshot and a record come first. Steps that do destroy evidence (reimaging, terminating instances, wiping devices, restarting services that hold in-memory state) wait for the copy. If a step cannot wait because data is leaving now, take it and document why, what was lost, and who approved. A regulator or a court sees a documented, reasoned trade-off far better than silent loss.
What I would do in order
- Tell counsel and the DPO as soon as personal data is plausibly involved.
- Issue the legal hold with counsel the same day.
- Image and snapshot before changing anything that destroys state; start the chain-of-custody register.
- Contain with the least destructive step that stops the harm.
- Keep written communications factual and limited; route cause and impact questions through counsel.
- Keep a decision log so the choice to contain before the full image can be defended.
Common mistakes
- Waiting for confirmation before calling legal.
- Assuming a "privileged" label protects a document, or sharing a privileged report widely.
- Letting log rotation continue because the hold "has not been formalised".
- Writing a root-cause opinion in a ticket on day one.
- Rebuilding first and documenting later.
After an incident involving suspected data theft, how does the post-incident review and evidence handling differ from a normal operational postmortem? Cover who is involved, what is preserved and for how long, what can be written down and shared, and how recovery proceeds without destroying evidence.
Sample Answer
The idea in plain words
A normal operational postmortem asks "what broke and how do we stop it happening again", and it is written openly, blamelessly (focused on systems, not on punishing people) and shared widely. When data theft is suspected, the same event may also become a legal matter: regulators, customer contracts, lawsuits, insurers and possibly police. So the review changes shape. Evidence is preserved before anyone tidies up, counsel (the company's lawyers) steers the investigation, and what is written and who reads it are controlled. The insight: there are two outputs, a privileged investigation and a shareable lessons-learned document, and the order is evidence first, recovery in parallel without touching the evidence, lessons last.
Terms used here:
- Legal hold: a written instruction, normally issued by counsel, to stop deleting any record that may be relevant to a legal matter. It overrides routine deletion until counsel releases it.
- Chain of custody: a documented record of every hand-off of a piece of evidence (who held it, when, why), so nobody can claim it was altered.
- Forensic image: a bit-for-bit copy of a disk or snapshot of a volume, with a cryptographic hash (a fingerprint such as SHA-256) recorded so any later change is detectable.
- Write-once location: storage that accepts new files but does not allow existing ones to be changed or deleted for a set period, so saved evidence cannot be altered.
- Disk image and memory image: a disk image is a complete copy of a drive's contents. A memory image is a copy of what was in the machine's RAM at one moment, including running programs, encryption keys and open network connections, all of which vanish when the machine powers off.
- Bastion host: a hardened server that administrators log in through to reach internal systems, so its logs show who entered.
- Autoscaling teardown: automation that shuts down and deletes servers when load drops, which would erase an affected server along with its evidence.
- Credential metadata: records about a credential (when it was created, last used, from where, what it can reach), not the secret itself.
- Discoverable document: a written record that a court or opposing party can require you to hand over in a legal dispute.
- Privilege: protection that can keep confidential communications made to obtain legal advice out of a court or regulator's reach. Whether a given document is protected depends on the country and the facts, so counsel decides how the work is structured.
How the two reviews differ
| Dimension | Normal operational postmortem | Suspected data theft review |
|---|---|---|
| Who leads | The service owner or an SRE facilitator | Counsel directs; an incident response (IR) lead and a forensic examiner (internal, or an outside firm engaged through counsel) run the work |
| Who is involved | Responders, service owners, managers | The same technical people for system knowledge, plus counsel, security, privacy or compliance, communications, an executive sponsor, and HR only if an insider is suspected. Access is need-to-know |
| What is preserved | Timeline, graphs, tickets, chat export | Disk and memory images with hashes, all logs covering the attack window and the weeks before it, cloud audit trails, the responders' own chat and tickets, access records, and the custody ledger |
| For how long | Under the normal document retention schedule | Under legal hold until counsel releases it in writing, which happens when the regulatory, litigation and insurance matters are closed. The length is a counsel and retention-schedule decision, not an engineering one |
| What is written | Open narrative, contributing factors, opinions, "we should have..." | Facts with their source and time. No speculation, no legal conclusions ("we were negligent", "this breach violated..."), no guesses about what data was taken until the evidence supports it |
| Who can read it | The whole engineering organisation | Investigation report held by counsel; the broad lessons document only after counsel reviews it |
| How recovery proceeds | Fix and redeploy quickly | Image first, rebuild beside the affected system, keep the original isolated and intact |
Method, in the order you would do it
- Bring counsel in at the first suspicion of theft, before the timeline is written. Work done at counsel's direction for the purpose of legal advice has a better chance of being privileged than the same work done on engineering's own initiative.
- Issue the legal hold within the first hours. Name the systems, accounts, mailboxes and chat channels. Suspend automated deletion for exactly those sources: log expiry rules, ticket archiving, autoscaling teardown, disk recycling.
- Preserve before touching. Take snapshots or images, hash them, store them in an access-controlled, write-once location, and open a custody ledger entry for each.
- Recover in parallel, not in place. Build a clean replacement from known-good code in a new account or network segment. Leave the affected system isolated (no network) but powered and intact until the forensic examiner releases it. Rotate or disable stolen credentials right after the current credential metadata and logs have been exported (a matter of minutes), because rotation changes what the logs show afterwards, and not later than that, because the credential is the attacker's access.
- Investigate under counsel. Findings are recorded as facts with sources. Opinions and hypotheses go to counsel, not into open chat.
- Produce two documents. The privileged investigation report stays with counsel. The lessons-learned document describes control changes (for example "alert on bulk reads by service accounts") derived from established facts, and goes to the wider organisation after counsel review.
- Close the hold only on counsel's release, then delete or archive according to the retention schedule.
Worked scenario (all inputs are assumptions)
Assume a database service account read the customer table from an unfamiliar address over about three hours. Timeline of one possible response:
| Time | Action | Why |
|---|---|---|
| Day 0, 14:00 | Alert fires; on-call confirms the reads are not a known job | Detection |
| 14:30 | IR lead declares a suspected data theft incident and calls counsel | Counsel from the start |
| 15:00 | Legal hold issued for the database, the service account's logs, the bastion host, the responders' chat channel; log expiry suspended for those sources | Stops routine deletion |
| 15:15 | The service account's credential metadata and access logs are exported (minutes of work), then the credential is disabled, ending the unfamiliar reads | Containment as soon as the records it would change are captured |
| 15:30 | Database volume snapshot taken and hashed; custody entry 1 written | Evidence fixed before change |
| 15:45 | Snapshot copied to the evidence store and the hash compared; custody entry 2 written | Working copy kept apart from the original |
| 16:00 | SRE starts a clean replacement stack in a new account; the old one is cut from the network but left intact | Recovery without overwriting |
| Day 1, 09:00 | Forensic examiner given read access to the copy; custody entry 3 written | Analysis under counsel's direction |
| Day 1, 12:00 | Counsel assesses, from the facts so far, whether any notification duty has been triggered and notes the moment of awareness (for example, under EU GDPR Article 33 the supervisory authority is told within 72 hours of the controller becoming aware, where feasible, and information may follow in phases; other regimes and contracts set their own clocks) | Legal clocks run from awareness, not from the end of the investigation |
| Day 10 | Forensic examiner finishes the factual timeline; counsel updates any notices with the confirmed facts | Facts first for the report, not for the clock |
| Day 14 | Lessons-learned review with owners and dates for control changes; counsel clears it for wide sharing | Learning without exposure |
The days in the last three rows are assumptions for illustration. The point is the ordering: hold, then export the records the credential change would alter, then disable the credential, then image and rebuild beside, then lessons. The export takes minutes, so it delays containment only briefly; containment never waits for the image, the rebuild or the investigation, because the theft may still be running.
Illustrative custody ledger rows for the 15:30 snapshot (hash shortened for display):
| Entry | Item | Hash (SHA-256) | From | To | When (UTC) | Purpose |
|---|---|---|---|---|---|---|
| 1 | Snapshot of the database volume | 9f2c...e41a | SRE engineer A (created it) | IR lead | Day 0, 15:30 | Preserve state before any change |
| 2 | Copy of the snapshot in the evidence store | 9f2c...e41a | IR lead | Evidence store (write-once) | Day 0, 15:45 | Working copy kept apart from the original; same hash confirms it is identical |
| 3 | Read access to the copy | 9f2c...e41a | Evidence store | Forensic examiner | Day 1, 09:00 | Analysis under counsel's direction |
The same finding written two ways
| Open postmortem style | Counsel-controlled style |
|---|---|
| "The attacker got in because Priya never rotated the key, and they probably took every customer's record." | "At 14:02 UTC the service account read the customer table from an address not previously seen (source: database audit log). The key's last rotation date is recorded in the key metadata (source: key management record). The volume of data read has not yet been determined." |
The second version states what was observed, where the proof lives, and what is still unknown, and it names no person and draws no conclusion about fault or about what was taken.
How long evidence is kept
There is no single number. The hold lasts until the last open matter closes, and regulatory enquiries and lawsuits can run for years, so in practice a hold is measured in months to years, not weeks. Routine retention, such as 30-day log expiry, would have deleted the evidence long before then, which is why the hold suspends it. Counsel sets the end date and releases the hold in writing.
Judgment and pitfalls
I would commit to counsel-led evidence handling from the first hour, accept that the engineering write-up goes out later and in a narrower form, and never trade evidence for speed of cleanup. What would flip this: if the facts show a pure outage with no data access, the review reverts to the normal blameless format, and the hold is released on counsel's say-so.
Common mistakes:
- Speculating about "what they took" or "who is at fault" in a public chat channel, which then becomes a discoverable document, as defined above.
- Terminating the compromised instance to stop the cloud bill, destroying the memory and disk state.
- Sharing the first draft with the whole company, then being unable to correct it.
- Treating "blameless" as a reason to hide facts. Blamelessness governs how people are treated, while the hold governs what must be kept. If an insider is suspected, HR and counsel handle individual conduct separately, and the technical review stays about systems.
- Deleting or rewriting messages "for tidiness" after the hold, which can itself create legal exposure.
A production service returned another customer's sensitive personal information in its responses, and a customer has complained publicly. You are on call. Describe your first six hours: containment, how you scope what was exposed, when legal and compliance learn of it, what you say to customers and stakeholders, and which permanent fixes you prioritize.
Sample Answer
The idea in plain words
A service that returns one customer's personal data to another customer is a personal data breach, even though no attacker is involved: the data reached someone who was never entitled to it. A breach is a security incident where personal data is disclosed, altered, lost or accessed without authorization. So the first six hours are run as a security incident, not as a bug ticket. The order is: switch the leak off with a change that destroys no evidence while copying whatever the permanent fix would destroy, bring legal in early because legal deadlines start when the company becomes aware, say only verified facts to customers, and only then argue about the permanent fix.
Terms used below. Tenant: one customer account (one organisation) in a service that many customers share; in this context "customer" and "tenant" mean the same thing, and tenant isolation means one tenant's data is never visible to another. Incident commander (IC): the one person who coordinates and decides, and does not debug. SEV1: in one common scheme, the top severity level (some organisations number from 0 or use different names), used for widespread or sensitive customer harm. Blast radius: how many customers, records and time span are affected. Mitigation: stops the harm now (turn something off). Remediation: removes the cause for good. Kill switch / feature flag: a setting that turns a code path off at runtime without a new deploy. Canary release: sending a new version to a small share of traffic first. Synthetic test: a scripted fake user run continuously against production. Regression test: a test that failed before the fix and guards against the bug returning. Row-level security: a database feature that applies an access policy to every query so it returns only the rows the caller is allowed to see, whatever the application asks for. Holding statement: a short interim message saying you are aware, what is being done, and when you will say more.
Hour 0 to 1: declare, contain, freeze the evidence
- Declare SEV1 and name roles. Page the IC, a scribe (keeps a timestamped log of every decision), a communications lead, and a technical lead. A public complaint plus cross-customer data is declared immediately; do not wait to reproduce it.
- Copy what the fix will destroy, starting now and in parallel with step 3. Take a copy of the evidence that a rollback, redeploy or purge would destroy: the complaining customer's screenshot and request ID, the relevant service logs, the current deploy version and configuration, and a sample of the bad responses if the cache or database holds them. Write down who copied what and when (chain of custody: a record of every hand-off of evidence).
- Contain with the fastest reversible switch. A feature flag or kill switch destroys nothing except the flag's previous value, which the flag system's change history keeps and the scribe notes, so flip it without waiting for the copies in step 2; a rollback, redeploy or purge destroys state, so it waits until those copies are done. Order of preference: a feature flag or kill switch that disables the suspect code path; rollback to the last release known to be correct; temporarily taking the affected endpoint offline (returning an error is better than returning someone else's data). Availability is worth sacrificing here, because every extra response may be another disclosure.
- Purge shared state that still holds wrong data. If a cache or queue stored mixed-up responses, flush it only after step 2 has sampled it.
- Verify containment, do not assume it. Replay the reproducing request as two different test tenants and confirm each sees only its own data. Keep the endpoint monitored for any further response where the authenticated tenant differs from the data owner.
Hour 1 to 3: scope what was exposed
Scoping answers four questions: when did it start, when did it stop, whose data went where, and what kind of data.
- Window. Start = the deploy, config change or flag flip that introduced the defect (from the deploy log); end = the verified containment time.
- Mismatch query. From request logs, count responses where the tenant making the request is not the tenant who owns the returned records. An illustrative log line and query (generic field names):
ts=2026-03-03T10:12:41Z request_id=r-81 caller_tenant=t-204 record_tenant=t-377 endpoint=/v1/profile status=200
SELECT caller_tenant, record_tenant, COUNT(*) FROM request_log
WHERE ts BETWEEN '2026-03-03T08:20:00Z' AND '2026-03-03T14:45:00Z'
AND caller_tenant <> record_tenant
GROUP BY caller_tenant, record_tenant;
The sample line is a mismatch because the caller is t-204 and the record belongs to t-377. Each row the query returns is one pair, which gives both lists needed below: who saw data, and whose data was seen. If the logs do not store the owner of the returned data, add the owner ID to the log line now for the remaining traffic, and for the past window reconstruct it from cache keys, database query logs or a replay in a test environment.
- Data classes. Which fields can the endpoint return: names, contact details, payment data, government identifiers, health data? The class decides which laws and notices apply.
- Direction. Each leaked record has two sides: the person whose data was shown, and the customer who saw it. Both lists are needed.
Sizing before the exact query finishes uses an assumption, not a fact. Assume the defect shipped at 08:20, complaint arrived at 14:00 (T+0), and containment was verified at 14:45, so the window is 08:20 to 14:45 = 6 h 25 min = 385 minutes. Assume the endpoint serves 120 requests per minute and a test of the faulty build suggests 3 percent of responses were mixed up (for example, 1,000 recent requests replayed against a copy of the faulty build in a test environment, of which 30 came back with another tenant's record; 30 / 1,000 = 3 percent, and a replay sample may not match real traffic). Requests in the window = 385 x 120 = 46,200. Estimated cross-customer responses = 46,200 x 0.03 = 1,386. This is only a sizing guess to decide who must be in the room; the notified numbers must come from the log query, and the 3 percent must be replaced by the measured count.
When legal and compliance learn of it
Within the first hour, at declaration, not at hour six. Reasons: the company's notification clocks begin when it becomes aware of a breach, legal decides what is privileged (protected by legal privilege, meaning communications made to get legal advice that can be withheld from disclosure, so counsel should direct how some written analysis is produced), and counsel should shape what is written in the incident log. For example, under GDPR (the EU General Data Protection Regulation) Article 33 the controller (the organization deciding why and how the data is processed) must notify the competent supervisory authority (the national data protection regulator) within 72 hours of becoming aware, where feasible, unless the breach is unlikely to result in a risk to people; Article 34 requires telling affected individuals without undue delay when the risk is high. A multi-tenant service is usually the processor for its customers' personal data; in that role its own duty (Article 33(2)) is to tell each customer, the controller, without undue delay after becoming aware, and each customer's 72-hour clock then runs from when it is told. The 72-hour rule binds the company directly only for data it controls itself. Other regimes (US state laws, sector rules, contract clauses with customers) have their own clocks, so counsel decides which apply. For data the company controls itself, if awareness is judged to be 15:00 on a Tuesday, the 72 hours end at 15:00 on the Friday of that week (3 days x 24 hours = 72). The engineering role is to give counsel facts and a "known / unknown / next update at" sheet, not a legal conclusion.
What to say, and when
- Hour 1 to 2: a holding statement to the public complainant and the support team: we are investigating, the affected function has been disabled, we will update by a stated time. No cause, no numbers, no blame.
- Hour 3 to 6: a customer-facing update reviewed by legal: what happened in one sentence, what data classes were involved, what we did, what the customer should do (if anything), and the next update time. State only what the logs verify. Update the status page with the same wording support uses.
- Internal: executives get a short written brief every hour, with severity, customers affected (estimated vs confirmed, clearly marked), decisions needed. Support gets a script and an escalation path. The customers who saw other data and the customers whose data was shown are different audiences with different messages.
- Hour 6: hand off. The IC hands the incident to the next shift with the log, open questions and clock list, because tired responders decide worse and a fresh commander sees gaps the first one stopped seeing.
Permanent fixes, in priority order
If only two get funded first, they are items 1 and 2: the cause removed and isolation made structural, because the rest detect or soften a failure that those two prevent.
- Fix the root cause and add a regression test that fails before the fix: two tenants, same request, assert no cross-tenant data.
- Make the isolation structural: tenant ID in every cache key and database query, row-level security where the database supports it, and a response-time check that rejects any record whose owner differs from the caller.
- Detect it faster than a customer can: an alert on the tenant-mismatch count, and a synthetic test with two tenants run continuously in production.
- Safer rollout: canary releases and automatic rollback on the mismatch alert.
- Process: a blameless post-incident review within a week, with owners and dates on every action, and a record of the breach decision (including the reasons, whether or not notification was required).
Common mistakes
- Calling it a bug and keeping legal out until the fix is done.
- Flushing the cache or rolling back before copying the evidence (flipping a feature flag is safe to do first), so the scope can never be proven.
- Quoting an estimated number to a customer as if it were confirmed.
- Declaring "contained" without a two-tenant test.
- Starting the notification clock at the end of the investigation instead of at awareness.
Unlock Full Question Bank
Get access to all 21 Security Incident and Breach Response interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.