# Intrusion Detection and Prevention

> Understand how network IDS/IPS tools such as Suricata and Zeek inspect traffic, raise alerts and where they fit in a defense. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/cybersecurity/ids-ips
Last updated: 2026-11-28

Understand how network IDS/IPS tools such as Suricata and Zeek inspect traffic, raise alerts and where they fit in a defense.

Intermediate · about 10 hours · difficulty 3/5

Learn first: [Packet Analysis with Wireshark](https://www.internhack.in/roadmaps/tracks/cybersecurity/wireshark), [Firewalls and Network Segmentation](https://www.internhack.in/roadmaps/tracks/cybersecurity/firewalls-segmentation)

An **IDS** (intrusion detection system) watches traffic and raises alerts. An **IPS** sits inline and can drop traffic it considers malicious. Both are sensors: their value depends on placement, tuning and someone actually reviewing the output.

### Detection approaches

- **Signature based**: match known patterns, like a rule for a specific malware beacon. Fast and precise, but blind to new behaviour.
- **Anomaly or behaviour based**: flag deviations from a baseline, such as a workstation suddenly sending gigabytes overnight. Catches novel activity but produces more noise.
- **Network metadata**: tools like **Zeek** do not just alert, they write rich logs (connections, DNS, HTTP, TLS, files) that analysts search later.

### Common tools

- **Suricata**: open-source IDS/IPS that uses rule sets such as Emerging Threats Open.
- **Zeek**: network security monitor focused on protocol logs.
- **Security Onion**: a free distribution bundling these with a search interface, ideal for a home lab.

### Placement

Put sensors where traffic crosses trust boundaries: internet edge, between user and server zones, and in front of critical systems. Encrypted traffic limits payload inspection, so metadata (SNI, JA3/JA4 fingerprints, DNS) becomes more important.

### Pitfalls

- Turning on every rule and drowning in false positives.
- Running an IPS in blocking mode before tuning it, which breaks legitimate business traffic.

Move on when you can run Suricata or Security Onion against a sample capture, explain three alerts, and decide which are false positives.

## Key concepts

- **IDS vs IPS**
- **Signature vs anomaly detection**
- **Suricata rules and rule sets**
- **Zeek network logs**
- **Sensor placement**
- **Tuning and false positives**
- **Security Onion lab**

## Mini project

Install Security Onion or Suricata in a VM, replay a public benign-plus-malware sample PCAP from a training site, and write a short report classifying the top five alerts.

## Check yourself

What information can a network sensor still provide when the payload is encrypted with TLS?

## Free resources

- [Suricata documentation](https://docs.suricata.io/) (OISF)
- [Zeek documentation](https://docs.zeek.org/) (Zeek Project)
- [Security Onion documentation](https://docs.securityonion.net/) (Security Onion Solutions)

Previous: [Firewalls and Network Segmentation](https://www.internhack.in/roadmaps/tracks/cybersecurity/firewalls-segmentation) · Next: [VPNs and Secure Remote Access](https://www.internhack.in/roadmaps/tracks/cybersecurity/vpn-remote-access)

## More in Network Defense

- [Firewalls and Network Segmentation](https://www.internhack.in/roadmaps/tracks/cybersecurity/firewalls-segmentation)
- [Intrusion Detection and Prevention](https://www.internhack.in/roadmaps/tracks/cybersecurity/ids-ips)
- [VPNs and Secure Remote Access](https://www.internhack.in/roadmaps/tracks/cybersecurity/vpn-remote-access)
- [Zero Trust Architecture](https://www.internhack.in/roadmaps/tracks/cybersecurity/zero-trust)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
