YourNextCert™ with Shubham Sharma

Chapter 17

Preventing and Responding to Incidents

The incident management lifecycle, preventive and detective measures from IDS/IPS to sandboxing and honeypots, common attacks, logging and monitoring with SIEM, threat intelligence and SOAR automation.

Status
In progress
Last updated

Video

The video for this chapter is not available yet.

Exam domains and objectives covered

Domain 7: Security Operations

  • 7.2 Conduct logging and monitoring activities
  • 7.6 Conduct incident management
  • 7.7 Operate and maintain detection and preventative measures

Objectives are numbered as in the official ISC2® CISSP exam outline.

Learning objectives

By the end of this chapter you should be able to:

  • Define a computer security incident and walk through the seven incident management steps in order
  • Apply the basic preventive measures that stop most incidents, including against zero-day exploits
  • Recognise botnets, DoS variants, on-path attacks and insider sabotage, and their countermeasures
  • Compare IDS and IPS, host and network sensors, and knowledge-based and behaviour-based detection
  • Use allow lists, block lists, sandboxing, honeypots, firewalls and anti-malware effectively
  • Plan logging, log protection, monitoring, sampling, SIEM and egress monitoring
  • Explain how threat intelligence, kill chains, ATT&CK, threat hunting, SOAR and AI tools support operations

Key topics

  • Incident management steps
  • Containment and evidence
  • Preventive measures
  • Botnets and DoS attacks
  • Zero-day exploits
  • IDS and IPS
  • False positives and negatives
  • Allow lists and block lists
  • Sandboxing
  • Honeypots and enticement
  • Log management and SIEM
  • Clipping levels
  • Egress monitoring and DLP
  • Threat intelligence and hunting
  • Cyber Kill Chain and MITRE ATT&CK
  • SOAR playbooks and runbooks

Chapter notes

Chapter overview

No defence is perfect, so organisations need two things: measures that stop most incidents, and a disciplined process for the ones that get through. This chapter covers the incident management lifecycle, the attacks you’re most likely to meet, the tools that prevent and detect them, and the logging and monitoring that make everything accountable. It finishes with the automation and intelligence that help small teams keep up.

Key concepts

What counts as an incident

In the broad sense, an incident is any event that harms the confidentiality, integrity or availability of assets, including storms and accidents. In incident management, the term means a computer security incident: an actual or imminent violation of security policy, acceptable use policy or standard security practice. Organisations define it in policy with examples, such as attempted intrusions, DoS attempts, malware detections, unauthorised data access and policy violations. Natural disasters are handled through business continuity and disaster recovery instead.

Incident management steps

The exam uses seven steps, in this order:

  1. Detection: alerts from IDS, anti-malware or log tools, or reports from users. Not every alert is an incident, so first responders must tell routine faults from genuine incidents and escalate the real ones.
  2. Response: activate the computer security incident response team (CSIRT) according to the incident response plan. Speed limits damage. Treat everything as potential evidence, and don’t switch affected machines off, because volatile memory would be lost.
  3. Mitigation: contain the incident, for example by disconnecting a host or isolating a segment. Sometimes responders contain it quietly so they can watch the attacker and learn the full scope.
  4. Reporting: tell management in proportion to severity, and notify regulators, law enforcement and affected individuals where law, contracts or standards require. Breaches of personal data usually trigger notification duties, and some standards (such as PCI DSS™) require reports to authorities.
  5. Recovery: return systems to service, from a simple restart to a full rebuild and restore. A rebuilt system must be at least as secure as before: check ACLs, unneeded services, patches, default accounts and any changes the attacker made. Rebuilding from scratch is safest when code may have been altered.
  6. Remediation: root cause analysis finds what allowed the incident (a missing patch, poor input validation, a database in the wrong zone) and recommends fixes.
  7. Lessons learned: review the incident and the response. Findings go to management in a report and feed back into detection. Management decides which recommendations to adopt and owns the risk of any it rejects.

Incident response never includes counterattacking. It’s often illegal, may hit an innocent intermediary whose address was spoofed or hijacked, and invites escalation.

NIST’s incident handling guidance describes the same work differently. Its earlier lifecycle used four phases: preparation; detection and analysis; containment, eradication and recovery; and post-incident activity. Expect the seven-step list on the exam.

Preventive and detective controls

Preventive controls try to stop unwanted activity (firewalls, IPS, encryption, least privilege, training). Detective controls find it during or after the event (IDS, audit trails, CCTV, honeypots, reviews). The basics stop most attacks:

  • patch systems and applications promptly;
  • remove or disable services and protocols you don’t need;
  • run network and host-based firewalls;
  • use IDS/IPS and keep anti-malware up to date;
  • apply configuration and change management.

Common attacks

  • Botnets: compromised machines (bots or zombies) take orders from a bot herder through command-and-control (C2) servers. They send spam, steal credentials and launch DDoS attacks. IoT devices with weak or unpatchable firmware are favourite recruits. Defend with anti-malware, patching, browser hardening and user awareness.
  • DoS comes from one source and DDoS from many. A distributed reflective DoS (DRDoS) bounces traffic off third parties so it converges on the victim. Internet-facing systems are the usual targets, and commercial DDoS mitigation services can absorb much of the traffic.
  • SYN flood: many SYNs, no final ACKs, so half-open connections exhaust the server. Counter with SYN cookies or a shorter wait for the ACK; capping sessions just locks out legitimate users. A TCP reset attack spoofs RST packets to tear down sessions.
  • Smurf (ICMP) and Fraggle (UDP echo/chargen) attacks send broadcasts with the victim’s address as the source, so every host replies to the victim. Blocking directed broadcasts at routers removes the amplification. A ping flood simply overwhelms the target with echo requests.
  • Legacy attacks worth recognising: ping of death (an oversized ping packet), teardrop (overlapping fragments that can’t be reassembled) and LAND (a SYN with the victim’s address as both source and destination). New attacks are often variations on old ones.
  • Zero-day exploit: attacks a flaw the vendor doesn’t know about or hasn’t patched yet. Some people stretch the term to attacks immediately after a patch release; an attack months after a patch is simply an attack on an unpatched system. Basic hygiene, firewalls, IDS/IPS and honeypots all help.
  • On-path (man-in-the-middle): the attacker relays or sniffs traffic between two parties, often by combining ARP or DNS manipulation with fake certificates. Patching, strong encryption and VPNs help.
  • Sabotage: a disgruntled insider damaging systems. Remove access promptly at termination, audit and monitor, and keep communication open with staff.

IDS and IPS

An intrusion detection system (IDS) monitors events, often in real time, and raises alerts. An intrusion prevention system (IPS) sits in line so it can drop malicious traffic before it arrives. Collectively they’re called IDPS, and they complement firewalls rather than replace them.

Knowledge-based (signature) Behaviour-based (anomaly, heuristic, statistical)
Works by Matching traffic to known attack patterns Comparing activity with a learned baseline of normal
Strength Few false positives Can catch new and unknown attacks
Weakness Misses new or modified attacks (false negatives); needs constant updates Many false positives; baseline must be rebuilt when the network changes

The four detection outcomes: true positive (attack, alert), false positive (no attack, alert), false negative (attack, no alert) and true negative (no attack, no alert). Too many false positives cause alert fatigue, and staff then ignore the real one.

  • Passive response logs and notifies; active response also changes the environment, such as rewriting firewall rules. An active IDS that isn’t in line can only react after traffic arrives.
  • Host-based IDS (HIDS) sees detail on one host (processes, files, local logs) but costs more to manage, uses host resources, and can be disabled by an intruder who controls the host.
  • Network-based IDS (NIDS) watches traffic through sensors, port mirroring (SPAN) or taps, reports to a central console, and is nearly invisible. It can see that an attack was sent but not always whether it succeeded.
  • Encrypted traffic hides attacks, so organisations use in-line TLS inspection (decryption) appliances. Data encrypted on the host before it leaves still can’t be read.

Other preventive and detective measures

  • Honeypots are decoy systems; honeynets are networks of them. Nobody legitimate uses them, so any activity is suspicious. They divert attackers, buy time and reveal techniques, sometimes including zero-days. Pseudo-flaws are fake vulnerabilities planted as bait. Enticement (leaving the system for attackers to find) is acceptable; entrapment (actively inducing someone to offend) is not. Virtual honeypots are easy to reset but need watching for VM escape attempts.
  • Warning banners state that use is monitored and unauthorised access is prohibited. They support prosecution and remind authorised users of acceptable use.
  • Anti-malware: deploy in layers (boundary content filtering, email gateways and every endpoint), manage centrally, update definitions automatically, and run only one engine per host. Least privilege limits what malware can do, and user education stops much of it arriving.
  • Allow lists permit only approved applications and block everything else; deny (block) lists stop named applications. A system uses one approach. Hash-based allow lists also stop infected copies of approved programs. Curated app stores are an extreme form of allow listing.
  • Firewalls: block directed broadcasts, drop inbound packets with private source addresses (they must be spoofed), and end every rule set with an implicit deny. WAFs protect web applications against attacks such as SQL injection and XSS; next-generation firewalls combine stateful filtering, deep inspection and IPS.
  • Sandboxing runs untrusted code in an isolated environment so it can’t affect anything else.
  • Third-party security services (managed detection, cloud email filtering, penetration testing) extend in-house capability. You can outsource the work but not the accountability: PCI DSS, for example, still holds you responsible for your providers’ compliance.

Logging

Logs record what happened, when, where, who did it and sometimes how. Typical sources:

Log Records
Security Access to files, folders and other resources (often must be enabled per resource)
System Start-ups, shutdowns, service starts, stops and setting changes
Application Whatever the developers chose to record
Firewall Allowed and blocked traffic: addresses and ports, not content
Proxy Sites visited and attempts to reach blocked sites
Change Requests, approvals and implemented changes

Logs prove accountability only if identification and authentication are sound; otherwise someone could be blamed for an impersonator’s actions. Include privileged accounts in every logging plan.

Protect logs: forward copies to a central server or SIEM, restrict permissions, make archives read-only, back them up and protect them physically. Altered logs lose their value as evidence. Keep them as long as policy and regulation require, then destroy them; retaining far more than required makes legal discovery slower and costlier. Log management also covers rollover (circular) logging, archiving, and making sure logs don’t fill the disk.

Monitoring

Audit trails let investigators reconstruct events forwards or backwards, support prosecution, deter misuse and help diagnose ordinary faults. Synchronise every clock to a trusted NTP source so events line up. Monitoring and tuning are continuous: tune detection to cut false positives without missing real attacks.

  • SIEM collects logs through agents and syslog, then aggregates and correlates events from different sources, alerts in near real time and retains data for later analysis. Syslog (RFC 5424) defines the message format and transport to a central collector.
  • Sampling reduces audit data to something reviewable. Statistical sampling is mathematically defensible and gives a margin of error; non-statistical sampling is at the reviewer’s discretion. Clipping levels are a non-statistical threshold: ignore routine events (one mistyped password) and alert only when a threshold is crossed (several failures within a set time).
  • Keystroke monitoring is legally sensitive. Tell users through policy, agreements or banners.
  • Traffic and trend analysis looks at flow data rather than content, revealing patterns such as a workstation suddenly sending huge volumes of email.
  • Egress monitoring watches data leaving the network: DLP (which can also spot watermarks in unencrypted files), checks for steganography (comparing hashes of files that shouldn’t change) and alerts on unusual volumes of encrypted outbound traffic.

Automation and intelligence

  • SOAR (security orchestration, automation and response) automates routine responses. A playbook documents how to verify and respond to a type of incident; a runbook implements those steps in a tool. The playbook doubles as the manual fallback. Benefits: less workload and fewer human errors.
  • Machine learning is a subset of artificial intelligence: systems that improve from data and feedback. In security they refine behavioural baselines and learn from analysts marking alerts as false positives. Vendors’ claims are often hard to verify.
  • Threat intelligence gathers timely information on current threats. Threat feeds supply indicators (malicious domains and IP addresses, malware hashes) that tools can match automatically and firewalls or IPS can block.
  • Threat hunting assumes attackers are already inside and actively searches for their traces, often stage by stage through a kill chain.
  • The Cyber Kill Chain (Lockheed Martin) orders an attack into seven stages: reconnaissance, weaponisation, delivery, exploitation, installation, command and control, and actions on objectives. Breaking any link stops the attack. MITRE ATT&CK is a regularly updated knowledge base of adversary tactics, techniques and procedures (TTPs), arranged as a matrix rather than a sequence.

Exam tips

  • After confirming an incident, the first priority is containment, while protecting evidence.
  • The seven steps run in a fixed order. Lessons learned always comes last.
  • An IPS must be in line to block; an IDS can sit out of band.
  • Allow lists beat block lists for preventing unknown malicious software.
  • Logs are only useful as evidence if they’re protected from tampering.
  • Never power off a compromised system before volatile evidence is captured, and never hack back.
  • If a question asks how to reduce false alarms from an anomaly-based IDS, think tuning and updating the baseline.

Common traps

  • Mitigation vs remediation: mitigation contains the current incident; remediation fixes the root cause so it can’t recur.
  • Recovery vs remediation: recovery restores service; remediation prevents a repeat.
  • False positive vs false negative: signature systems produce more false negatives, anomaly systems more false positives.
  • Active IDS vs IPS: an active IDS reacts after detection; only an in-line IPS stops traffic before it arrives.
  • Enticement vs entrapment: letting attackers find a honeypot is legal; luring them into a crime isn’t.
  • Smurf vs Fraggle: Smurf uses ICMP, Fraggle uses UDP.
  • Zero-day vs unpatched: once a patch has been available for weeks, the attack is on an unpatched system, not a zero-day.
  • Playbook vs runbook: the playbook says what to do; the runbook automates it.
  • Kill chain vs ATT&CK: the kill chain is an ordered sequence; ATT&CK is an unordered matrix of TTPs.
  • Statistical vs clipping: clipping levels ignore everything below the threshold, so they’re cheap but not representative.

Quick revision

  • Seven steps: detection, response, mitigation, reporting, recovery, remediation, lessons learned.
  • Contain first, preserve evidence, keep machines powered on, report as law requires, never counterattack.
  • Basics: patch, disable unneeded services, firewalls, IDS/IPS, anti-malware, configuration management.
  • SYN cookies against SYN floods; block directed broadcasts against Smurf and Fraggle.
  • Signature = known attacks, few false positives; anomaly = new attacks, more false positives.
  • HIDS sees host detail; NIDS sees the network; IPS must be in line.
  • Honeypots divert and reveal attackers; enticement yes, entrapment no.
  • Allow lists over block lists; one anti-malware engine per host, layered across boundary, email and endpoints.
  • Protect logs centrally and read-only, sync time with NTP, retain only as long as required.
  • SIEM aggregates and correlates; clipping levels set alert thresholds; egress monitoring stops exfiltration.
  • SOAR: playbooks define, runbooks automate. Threat feeds inform hunting; kill chain and ATT&CK structure it.

Key terms

Term Meaning
Computer security incident An actual or imminent violation of security policy, acceptable use or standard practice
CSIRT The team that investigates, contains and recovers from security incidents
Containment Limiting an incident’s spread and effect while it is handled
Root cause analysis Working out what allowed an incident to happen so it can be prevented
Botnet A network of compromised devices controlled remotely through command-and-control servers
SYN cookie A technique that lets a server avoid reserving resources for half-open connections
Zero-day exploit An attack on a vulnerability that has no available fix
Baseline A profile of normal activity against which anomalies are measured
False negative A real attack that the detection system fails to report
Honeypot / honeynet A decoy system / network used to attract, divert and study attackers
Pseudo-flaw A deliberately planted fake vulnerability used to lure attackers
Sandbox An isolated environment in which untrusted code can run without affecting other resources
Audit trail The recorded sequence of events used to reconstruct activity and establish accountability
SIEM A platform that centralises, correlates and alerts on log and event data
Clipping level A threshold below which routine events are ignored for alerting
Egress monitoring Watching outbound traffic for unauthorised data transfer
SOAR Technology that orchestrates and automates incident response using playbooks and runbooks
Threat hunting Proactively searching for attackers who have evaded existing controls
TTPs The tactics, techniques and procedures that characterise an adversary

Sources