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 data breach is traced to a misconfigured storage bucket owned by another team, and that team says unclear ownership boundaries were the cause. What safeguards do you put in place to prevent recurrence, how do you handle accountability without blame, and how do you rebuild trust with customers and the other team?
Sample Answer
The idea in plain words
Two things failed, and fixing only one invites a repeat. The technical failure: a storage bucket (a cloud container for files) was reachable by people who should not have reached it. The organisational failure: nobody could say clearly whose bucket it was, so nobody was checking it. The other team's statement that unclear ownership boundaries were the cause is probably true and should be treated as a finding, not an excuse. The response is therefore layered: stop this class of misconfiguration being possible, make sure every resource has a named owner, detect what slips through, hold people accountable for outcomes and fixes rather than for being unlucky, and prove with evidence that the fixes work before telling customers and auditors that they do.
Terms used here:
- Blameless / just culture: reviewing what the system allowed rather than who to punish, while still separating honest mistakes from reckless behaviour.
- Guardrail (preventive control): a rule enforced by the platform so the unsafe action is refused, not merely discouraged.
- Detective control: a check that finds a problem after it exists.
- Infrastructure as code (IaC): cloud resources defined in reviewed files and created by a pipeline, so rules can be checked before anything is built.
- Break-glass: a pre-approved, logged emergency action that lets the security team override an owner when the owner cannot be reached.
- Configuration drift: a resource slowly differing from how it was first set up, for example a private bucket later made public by a manual change.
- Data classification: a label saying how sensitive data is, for example public, internal, confidential, restricted; controls are chosen by the label.
- Cost centre: the budget line a resource is billed to, which is why it is a useful second pointer to a responsible team.
- RACI: the responsibility matrix named in the table below. R (responsible) does the work, A (accountable) owns the outcome and is one named role, C (consulted) is asked first, I (informed) is told afterwards.
Safeguards, in layers
| Layer | Safeguard | What it stops |
|---|---|---|
| Prevent | Account- or organisation-level setting that blocks public access to storage by default (an account-level public access block: a switch that overrides any single bucket's own permissions, offered in some form by the major clouds), with exceptions requiring a logged approval | A new bucket being exposed by one wrong click or one line of config |
| Prevent | Policy checks in the IaC pipeline: the build fails if a storage resource is public, unencrypted or has no owner field. An illustrative rule and failure message: rule: storage.public_access == false and tags.owner is set, failing as FAIL customer-exports: public_access=true; tag owner missing | Misconfiguration reaching production |
| Prevent | Creation of any storage resource is denied unless it carries an owner (a team, an on-call alias and a cost centre) and a data classification | The "whose is this?" gap at birth |
| Detect | Continuous configuration scanning and an inventory that joins every bucket to its owner, with alerts routed to the owning team and, after a deadline, to their manager | Drift after creation |
| Detect | Sensitive-data discovery (a scanner that samples file contents for patterns such as card numbers or national IDs) on buckets whose classification is missing or low | Misclassified data |
| Respond | Auto-remediation (the platform closes the exposure itself) or break-glass lock-down of any bucket that is public and holds data classified sensitive, by the security team, with the owner told immediately | Long exposure while an owner is unreachable |
| Govern | Quarterly orphan review (a check for resources whose owning person or team no longer exists): any resource whose owner left, merged or reorganised is reassigned or deleted; ownership changes are part of the reorganisation checklist | Ownership decaying over time |
| Govern | A written responsibility matrix (RACI, defined above) for shared data stores. For a shared bucket: platform team R for the account-level settings, data team A for the bucket and its contents, security C for classification, customer support I | Boundary disputes between teams |
If I could build only two first, they are the account-level public access block and the deny-without-owner rule at creation: together they stop the failure and the "whose is this?" gap for every future bucket, while the rest of the table finds what already exists and keeps the result honest.
Accountability without blame
- Accountable means owning the outcome and the fix, with a named director responsible for the closure of each action and a date. It does not mean the person who last touched the bucket is punished.
- Use the review to answer "how did the system let a well-meaning engineer do this unnoticed?" Treat deliberate or reckless disregard of a known rule as a separate matter for management and HR, not for the technical review.
- Where the organisation never assigned ownership, accountability sits with the leaders who set up the boundary. Say so plainly in the review. That is also what makes the other team willing to participate honestly.
- Make the other team a co-author of the corrective action plan, with budget and time to do the work, not an unfunded mandate.
- Keep statements of fault out of customer and open channels while counsel reviews them.
Verifying that the fixes worked
A control that has not been tested is a hope. For each safeguard keep a dated test and its saved output:
- Attempt the original mistake. In a non-production account, try to create a public bucket and a bucket with no owner through the normal pipeline and by hand. The expected result is a refusal. Save the denial logs.
- Population check. (Count the whole population of resources rather than sampling.) Export the inventory and count: buckets total, buckets without an owner, buckets public, buckets with sensitive data and no encryption. The target for the last three is zero, or a short list of approved exceptions with expiry dates.
- Detection drill. Deliberately expose a test bucket holding a marker file and measure the time to alert and to lock-down. Repeat it each quarter.
- Independent check. Have internal audit or an outside assessor re-run the population check and sample the evidence, so the claim does not rest only on the team that built the fix.
- Hold for a period. Report the metrics again after, say, 90 days to show the result lasted. Ninety is an illustrative choice.
Reporting. To customers: what changed in plain terms, how it was verified, the dates, and what is still in progress. Do not say the problem "can never happen again"; say which class of mistake the control now blocks and how that was tested. To auditors: an evidence pack with the change records, configuration exports, test outputs with timestamps, ticket closures and the population counts, so they can re-perform the test.
Worked example (all counts are assumptions)
Assume the inventory shows 412 buckets, of which 37 have no owner. The ownerless share is 37 divided by 412, which is 8.98%, or about 9.0%. Of the 37, assume 9 are classified sensitive (9 of 37 is about 24%). The plan: the 9 sensitive ones get an owner or a lock-down in week 1; the remaining 28 (37 minus 9) get owners or are deleted by week 4; then the rule that blocks creation without an owner means the count can only stay at zero. Success is "0 of N buckets without an owner at the audit date", not "fewer than before".
Rebuilding trust
- Customers: a prompt notice, regular updates (illustrative wording: "Next update by [date and time]. So far we have confirmed [fact]. We have not yet confirmed [unknown]."), a final summary with the verified controls, and a short follow-up report after the hold period. Offer the largest customers a briefing with the engineering owner.
- The other team: acknowledge that the missing ownership model was a leadership gap (illustrative wording: "The gap was that no one was named owner of this store, and that is on how we set up the boundary, not on your engineers. We would like you to write the ownership section of the fix with us."), give them a visible role in the fix, credit them in the final review, and protect them from being the public face of fault.
Judgment
I would put the preventive guardrails and the ownership-at-creation rule first, because they remove the failure for every future bucket instead of one. What would flip it: if the data was highly regulated and the exposure is still ongoing, the break-glass lock-down comes before anything else.
Common mistakes: fixing just that one bucket, naming and shaming the other team, buying a scanner without assigning who responds to its alerts, and telling customers the control is "foolproof" without a tested claim.
After a breach exposed users' personal data, design the recovery program: what happens in the first 72 hours, the mid-term remediation over the following months, the longer-term technical and cultural changes, how you communicate with each stakeholder group, and which metrics tell you trust and security are actually recovering.
Sample Answer
The idea in plain words
A breach recovery program is a promise made in public and kept over months. Containing the incident ends the emergency, but it does not end the damage to trust. So the program has phases, each with a different job: stabilise and tell the truth (first 72 hours), fix what was found and prove it (the next months), then change how the company builds and decides (a year or more). Each stakeholder group gets its own communication, and success is judged by a small set of measurements that would worsen if the company only looked recovered. Measure outcomes (did the weakness get closed, did customers stay), not activity (training sessions held, tickets closed).
Phase 1: the first 72 hours
The aim is to stop exposure, keep evidence and meet the notification clocks.
- Declare the incident, name an incident commander (the single person who coordinates and decides), open a war room and start a timestamped decision log.
- Snapshot affected systems and extend log retention, then close the access path. Capture before you contain, so you can later say which users' data was reached.
- Bring in legal and the data protection officer (DPO, the person responsible for privacy compliance) at once. Under EU GDPR Article 33 the controller (the organisation deciding why and how personal data is processed) notifies the supervisory authority (the data protection regulator) within 72 hours of becoming aware, where feasible, unless a risk to individuals is unlikely. Article 34 requires telling affected individuals without undue delay when the risk to them is high. National, sector and contract rules add other clocks, so counsel confirms which apply.
- Force the actions that protect users now: invalidate sessions, reset exposed credentials, rotate secrets.
- Publish a first honest notice to affected users and a holding statement for everyone else.
Phase 2: remediation over the following months
Assumptions for the worked example: a consumer product, 200,000 accounts, of which 40,000 were in the exposed data set. The program is staffed by taking a fixed share of engineering capacity for two quarters (the example uses 20 percent, a number the executive team must choose and defend). To see what the trade costs, suppose the engineering organisation has 50 engineers: 20 percent is 50 x 0.20 = 10 engineers' worth of time, and over two quarters (about 6 months) that is 10 x 6 = 60 engineer-months taken from the feature roadmap. At 10 percent the same program gets 30 engineer-months and takes roughly twice as long, so the share sets the schedule.
| Window | Product remediation | Security work | Regulatory and legal |
|---|---|---|---|
| Days 4 to 30 | Mandatory password reset for affected accounts, multi-factor authentication (MFA, a second proof of identity) prompts, in-app notice | Root cause confirmed, the exploited weakness closed, a search for the same weakness elsewhere | Initial regulator notice already filed within the first 72 hours, later information supplied in phases (Article 33(4) allows information that is not available at first to be provided in phases without further undue delay), record kept under Article 33(5), which requires the controller to document every personal data breach with its facts, effects and remedial action, whether or not it was notified |
| Months 2 to 3 | Account activity log visible to users, data export and deletion made easy | Inventory of where sensitive data lives, secrets rotation (replacing every password, key and token that may have been exposed) done everywhere, privileged access (accounts that can administer systems or reach bulk data) reviewed | Respond to regulator questions, handle individual requests, track complaints |
| Months 4 to 6 | Data minimisation (keep only the personal data the product needs): stop collecting and delete what the product does not need | Independent penetration test (authorised attackers hired to find weaknesses) of the affected area, detection coverage for the attack path | Evidence pack for the regulator showing each safeguard was delivered |
Roadmap change. Security investment competes with features, so make the trade explicit: freeze or slow named features, state the capacity share (20 percent for two quarters in the example), and have the executive team sign the trade-off. An unfunded commitment is the usual way recovery programs fail by month three.
Phase 3: longer-term technical and cultural change
- Technical: the first two are the quick wins and the rest are year-long projects. Start with logging good enough to answer "who accessed what" in hours, not weeks, and least-privilege access (each person and system gets only the access the job needs) with periodic recertification (the owner re-confirms every few months who still needs each access and the rest is removed). Then data classification (labelling data by sensitivity, with controls attached to each label), secrets management in place of secrets in code, and field-level encryption (encrypting individual sensitive fields such as national ID numbers so one stolen database does not reveal them).
- Cultural: a blameless post-incident review (it examines the system and the decisions, not whom to punish), security champions (engineers in each product team who take on extra security duties and act as the link to the security team) inside product teams, security review as a gate in design and not an afterthought, and an executive who owns the program by name and reports on it every quarter.
Communication by stakeholder
| Group | What they need to hear | Cadence |
|---|---|---|
| Affected users | What data, what we did, what they should do, how to get help | At notice, then when material news occurs |
| All other users | That they are not affected, and what changed | One notice plus a public page |
| Employees | Facts they may repeat, where to send questions, what not to say | At T+4h, then weekly during the program |
| Regulators | Notification, phased updates, evidence of safeguards | Per their requests and your filings |
| Enterprise customers and partners | Scope, impact on their data, commitments, audit access | Direct contact first, written report later |
| Board and executives | Status against milestones, risk, spend | Monthly, quarterly to the board |
| Press and public | One approved fact sheet and a public progress page | Publish milestones, including late ones |
Every channel is written from one version-stamped fact sheet, so the numbers match.
Which metrics show recovery
Pick metrics that can move the wrong way. Group them in three families: security posture (is the company actually safer), trust (do customers behave as though they believe it) and regulatory (what the regulator concluded). The table lists the options; report three first: time to detect a seeded intrusion, excess churn and enterprise questionnaire pass rate, because each can be measured from month 1 and each worsens if the company only looks recovered. For the seeded intrusion, an illustrative reading: the first test takes 9 days to be noticed, the target is under 24 hours, and the retest every quarter shows whether the detection work is real.
| Family | Metric | Why it is honest |
|---|---|---|
| Security | Time to detect a seeded test intrusion (a red-team exercise, meaning authorised testers who play the attacker, plants a known attack) | Measured by trying, not by reporting |
| Security | Share of sensitive data stores with field-level encryption and logged access | Counts closed weaknesses |
| Security | Share of privileged accounts using phishing-resistant MFA (a login method such as a hardware security key that cannot be tricked into handing over the code to a fake site) | Directly addresses the common entry |
| Security | Time to revoke a leaked credential | Tests the response path |
| Trust | Excess churn: monthly churn of affected accounts minus churn of unaffected accounts | Removes the normal background churn |
| Trust | Share of enterprise security questionnaires passed without escalation | Customers voting with their review process |
| Trust | Support contacts tagged "breach" per 1,000 accounts | Falls when anxiety falls |
| Regulatory | Regulator inquiry closed without further action | An outside judgement |
Worked example of the trust metric. Assume unaffected accounts churn at 1.5 percent per month throughout. The 40,000 affected accounts churn at 3.0, 2.4, 1.8, 1.7, 1.6 and 1.6 percent in months 1 to 6.
Excess churn is affected churn minus unaffected churn, month by month:
- Month 1: 3.0 minus 1.5 = 1.5 points
- Month 2: 2.4 minus 1.5 = 0.9
- Month 3: 1.8 minus 1.5 = 0.3
- Month 4: 1.7 minus 1.5 = 0.2
- Month 5: 1.6 minus 1.5 = 0.1
- Month 6: 1.6 minus 1.5 = 0.1
An illustrative recovery rule: excess churn at or under 0.2 points for two consecutive months. Months 4 and 5 are 0.2 and 0.1, so the rule is met at month 5 (month 3 at 0.3 does not count, and neither does month 4 alone). Total excess churn is 1.5 + 0.9 + 0.3 + 0.2 + 0.1 + 0.1 = 3.1 points. Applied to the 40,000 affected accounts that is 3.1 percent of 40,000 = 0.031 times 40,000 = 1,240 accounts lost beyond normal, an approximation that ignores the shrinking base. Use the figure to size the cost of the breach and to compare against what the remediation spend avoided. A single rule like this is a demonstration; a real program also checks cohort size, seasonality, and whether affected users differ from unaffected ones in other ways (for example heavier use), and it reports the posture metrics beside it.
Pitfalls
- Reporting activity (training completions, tickets closed) as if it were recovery.
- Announcing commitments without owners, dates or funding.
- Different numbers in the customer notice, the regulator filing and the board deck.
- Going silent after the first notice; trust recovers on a visible, kept schedule.
- Declaring the program finished when the metrics have only been green for one month.
Design the incident response process for a company that handles regulated financial data and must report a qualifying incident to its regulator within 24 hours of detection. How do you preserve evidence for audits, restrict who sees what, automate data preservation, and test that the process actually meets the deadline?
Sample Answer
The idea in plain words
A 24-hour reporting deadline turns incident response into a race against a clock the company does not control. Normal practice, where leaders gather facts for days and then decide whether to report, no longer works. The design principle: decide in advance everything that can be decided in advance (what counts as "qualifying", who decides, what the first report must contain, who can approve it), and automate everything that does not need judgment (starting the clock, preserving evidence, assembling the report draft), so the humans spend their 24 hours on the few judgments that cannot be pre-made. The deadline in this question is a hypothetical rule used for design; real regimes define the starting event, the qualifying test and the content of a first report differently, so the real definitions come from counsel and the regulator's text, and are written into the process.
Terms used here:
- Qualifying incident: an incident that meets the regulator's reporting criteria (for example, defined thresholds of impact on service or data). The criteria are set by the regulation.
- Detection: the event that starts the clock. The process must define it exactly (for example, the moment an analyst classifies an alert as a possible qualifying incident) and counsel must agree the definition.
- Initial report: the first, partial notice. Many regimes allow it to be incomplete and followed by updates; the process must confirm that this one does.
- Legal hold: counsel's instruction to stop deleting relevant records. Chain of custody: the record of who handled each item of evidence.
- Write-once storage: storage that cannot be altered or deleted until a retention date.
- Tabletop: a discussion-only exercise in which people talk through a scenario; a drill actually runs the systems and the clock. A synthetic alert is a deliberately fabricated alert injected to start a drill. A regulator test channel is a non-production submission route some regulators offer for practice.
- Just-in-time access: permission granted for a short window when needed, then removed automatically. Separation of duties: no single person can both approve a report and alter the evidence behind it.
- Lifecycle and cleanup jobs: automated jobs that delete or archive old data to save cost, which would delete evidence unless told to skip it.
The design
1. Clock and definitions.
- The incident record writes a timestamp, automatically and in UTC, the moment an alert is classified as a possible qualifying incident. Nobody types it in, and nobody can edit it without a logged reason.
- Counsel pre-approves the qualifying criteria as a short checklist the decision-maker applies to facts. An illustrative checklist, with the thresholds left as placeholders because the regulation sets them: (1) Is an in-scope system or dataset affected? Yes, no or unknown. (2) Is the impact at or above the regulator's threshold of [duration, number of customers or records]? Yes, no or unknown. (3) Was regulated customer data accessed or disclosed? Yes, no or unknown. (4) Does any other regime or contract also set a clock? Yes, no or unknown. A rule on the sheet says any "unknown" on item 1 to 3 is treated as yes for the clock and revisited as facts arrive. If a fact is unknown, the default is to treat the clock as running and decide with what is known.
- The initial report template is pre-filled by the system with: incident ID, clock start in UTC, affected systems from the asset inventory, the time the activity was first seen, and a contact. The decision-maker fills in only the fields that need judgment: current impact (known and unknown, in separate lines), actions taken, and the time of the next update.
- Named decision-maker and two delegates, covering all time zones and weekends, with a paging rule if the first does not respond in a set time.
2. Time budget. A budget gives every stage a limit, so a stage that overruns is visible. The hours are assumptions for illustration:
| Stage | Budget (hours) | Ends at hour |
|---|---|---|
| Assemble first facts and complete the incident record (the clock was started automatically at hour 0 by the classification) | 1 | 1 |
| Scoping and checking the qualifying criteria | 3 | 4 |
| Qualification decision by the named decision-maker with counsel | 4 | 8 |
| Draft the initial report from a template pre-filled with system data | 6 | 14 |
| Legal and executive approval | 4 | 18 |
| Submit via the regulator channel and obtain confirmation | 2 | 20 |
| Buffer for channel failure or delay | 4 | 24 |
All hours are counted from the automatic timestamp, so the first row is the first hour after classification, not the work before it. Alert triage that happens before an alert is classified sits outside the table, which is why the definition of detection must be agreed with counsel and not drift later. The stages sum to 1 + 3 + 4 + 6 + 4 + 2 = 20 hours, and the 4-hour buffer brings the total to 24. The stages run partly in parallel in practice (drafting starts before the decision is final), which is where the real slack comes from.
3. Preserving evidence for audits, automated.
The same event that starts the clock triggers a preservation runbook (a scripted procedure), so evidence does not depend on someone remembering at 3 a.m.:
- Tag the affected resources with a hold marker that the lifecycle and cleanup jobs respect.
- Snapshot volumes and export logs and cloud audit trails for the relevant window to a write-once evidence account, then hash each item and write a custody entry.
- Record every decision, including the decision that something is not qualifying and why, because auditors look for the rationale of non-reports as well as reports.
The automation role can create snapshots and copy to the evidence account but cannot delete, so a compromised automation cannot erase evidence. Expressed as permissions, an illustrative version: the role is allowed the actions "create snapshot", "read logs" and "write object" on the evidence account, and has no "delete" or "change retention" action anywhere; the evidence account separately enforces write-once retention, so even a role that did have delete rights could not remove an item early.
4. Restricting who sees what.
- Tiers: the response team sees technical evidence; legal and compliance see the incident record and the draft report; executives see the summary; auditors get read access by request.
- Customer financial data in evidence is visible only to the named examiners, with just-in-time access that expires (for example, in 24 hours) and is logged.
- Separation of duties: the person who approves the report is not the person who can change evidence.
5. Testing that the deadline is met.
- Run timed drills, not only tabletop discussions. Inject a synthetic alert, run the whole chain and submit to the regulator's test channel if one exists, or to an internal stand-in.
- Run some drills at night and on weekends, with a different person in the lead role, and with the primary decision-maker unavailable.
- Record the time of each stage and the end-to-end time. Also verify that the preserved evidence can be restored and its hash matches.
- In production, alarm when the clock reaches 50% (hour 12) without a qualification decision, and again at 75% (hour 18) without a submission.
Worked example of a drill result (assumed values)
Six drills finish after 14.5, 17, 11, 19.5, 13 and 16 hours. Their sum is 14.5 + 17 + 11 + 19.5 + 13 + 16 = 91 hours, so the mean is 91 / 6 = 15.17 hours. The slowest is 19.5 hours (the weekend drill, assumed), which leaves 24 - 19.5 = 4.5 hours of margin, or 4.5 / 24 = 18.75% of the deadline.
An illustrative acceptance rule: every drill must finish within 20 hours, the budget before the buffer. The number that drives the decision is the slowest drill against the budget, not the mean: a deadline is missed by the worst case, not the average. All six pass (the slowest, 19.5, is below 20), but the weekend drill used 19.5 / 20 = 97.5% of the budget, so the process meets the rule only barely and the slow stage (here, approvals) is the first thing to fix. This rule only covers the elapsed time of these six drills. Six drills are too few to claim the real deadline will always be met, because a real incident can bring a bigger scope, an unavailable approver or a regulator channel outage. A real programme also tracks drill results over time, widens the scenarios and keeps the stage budgets visible.
Judgment
I would invest first in the pre-approved qualification checklist and the automated clock-and-preserve trigger, because they remove the two biggest sources of delay: debate about whether to report, and manual evidence work. What would flip it: if the regulator allows only a very thin initial report, the drafting budget shrinks and the approval stage becomes the critical path.
Common mistakes: letting the clock start when "the investigation concludes", having a single decision-maker with no delegate, drafting the report from scratch each time, and testing only in business hours.
Design the process by which your organization captures and stores incident evidence (logs, packet captures, configuration snapshots) so it can stand up in legal or compliance review. How do you control access, record custody, limit privacy exposure, and handle retention against routine deletion and legal holds?
Sample Answer
The idea in plain words
Evidence is only useful in a legal or compliance review if you can show it is genuine, complete, unaltered and handled only by people who had a reason to. So the process is not "save the logs somewhere". It is a pipeline that fixes each item at the moment of capture (hash it, time-stamp it, record who took it), keeps it in storage that cannot be quietly edited, lets only named people read it and records every read, limits how much personal data is collected and exposed, and stops routine deletion for exactly the data a lawyer says must be kept. Whether a particular item is accepted as evidence depends on the jurisdiction and the matter, which is why counsel signs off the design, but the same disciplined habits serve almost every regime. Published guidance such as ISO/IEC 27037 (guidelines for identifying, collecting, acquiring and preserving digital evidence) describes the same principles.
Terms used here:
- Chain of custody: a documented record of every hand-off of an item of evidence.
- Hash: a fixed-length fingerprint of a file, such as SHA-256. Change one bit and the hash changes, so a matching hash shows the file is unaltered.
- WORM / write-once storage: storage where objects cannot be changed or deleted until a set date (object lock is a common name).
- Legal hold: counsel's instruction to stop deleting data that may be relevant to a legal matter.
- Percentile: the 95th percentile of a set of numbers is the value that 95 percent of them are at or below. If 95 of 100 past incidents were noticed within 45 days, 45 days is the 95th percentile of detection delay. Using it sizes retention for nearly all cases instead of the average case.
- Pseudonymise: replace a person's identifiers (name, username) with a code, keeping the lookup table elsewhere under tighter access.
- Purpose limitation: a data protection principle (for example in EU GDPR Article 5) that personal data collected for one purpose is not reused for an incompatible one.
- Lifecycle rule: a storage setting that automatically deletes or moves objects once they reach an age.
- Packet capture (pcap): a recording of network traffic, which may contain the full content of communications.
The design, stage by stage
- Open a case. Declaring an incident creates a case ID. Every item, ledger entry and access request refers to it.
- Capture. Use approved tools and written procedures. Prefer the central log store over a log on a possibly compromised host, since the attacker may have edited the local copy. Record the collection method, the exact source, the start and end of the time window, and the collector. Keep clocks synchronised and express all times in UTC.
- Seal. Compute a SHA-256 hash at capture. Store the hash in the custody ledger, which is a separate system from the evidence store, so altering one without the other is detectable.
- Store. A dedicated evidence account or vault, administered by the security team and separate from production administrators. Encrypt it, with keys held by a different group than the collectors. Use write-once retention so even an administrator cannot silently delete.
- Control access.
- Access is per case and per named person, approved by the case owner (and counsel for sensitive matters).
- Originals are read-only. Analysts work on copies, and the copy's hash is checked against the original.
- Retrieving an original needs two people (one requests, one approves).
- Every read, copy and export is logged and the logs are themselves protected. Access is reviewed at case close and quarterly.
- Record custody. One ledger row per event, as below.
- Limit privacy exposure (next section).
- Retain, hold and dispose (the section after that).
Custody ledger (illustrative entries, all values are placeholders)
| Item | Event | By | To | When (UTC) | Purpose | Hash check |
|---|---|---|---|---|---|---|
| case-0412 / web01 disk image | Captured from snapshot | collector_a | evidence vault | 2026-03-02T11:40:12Z | Initial preservation | recorded at capture |
| same | Copy made for analysis | analyst_b | working share | 2026-03-02T14:05:30Z | Malware triage | copy hash matches original |
| same | Original retrieved | analyst_b, approved by lead_c | forensic firm | 2026-03-04T09:12:00Z | External examination | matches |
Hashing commands (every flag explained)
# compute the fingerprint and save it next to the file
sha256sum case-0412/web01-disk.img > case-0412/web01-disk.img.sha256
# recompute later and compare against the saved value
sha256sum -c case-0412/web01-disk.img.sha256
# current time in UTC, ISO 8601, for the ledger entry
date -u +%Y-%m-%dT%H:%M:%SZ
sha256sum prints the hash followed by the filename. -c (check) reads a file in that format, recomputes each hash and prints the filename followed by OK or FAILED. date -u asks for UTC and +%Y-%m-%dT%H:%M:%SZ is the output format string. An illustrative excerpt of the check:
case-0412/web01-disk.img: OK
OK in this check is what the "copy hash matches original" cell of the ledger records: the copy's recomputed hash equals the hash stored at capture. If one bit of the file had changed, the output would instead read case-0412/web01-disk.img: FAILED, followed by a warning that 1 computed checksum did NOT match. A FAILED result is written into the ledger as an event, the copy is not used, and the case owner and counsel are told.
Limiting privacy exposure
- Minimise at capture: a time window and a host list, not "everything". For packet captures, capture headers or use a targeted filter unless the content is needed, because full captures hold passwords, messages and personal data.
- Tier the access: most analysts see metadata and indicators; only the named examiner sees content.
- Redact or pseudonymise working copies where the analysis does not need identities.
- Purpose limitation: evidence collected for an incident is not used for unrelated employee performance review.
- Know where it is stored: location rules for personal data can restrict where copies are kept, and employee monitoring is regulated differently by country. Counsel confirms the policy.
Retention against routine deletion and legal holds
Routine deletion (a log source that keeps data for a fixed number of days) is automatic and does not know about incidents. A hold has to stop it deliberately. The mechanism is a tag: the lifecycle rule is written as "delete objects older than 30 days unless the object carries the tag legal_hold". When counsel issues hold H-17, an operator (or an automated job reading the hold register) adds legal_hold=H-17 to every object in scope, the next run of the deletion job skips those objects, and removing the tag is possible only through counsel's written release. The program below shows the effect.
- Hold register: hold ID, the systems, accounts and date range covered, who issued it (counsel), the date, and status. Deletion jobs consult the register before deleting, or the hold applies a tag that the lifecycle rule respects. The hold covers the source systems as well as the evidence vault.
- Release only by counsel, in writing. After release, dispose according to the retention schedule and record the disposal.
- Retention of evidence itself follows a schedule by class and matter type, set with counsel. The numbers are policy decisions, not engineering ones.
Worked example of the timing risk (assumptions). Assume a log source deletes entries after 30 days. The attacker's first action is on day 0 and the incident is detected on day 25. The convention used here is that an entry written on day d is deleted on day d + 30. The earliest entries therefore expire on day 30, so there are 30 minus 25 = 5 days to apply the hold. If detection happens on day 33, every entry with d + 30 <= 33 has already gone, which is days 0, 1, 2 and 3: four days of evidence. The sizing rule is:
retention≥detection delay (a high percentile)+time to place a holdIn words: keep data at least as long as it usually takes to notice a problem, plus the time it takes to freeze the data once you have noticed. Here detection delay is the number of days from the first malicious event to the day it is detected, and time to place a hold is the number of days from detection to the hold being in effect on the source. If the 95th percentile of detection delay were 45 days and a hold takes 2 days to place, retention must be at least 45 + 2 = 47 days; 90 days leaves a margin. Both figures are assumptions for illustration, and a longer window costs storage and increases privacy exposure, so the number is a trade-off decided with the privacy team.
RETENTION_DAYS = 30
def expired_days(today, first_day, last_day):
"""An entry written on day d is deleted by the job on day d + RETENTION_DAYS."""
return [d for d in range(first_day, last_day + 1) if d + RETENTION_DAYS <= today]
def cleanup(today, entries):
"""Return the entry days the deletion job removes: expired and not tagged legal_hold."""
return [day for day, tags in entries if day + RETENTION_DAYS <= today and "legal_hold" not in tags]
gone = expired_days(33, 0, 40)
print("detected on day 33, expired entry days:", gone[0], "to", gone[-1], "count", len(gone))
print("detected on day 25, days left to place a hold:", 0 + RETENTION_DAYS - 25)
no_hold = [(d, set()) for d in range(0, 36)]
with_hold = [(d, {"legal_hold"} if d <= 10 else set()) for d in range(0, 36)]
print("job on day 33, no hold tag, deletes entry days:", cleanup(33, no_hold))
print("job on day 33, days 0 to 10 tagged, deletes entry days:", cleanup(33, with_hold))
delay_p95, hold_time = 45, 2
print("minimum retention in days:", delay_p95 + hold_time)
Output:
detected on day 33, expired entry days: 0 to 3 count 4
detected on day 25, days left to place a hold: 5
job on day 33, no hold tag, deletes entry days: [0, 1, 2, 3]
job on day 33, days 0 to 10 tagged, deletes entry days: []
minimum retention in days: 47
The first two lines reproduce the day 33 and day 25 cases above, the next two show the deletion job with and without the tag, and the last line is the sizing rule.
Testing the process
Each quarter pick a past case and have someone outside the team verify a hash from the ledger, confirm every item has a complete custody trail, and confirm a test hold blocks a deletion in a non-production log store.
Judgment
I would build the ledger and the hold register first, because without them the rest cannot be proven. What would flip it: a very small company can use the same principles with a locked folder, a spreadsheet ledger and counsel on call, provided each step still has a named person and a record.
Common mistakes: holding evidence on the same host or admin group as production, hashing only at close instead of at capture, giving all of security read access to everything, and keeping logs forever "just in case" without a privacy review.
A customer tells you they were breached through a third-party component deep in your supply chain that you also depend on. What do you contain first, how do you establish whether your own systems and customers are affected, who do you notify (customers, partners, regulators) and on what evidence, and what changes to vendor risk management follow once the incident is handled?
Sample Answer
The idea in plain words
A customer's breach notice is a tip, not proof that you are affected. Your job is to answer three questions in order: do we use that component (exposure), did the malicious code or access actually reach our systems (compromise), and did it touch customer data (impact). Each question is answered by evidence, and each unlocks a different duty to notify. Meanwhile you cut the cheapest, most likely path first and keep the evidence, because the proof you need later lives in logs and build artifacts that routine cleanup would erase.
A supply chain compromise means an attacker reached you through something you trust: a software library, a build tool, a vendor's hosted service. "Fourth party" means a supplier of your supplier, someone you never contracted with and may not know you depend on.
The hypothetical used below
All of this is an assumption for illustration, not a real incident. A customer tells you their environment was compromised through a library called logkit, version 4.2.1, which the library's maintainers say was malicious from day 10 until it was withdrawn on day 16. The library reaches your company inside a vendor SDK, so you did not choose it directly.
Step 1: what to contain first, in order
- Pin down the facts you were given. Component name, exact versions, file hashes (a hash is a fixed-length fingerprint of a file; if one byte changes the hash changes, so a published hash identifies the exact malicious file), the attacker's network indicators (domains, IP addresses; these are indicators of compromise, or IOCs), and the compromise window. Reply to the customer promptly, share what you may, and ask for their indicators. Do not claim you are unaffected.
- Preserve before you cut. Copy the exact package files and build artifacts you have, snapshot a representative host, and extend log retention on DNS, proxy, cloud audit and build systems. Keep a log of who handled each item (chain of custody, the record of every hand-off of evidence). Registry or proxy logs are the records kept by the service your builds download packages through (your internal mirror, if you run one) of who fetched which version and when; build logs are the records of each automated build.
- Cut the cheapest likely path. Block the known malicious domains at the egress point (the network edge where outbound traffic leaves), pause automatic dependency updates and deploys, and isolate the affected service where the business can bear it. Removing the component outright comes after you know where it runs.
- Rotate what the component could read. Any secret reachable by the affected code (cloud keys, database passwords, signing keys) is rotated, because rotation is far cheaper than proving the secret was not read. Signing keys (the keys used to sign software releases so others can trust them) are in this group too.
- Do not rush to "update to latest". A fixed version may not exist yet, and a hurried update is a fresh trust decision: you would be running new code from the same supplier chain that was just compromised, before anyone has examined it, and attackers sometimes publish look-alike "fixes" while attention is high. Move to a version verified against a known-good hash, meaning a hash published by a source you trust and compared with the hash of the file you downloaded, or remove the dependency. The check looks like this:
echo "<published sha256> logkit-4.2.2.tgz" | sha256sum -c -printslogkit-4.2.2.tgz: OKwhen the file matches andFAILEDwhen any byte differs.
Step 2: establish whether you and your customers are affected
Work down a funnel. Each stage narrows the set and is checked against a source of truth.
| Stage | Question | Evidence source |
|---|---|---|
| Exposure | Which of our services contain the component? | Software bill of materials (SBOM, a machine-readable list of components in a product), lockfiles (files that record the exact version of every dependency a build uses), container image scans (tools that list the packages inside a packaged application image) |
| Version | Which pulled the affected version in the window? | Build logs and registry or proxy logs for days 10 to 16 |
| Execution | Did that code run in production with network access? | Deployment records, network policy |
| Compromise | Any sign the malicious code acted? | DNS and proxy logs against the IOCs, file hash comparison, endpoint detection records (the alerts and activity logs from security software on servers and laptops) |
| Impact | Whose data could it reach? | The service's data access scope mapped to tenants (the separate customer accounts that share the service) |
Worked funnel, using assumed counts: 14 services in total, 9 contain the component (exposure), 4 of those built during days 10 to 16 and pulled 4.2.1, 2 of those 4 reached production with outbound internet access, and 1 of those 2 shows a DNS lookup of an attacker domain on day 12. The window is 16 minus 10 = 6 days, which sets the log period to search. That one service serves 1,100 of 6,000 customer tenants, which is 1,100 divided by 6,000 = 18.3 percent. The service that never contacted an attacker domain is not cleared by that alone: check whether its logs cover the whole window, because absence of evidence is only meaningful where logging was complete.
Step 3: who you notify, and on what evidence
Tie each audience to the level of evidence you hold. This is a plan, not legal advice; counsel confirms the regimes and contracts that apply.
| Evidence level | Example | Action |
|---|---|---|
| Notice only | A customer says X is compromised | Acknowledge, open an internal incident, no outside notification yet |
| Exposure | We use component X, no sign of misuse | Targeted advisory only to customers who must act (for example keys they gave us), plus contractual notice where a contract demands it |
| Suspected compromise | IOC seen on one of our systems | Prepare notices, brief executives, start the legal assessment; contract clauses on security incidents may already be triggered |
| Confirmed data impact | Personal data was accessible to the attacker, or you hold a reasonable degree of certainty that it was | Regulatory and customer notification clocks apply (under GDPR, from awareness) |
| Impact cannot be excluded | Logs too thin to rule it out, no positive sign of access | Treat as a live investigation with a deadline, record the reasoning, and let counsel decide whether a regime or contract treats this as notifiable; some do, for example the US HIPAA Breach Notification Rule presumes a breach unless a low probability of compromise is shown, while GDPR clocks start at reasonable certainty |
Under EU GDPR, a controller (the organisation deciding why and how personal data is processed) notifies its supervisory authority (the data protection regulator) within 72 hours of becoming aware of a personal data breach, where feasible, unless a risk to individuals is unlikely (Article 33), and tells affected individuals without undue delay when the risk is high (Article 34). A processor (a vendor handling data for a controller) must tell the controller without undue delay. If you are a processor for your customers, your duty to tell them starts when you become aware (Article 33(2)), and the European Data Protection Board's guidelines on breach notification say the controller should in principle be regarded as aware once its processor has informed it. So a customer's own 72 hour regulator clock starts when you tell it, not when you first suspected impact. A small timeline shows what delay costs. Suppose you reach a reasonable degree of certainty at hour 0. If you tell the customer at hour 6, its 72 hours run from hour 6 and end at hour 78. If you tell it at hour 48, its clock ends at hour 120, but a 48 hour wait is hard to defend as telling it without undue delay once you were certain, you may have broken a contract clause that counts from your awareness, and its users stay unprotected for two more days. So send the notice as soon as impact is plausible and refine it later (the assumption here is that the customer is the controller and you are its processor). Your own awareness starts when you have a reasonable degree of certainty about your own systems, which is not the moment a third party reports its own incident; record the time and the reasoning. Sector rules and contracts may set shorter clocks.
Partners get the same facts as customers, delivered directly, and a regulator gets a filing only when a regime requires it. Everyone receives the same fact sheet: what happened, what we know, what we do not yet know, what you should do, when the next update comes.
Step 4: what changes in vendor risk management afterwards
- Tier suppliers by access. A supplier whose code runs inside your environment or that can read production data gets deep review; a supplier of office stationery does not.
- Know your fourth parties. Require SBOMs from critical suppliers and keep your own, so the first question next time is answered in minutes.
- Contract for speed. Security incident notice to you in a stated number of hours, a duty to share indicators, audit rights, a list of subprocessors (the further companies the supplier itself uses to handle your data), and a right to terminate.
- Limit what a trusted component can do. Least-privilege credentials, no broad outbound internet from production services, secrets scoped per service.
- Control updates. Pin versions (name the exact version instead of "latest"), verify hashes, delay automatic updates of critical dependencies by a short soak period (a wait of a few days so that others find a malicious release first), and mirror packages internally (keep your own vetted copy of each package, so a build never fetches straight from the public source).
- Rehearse removal. Practise swapping or disabling a critical vendor within a target time, and measure it.
Each control costs engineering time and slows some changes; apply the heaviest ones to the top tier only. If only two are possible first, take control 3 (contract for speed, because it sets how soon you hear next time) and control 4 (limit what a trusted component can do, because it caps the damage when a supplier fails anyway); an internal mirror and a rehearsed removal are the most expensive and are rarely done outside the top tier.
Common mistakes
- Treating the customer's notice as your own awareness date, or ignoring it because it is not your breach.
- Updating to the newest version without verifying it.
- Declaring "not affected" from the SBOM alone without checking runtime and logs.
- Notifying everyone at once, so customers who must act are lost in noise.
- Stopping at the incident and never changing supplier contracts.
Unlock Full Question Bank
Get access to all 6 Security Incident and Breach Response interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.