IDS, IPS and Network Monitoring
Chapters and transcript
IDS, IPS and Monitoring Firewalls and good settings prevent many attacks, but no defence is perfect. Without monitoring, an attacker can stay inside a network for weeks or months before anyone notices. Often the first sign is a ransomware message. In this lesson you will learn how intrusion detection and prevention systems work, which logs a network produces, and the warning signs analysts search for.
Why monitoring matters Prevention reduces risk. Detection tells you when prevention has failed. Good monitoring helps you spot attacks early, while they are still small. It helps you understand what happened during an incident, using evidence. And it helps you prove that controls are working, for audits and managers. Monitoring is a core job of the SOC, the security operations centre.
IDS and IPS An intrusion detection system, or IDS, watches network traffic. Here, an attack arrives for the server. The switch copies the traffic to the IDS through a mirror port, also called a SPAN port. A network tap can do the same. The IDS raises an alert. But it does not block anything. The attack still reaches the server, and a human decides what to do.
IDS and IPS An intrusion prevention system, or IPS, does the same checks, but it sits inline, directly in the path of the traffic. Normal requests pass through. When an attack arrives, the IPS drops the packets at once. It never reaches the server. Many next-generation firewalls include IPS features.
IDS and IPS Side by side. Position: the IDS watches a copy, the IPS is inline. Action: the IDS only alerts, the IPS can also block. If a rule is wrong, the IDS gives extra alerts, but the IPS may block real business traffic. That is why many teams start new rules in alert-only mode. If the device fails, traffic keeps flowing past an IDS, but may stop at an IPS.
IDS and IPS Some well-known open-source tools. Snort and Suricata detect attacks and can block them. Zeek records detailed logs of network activity. There is also host-based detection, which runs on each computer instead of watching the network. You will meet it as antivirus and EDR, endpoint detection and response.
Signatures and anomalies Detection systems use two main methods. The first is signature-based detection. It looks for known patterns, like antivirus looks for known malware. Here is a simple rule in the format used by Snort and Suricata. In plain words: alert on any TCP traffic from anywhere to port 23, Telnet, on our network. Signatures are accurate for known attacks, with few false alarms, but they miss new or changed attacks.
Signatures and anomalies The second method is anomaly-based detection. It first learns what is normal for the network, called the baseline. Then it alerts on unusual activity. For example, a PC that suddenly sends ten times more data than usual. Or a server that starts talking to a country it has never contacted. It can catch new attacks, but gives more false alarms and needs time to learn. Most real systems combine both methods.
Signatures and anomalies Two words you must know. A false positive is an alert for something harmless. Too many of them cause alert fatigue, and analysts start ignoring alerts. A false negative is a real attack that produces no alert. That is the more dangerous failure.
Network logs An IDS is only one source of evidence. The firewall logs allowed and blocked connections. Flow records summarise who talked to whom and how much. DNS logs show which names each device looked up. DHCP logs show which device had which IP, and when. All of them go to a SIEM, in one place. And every device must use the correct time, or following an attack becomes very hard.
Network logs Here is a firewall log line. Read it from left to right. The date and time: 2:13 in the morning. The action: deny. The protocol: TCP. Then the source, an outside address, and the destination, an internal server on port 3389, which is RDP. So a connection from outside to RDP was blocked in the middle of the night.
What defenders look for With logs and alerts in hand, analysts look for patterns. Port scans: one address trying many ports. From an internal PC, that is far more worrying. Brute force: many failed logins to VPN, RDP or SSH. Large outbound transfers, especially at night, may be data theft. And new or unknown devices, which may be rogue. Strange DNS lookups and traffic between zones that should not talk matter too.
What defenders look for Another pattern is beaconing. An office PC connects to the same unknown server. Sixty seconds later, it connects again. And again, all night. Regular check-ins like this may be malware talking to its command and control server, or C2. One alert alone rarely proves an attack. Analysts correlate events: a phishing email, a login from a new country, then a large upload tells a stronger story.
Try it yourself Look at the connections your own computer has open. On Windows, run netstat dash a n o, and filter for established. On Linux, use ss. Each line shows a local and a remote address. Most will be apps on port 443. Ask: do I know which program made this? The last number is the process ID, which you can find in Task Manager. Only monitor devices you own or may monitor.
Quick check Quick check. The firewall logs show an office PC trying hundreds of ports on every internal server within two minutes. How should a defender see this? Choose an answer.
Key takeaways Let us put it together. Detection tells you when prevention has failed. An IDS alerts, and an IPS sits inline and can block. Signatures catch known attacks, and anomalies can catch new ones. False negatives are the more dangerous failure. Collect logs in a SIEM, with the correct time. And look for scans, brute force, beaconing and large uploads, and correlate events.
Firewalls and good settings prevent many attacks, but no defence is perfect. Defenders also need to detect attacks that get through. This lesson covers intrusion detection and prevention systems, the logs a network produces, and the warning signs that analysts search for.
Why monitoring matters
Prevention reduces risk. Detection tells you when prevention has failed. Without monitoring, an attacker can stay inside a network for weeks or months, quietly stealing data, before anyone notices. Often the first sign is a ransomware message or a customer complaint.
Good monitoring helps you to:
- Spot attacks early, while they are still small
- Understand what happened during an incident, using evidence
- Prove that controls are working, for audits and for managers
Monitoring is a core job of a SOC (security operations centre), the team that watches for and responds to attacks.
IDS and IPS
An intrusion detection system (IDS) watches network traffic and raises an alert when it sees something suspicious. It does not block anything itself. A human analyst, or another system, decides what to do.
An intrusion prevention system (IPS) does the same checks, but it sits inline, directly in the path of the traffic. When it sees an attack, it can drop the packets or block the connection at once.
| IDS | IPS | |
|---|---|---|
| Position | Watches a copy of the traffic | Inline, traffic passes through it |
| Action | Alerts only | Alerts and can block |
| Risk if a rule is wrong | Extra alerts | May block real business traffic |
| If the device fails | Traffic keeps flowing | Traffic may stop, unless designed to fail open |
An IDS usually receives a copy of traffic from a mirror port (also called a SPAN port) on a switch, or from a network tap, a small device that copies traffic from a cable.
Many companies start new rules in alert-only mode, check them for a while, then switch them to block once they are sure they will not stop legitimate work. Many next-generation firewalls include IPS features. Well-known open-source tools include Snort and Suricata, which detect and can block attacks, and Zeek, which records detailed logs of network activity.
There is also host-based detection, which runs on individual computers rather than watching the network. You will meet it as antivirus and EDR (endpoint detection and response) tools.
Signatures and anomalies
Detection systems use two main methods.
Signature-based detection looks for known patterns, like an antivirus looks for known malware. A signature (or rule) describes something specific, such as a known exploit string in a web request or a connection to a known bad address. Here is a simple rule in the format used by Snort and Suricata:
alert tcp any any -> $HOME_NET 23 (msg:"Inbound Telnet connection attempt"; sid:1000001; rev:1;)
In plain words: alert on any TCP traffic from anywhere to port 23 (Telnet) on our network, and label it with this message.
Anomaly-based detection first learns what is normal for a network, called the baseline. It then alerts when activity is unusual: a PC that suddenly sends ten times more data than usual, or a server that starts talking to a country it has never contacted.
| Method | Strength | Weakness |
|---|---|---|
| Signature | Accurate for known attacks, few false alarms | Misses new or changed attacks |
| Anomaly | Can catch new attacks | More false alarms, needs time to learn normal |
Two words you must know:
- A false positive is an alert for something harmless. Too many of them cause alert fatigue, and analysts start ignoring alerts.
- A false negative is a real attack that produces no alert. This is the more dangerous failure.
Most real systems combine both methods, and analysts tune the rules over time.
Network logs and where they come from
An IDS is only one source of evidence. Many network devices produce useful logs:
- Firewall logs: which connections were allowed or blocked, with source, destination and port
- Flow records (such as NetFlow): summaries of who talked to whom, when, for how long and how much data, without the content
- DNS logs: which domain names each device looked up
- Proxy logs: which websites users visited
- DHCP logs: which device had which IP address at what time
- VPN and Wi-Fi logs: who connected, from where and when
A firewall log line might look like this:
2026-03-14 02:13:45 DENY TCP 203.0.113.50:51544 -> 192.0.2.10:3389
This says a connection from an outside address to RDP on an internal server was blocked at 2:13 in the morning.
Logs are most useful when they are collected in one place, usually a SIEM (security information and event management system), and when every device uses the correct time. If clocks differ, it becomes very hard to follow an attack from one log to the next.
What a defender looks for
With logs and alerts in hand, analysts look for patterns like these:
- Port scans: one address trying many ports or many hosts in a short time. From outside, this is common background noise. From an internal PC, it is far more worrying.
- Brute force: many failed logins to VPN, RDP or SSH from one address, or from many addresses against one account.
- Beaconing: a device connecting to the same unknown server at regular intervals, such as every 60 seconds, which may be malware checking in with its command and control (C2) server.
- Large outbound transfers: unusual amounts of data leaving the network, especially at night. This may be data exfiltration (theft).
- Strange DNS activity: lookups of random-looking domain names, or a very high number of DNS requests from one device.
- New or unknown devices appearing on the network, which may be rogue devices.
- Traffic between zones that should not talk, such as a guest Wi-Fi device reaching the finance network.
One alert alone rarely proves an attack. Analysts correlate events: a phishing email, then a login from a new country, then a large upload is a much stronger story than any one of them.
Try it yourself
You can look at the connections your own computer has open right now. On Windows, open Command Prompt:
netstat -ano | findstr ESTABLISHED
On Linux:
ss -tnp state established
Each line shows a local address and a remote address. Most will be your browser and apps talking to their services on port 443. Pick a few remote addresses and ask: do I know what program made this? On Windows, the last number is the process ID, which you can find in Task Manager on the Details tab. On Linux, ss -p shows the program name, though you may need sudo to see all of them.
This is exactly the question an analyst asks on a larger scale: what is normal here, and what is not? Only monitor networks and devices that you own or are authorised to monitor.
Check your understanding
Answer every question correctly to complete this lesson. If you miss one, try the quiz again.
1. What is the main difference between an IDS and an IPS?
2. A new attack appears that nobody has written a rule for yet. Which detection method has the best chance of noticing it?
3. An office PC connects to the same unknown internet address every 60 seconds, all night, with small amounts of data. What might a defender suspect?
Locked: answer every quiz question above correctly to complete this lesson.
Spotted a mistake or something unclear? Report a mistake