Kahibaro
Discord Login Register

16.5 IDS / IPS

Understanding IDS and IPS

Intrusion Detection Systems and Intrusion Prevention Systems belong to the broader topic of network security, but they have a very specific role. They watch traffic that crosses a network or host, compare it to known patterns and behaviors, and raise alarms or take action when something looks malicious or suspicious.

At a high level, an IDS focuses on observing and alerting, while an IPS focuses on actively blocking or modifying traffic in real time. Both are used together with firewalls and other security tools, not as a replacement for them.

Detection vs Prevention

To understand IDS and IPS, it helps to separate the ideas of detection and prevention.

Detection means recognizing that something bad might be happening. An IDS inspects packets or logs, tries to determine if they match known attacks or unusual patterns, and then records an event or sends an alert to an administrator or monitoring system.

Prevention means taking immediate steps to stop or reduce the impact of a detected threat. An IPS generally sits inline with traffic, so it can drop packets, reset connections, or change how traffic is handled the moment it detects a problem.

An IDS primarily monitors and alerts.
An IPS primarily monitors and blocks.

In practice, many modern products combine both roles in one platform. They may offer a pure detection mode (similar to IDS) and an active blocking mode (similar to IPS). The configuration decides whether they only log and alert or also interfere with the traffic.

Where IDS and IPS Are Placed

The position of an IDS or IPS in a network affects what it can see and how it behaves. An IDS is usually deployed out of band. It receives a copy of traffic, for example from a span or mirror port on a switch, or from a network tap. Since it sees a copy, it cannot directly block packets, but it also cannot break production traffic if it fails.

An IPS is typically inline. It is inserted directly into the path packets take between networks or segments. Because of this, it can drop or modify packets before they reach their destination, but if the IPS fails or misbehaves, it can interrupt traffic.

This difference is central to how organizations use them. IDS focuses on visibility and investigation, IPS focuses on automatic response.

Types of IDS and IPS

There are several ways to classify IDS and IPS. One common approach is based on what they monitor.

A network based IDS or IPS monitors network traffic between devices. It looks at packets and flows that cross a certain point in the network. A host based IDS or IPS runs directly on an endpoint, such as a server or workstation. It watches local events like system calls, files, processes, and sometimes local network connections.

Table: Network based vs host based

TypeWhat it watchesTypical use case
NIDS / NIPSPackets and flows on a network segmentProtecting subnets or entire networks
HIDS / HIPSActivity on a single host or endpointProtecting critical servers or clients

Another distinction is based on how detection is performed. This is not about location but about logic.

A signature based system compares traffic or events to a database of known patterns. For example, it might look for a specific byte sequence that matches a known exploit. Anomaly based systems learn normal behavior over time, then flag activity that deviates from that baseline. Policy based systems check if activity violates defined rules or policies.

Signature based detection is very effective at spotting known attacks. Anomaly based detection has the chance to discover new or unusual threats, but it can also generate more false positives.

How IDS and IPS Detect Problems

The detection process occurs in several steps. First, traffic or events are collected. For a network based system, this means capturing packets at one or more points in the network. For a host based system, this means reading logs, monitoring processes, and observing system calls or file changes.

Next, the data is examined using rules, signatures, or models. A signature might specify that if a packet contains a particular pattern in a certain protocol field, and it comes from or goes to a specific port, it should be marked as malicious. An anomaly based engine might calculate statistics about normal traffic volume, connection patterns, or user behavior, then detect when current observations fall outside expected ranges.

Finally, the system decides what to do with the detection. In an IDS, this typically results in logging an event, sending alerts to a monitoring console, or generating notifications. In an IPS, the same detection can trigger the dropping of packets, blocking of IP addresses for a period, or resetting of TCP connections.

The goal is to balance sensitivity and noise. If the system is too sensitive, it raises many false positives, where normal behavior is reported as an attack. If it is too relaxed, it may miss real threats.

IDS: Focus on Visibility and Alerts

An IDS is centered on visibility. It gives security teams a detailed view of what is happening on the network or on critical hosts.

Network based IDS typically show connections between internal and external networks, unusual protocols, attempts to scan ports, or signs that someone is trying to exploit known vulnerabilities. They can highlight suspicious patterns like repeated failed login attempts or connections to known malicious domains, if those are visible in the monitored traffic.

Host based IDS typically monitor file integrity, privileged operations, or changes in system configuration. They can detect behavior like an unexpected modification of system binaries or new services starting without authorization.

With an IDS, response is usually a human or an external system decision. The alerts feed into a centralized monitoring platform, such as a Security Information and Event Management system, where analysts review context and decide if an incident needs containment.

Because IDS is out of band, it is safer to deploy in environments where any interruption to traffic is unacceptable. It cannot block by itself, but it creates the awareness needed for manual or automated responses elsewhere.

IPS: Focus on Active Defense

An IPS takes detection one step further by reacting automatically to suspected attacks. It sits directly in the path of traffic, like a firewall, which lets it intervene.

When an IPS identifies malicious traffic, it can drop the packets before they reach the target, send a TCP reset to tear down a connection, or temporarily block an address or session. Some IPS implementations can also modify packets or strip harmful content, though this is more complex and less common.

Because the IPS is inline, it adds latency and becomes a point of failure. If it breaks or is overloaded, traffic can be slowed or blocked entirely. This makes performance and reliability important design considerations. Many IPS devices support high availability pairs and bypass modes to reduce risk.

Another concern is accuracy. An overly aggressive IPS rule can break legitimate applications. For this reason, organizations often start with IPS in a monitor only mode, similar to an IDS, then gradually enable active blocking for rules that prove reliable.

IDS/IPS Rules and Signatures

The effectiveness of IDS and IPS depends heavily on the quality of their rules or signatures. These rules define what patterns count as suspicious or malicious.

A simple signature might say: if traffic is destined to TCP port 23 and contains the string "root" followed by a known exploit pattern, alert or block. More advanced signatures can decode application protocols, check fields inside HTTP requests, DNS queries, or SSL handshakes, and consider multiple packets or flows together.

Vendors and open source communities regularly update these signatures as new vulnerabilities and exploits appear. Administrators must keep them current, but also tune them. Not every rule is relevant for every environment. For instance, a rule that detects attacks against a database type that is not used in a given network might be disabled to reduce noise.

Some systems also allow custom rules, so organizations can detect behaviors that are specific to their environment. These might include internal policy violations or access to sensitive internal applications.

False Positives and False Negatives

Two important concepts in IDS and IPS operation are false positives and false negatives.

A false positive occurs when the system flags something as an attack that is actually harmless. Too many false positives can cause alert fatigue. Administrators might start ignoring alerts because so many are not real incidents.

A false negative occurs when the system fails to detect a real attack. This means the network or host is exposed without warning. Eliminating all false negatives is very difficult, especially with new or unknown threats.

There is always a trade off. Tuning involves adjusting rules, thresholds, and detection methods to minimize both types of error as much as possible for the specific environment.

Tuning IDS/IPS is essential to reduce false positives and false negatives.
Untuned systems either miss attacks or overwhelm staff with noise.

Integration with Other Security Tools

IDS and IPS do not operate alone. They often integrate with other parts of the security architecture.

With firewalls, an IPS can provide deeper inspection than basic access control lists. The firewall might block traffic based on addresses and ports, while the IPS inspects the allowed traffic for malicious content.

With centralized logging and monitoring, IDS and IPS feed alerts into a single view. This allows correlation with other events, such as user logins, system logs, and application records. Patterns that are invisible in one place can become clear when multiple sources are combined.

Some implementations support automatic reactions beyond simple packet blocking. For example, an IPS could signal a firewall or router to update an access list and temporarily block a source network, or it could signal an endpoint security agent to isolate a host.

Practical Use in Networks

In real networks, IDS and IPS are deployed in strategic places. A network based IPS might sit at the perimeter between the internal network and the internet, inspecting inbound and outbound traffic. Another IPS might be placed between different internal segments to protect sensitive areas like server farms or databases.

An IDS might receive mirrored traffic from core switches, so it can observe traffic within the network without affecting the flow. Host based IDS agents might be installed on critical servers, such as those that store customer data, so any unusual changes trigger an alert.

Organizations often combine layers. For example, a host based IDS might report that a file changed on a server. At the same time, the network based IDS might show a suspicious connection to that server from an external address. Together, these signals give a clearer picture of an active attack.

The main benefit of IDS and IPS is improved visibility and faster reaction. While they do not guarantee that every attack is stopped, they significantly increase the chance that malicious activity is noticed and limited before it does serious damage.

Views: 48

Comments

Please login to add a comment.

Don't have an account? Register now!