What is IDS/IPS?
IDS/IPS is shorthand for two related controls that inspect activity for signs of attack. An intrusion detection system (IDS) watches network traffic or a host, compares what it sees with its detection logic and raises an alert. An intrusion prevention system (IPS) applies comparable detection from a position directly in the traffic path, which lets it act as well: drop the packet, reset the connection or block the source for a time. An IDS is a detective control; an IPS is detective and preventive.
The engine is often the same software in both roles. Snort and Suricata are popular open-source engines, and many UTM appliances and next-generation firewalls ship with an IPS feature.
Network-based, host-based and wireless
- NIDS and NIPS watch traffic for a whole segment from a sensor or appliance. They see scans, exploits and command-and-control traffic across many hosts, but not activity inside a host or encrypted sessions they cannot decrypt.
- HIDS and HIPS are agents on one system that watch its logs, processes, system calls and critical files, often with file integrity monitoring. They see local activity and traffic after decryption, but only for their own host.
- WIPS sensors listen to the radio spectrum for rogue access points, evil twins and deauthentication floods that wired sensors cannot hear.
Detection methods: signature, anomaly and behavior
Signature-based detection matches traffic against rules that describe known attacks, such as a byte pattern, a URI or a malicious domain. It is precise and quiet, and shows exactly what matched, but misses anything new or slightly changed and needs frequent rule updates.
Anomaly-based detection starts by profiling normal activity, such as which hosts talk, over what protocols and in what volumes, then flags departures. It can catch attacks nobody has written a rule for, but legitimate change also looks abnormal, so it is noisier.
Behavior-based or heuristic detection looks for actions typical of attacks regardless of the exact code, such as one host probing hundreds of ports. Many sources treat it and anomaly-based detection as one category, and most products combine all three.
An abbreviated one-line alert from a locally written Suricata rule looks like this: [1:1000105:1] LOCAL Possible Log4j JNDI lookup in HTTP header [Priority: 1] {TCP} 198.51.100.23:51544 -> 10.0.5.20:8080. That is the rule ID, message, priority, protocol, then source and target with ports. It records an attempt, not proof of success.
Inline vs. passive placement
An IDS usually works out of band from a copy of the traffic. A SPAN session, also called port mirroring, makes a switch copy chosen ports or VLANs to the sensor, and a network tap copies every frame on a link in hardware. Because the sensor gets only a copy, it adds no delay and its failure does not interrupt traffic, but the packets have already been delivered when it alerts.
An IPS must be inline, commonly just behind the perimeter firewall so it inspects only traffic the firewall already allowed. Inline placement adds a little latency and forces a failure decision. Fail-open, often through a hardware bypass, keeps traffic flowing uninspected when the IPS dies and favors availability. Fail-closed stops traffic until the IPS recovers and favors confidentiality and integrity. An IPS cabled to a mirror port can only alert, so it is effectively an IDS.
False positives and false negatives
A false positive is an alert on harmless activity, such as the approved vulnerability scanner tripping exploit rules. On an IDS it costs analyst time and breeds alert fatigue. On an IPS it drops real business traffic, so new prevention rules are usually run in detect-only mode first. A false negative is an attack that slipped through without an alert, whether from a missing signature, encryption, evasion such as fragmentation, or a sensor in the wrong place. It is the worse error, since no one responds to what no one sees. Tuning cuts false positives, yet each exception is somewhere an attacker could hide.
IDS/IPS on the CompTIA Security+ exam
Network and host-based intrusion detection and prevention are mitigating controls in SY0-801 objective 4.1, and where sensors sit and how inline devices fail are architecture decisions in objective 3.2. Read for the verb: alert, notify or monitor without affecting production traffic points to an IDS on a SPAN port or tap; block, stop or automatically prevent points to an inline IPS. If the attack has never been seen before, choose anomaly-based detection; if it is well known and low noise matters, choose signature-based. Watching files and processes on one server points to HIDS or HIPS, and an unapproved access point to a WIPS. Distractors include a traditional firewall, which permits or denies by address, port and protocol without inspecting for attack patterns, and a SIEM, which correlates alerts from many sources but does not sit in the traffic path.