SECURITY ENGINEERING · PART 2 · NETWORKING FOR SECURITY · DEFENSE · 30 OF 229

IDS vs IPS: Suricata, Snort and Zeek Explained

The systems that watch traffic a firewall already allowed: intrusion detection versus intrusion prevention, signature detection and anomaly detection, where sensors sit, how a Suricata rule reads, Zeek as a network flight recorder, host-based detection, the blind spot created by encryption, and the tuning that keeps alerts worth reading.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 12

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • IDS alerts, IPS blocks
  • signatures and anomalies
  • Suricata, Snort, Zeek
  • watch inside, not just the edge
  • tune or drown

Notes

IDS

An intrusion detection system receives a copy of the traffic, from a mirror port on a switch or a network tap, inspects it, and raises alerts. It sits beside the traffic, not in it, so it cannot block anything. That is a weakness and also a strength: a wrong alert costs an analyst a few minutes, not an outage. An IDS is only useful if somebody actually reads and acts on what it says.

Intrusion detection system
  • receives a copy of traffic (a mirror port or tap)
  • inspects it and alerts
  • cannot block anything
  • cannot break anything either: a wrong alert costs time, not an outage
  • needs someone to read the alerts

IPS

An intrusion prevention system uses the same detection but sits inline, with all traffic passing through it, so it can drop a packet or reset a connection. Known attacks are stopped immediately. The cost is that a false positive now blocks real users, and the device becomes a point of failure. The sensible path is to run in detection mode first, see what would have been blocked, and switch on blocking one confident rule at a time.

Intrusion prevention system
  • inline: all traffic passes through it
  • can drop a packet or reset a connection
  • stops known attacks at once
  • a false positive now blocks real users
  • it is a point of failure and adds delay
  • start in detect mode, then enable blocking rule by rule

Two ways to detect

There are two ways to detect. Signature detection matches traffic against known patterns, like a virus scanner. It is precise and fast, and blind to anything it has no signature for. Anomaly detection learns what normal looks like and flags deviations, such as a server that suddenly talks to a new country. It can find new attacks and it is noisier. Real deployments use both, and signature sets need updating every day.

Signatures and anomalies
  • signature: match a known pattern. Precise, fast, blind to anything new anomaly: learn normal, flag what differs. Finds new things, noisier
  • real systems combine both rules need daily updates (e.g. Emerging Threats)

A rule

Here is a rule, in the format used by Suricata and Snort, the two main open-source engines. It starts with the action, alert. Then the protocol, the source and the destination. Inside the brackets are the conditions, here an HTTP address containing dot dot slash, the mark of a path traversal attempt, plus the message and a unique rule number. Thousands of community rules exist. The skill is reading them and writing a few for your own environment.

Reading a rule
alert http any any ->
  $HOME_NET any (
  msg:"Path traversal attempt";
  http.uri; content:"../";
  sid:1000001; rev:1;)

action, protocol, from -> to,
then what to match and the
message to show

Zeek

Zeek is a different kind of tool. Instead of matching signatures it writes a structured diary of everything on the network: every connection, every DNS lookup, every HTTP request, every TLS handshake. These logs are tiny compared with full packet capture, so you can keep months of them. When an incident happens, Zeek logs answer the questions that matter: what did this machine talk to, when, and how much data left?

Zeek: network flight recorder
  • does not match signatures
  • writes structured logs of what happened: conn.log every connection dns.log every lookup http.log every request ssl.log every handshake
  • small compared with full packet capture
  • invaluable in an investigation

Where sensors go

A sensor only sees the traffic that passes it, so placement matters. At the internet edge it sees every scan from outside, which is mostly noise. Between internal segments it sees lateral movement, an attacker already inside moving toward the data, which is far more valuable. In the cloud you use traffic mirroring, flow logs or the provider's own detection service. Most companies watch the front door intently and have no view of the corridors.

Placement
  • at the edge: sees attacks from outside, lots of noise
  • between segments: sees lateral movement, the valuable view
  • in front of critical servers
  • cloud: traffic mirroring, VPC flow logs, provider IDS
  • most teams watch the edge and nothing inside

Host and encryption

Most traffic is encrypted now, and a network sensor cannot read inside TLS. It still sees useful metadata: who talked to whom, when, how much, the server name and a fingerprint of the handshake. For the content you need detection on the host itself, where data exists unencrypted: host-based intrusion detection and endpoint detection tools that watch processes, files and logins. Network and host views cover each other's blind spots.

The encryption blind spot
  • network sensors cannot read TLS payloads
  • they still see metadata: who, when, how much, server name, TLS fingerprints
  • host-based detection (HIDS, EDR) sees after decryption: processes, files, logins
  • Wazuh, OSSEC, osquery
  • use both views

Tuning

The biggest failure with these systems is not technical. Out of the box they alert on everything, analysts receive thousands of alerts a day, and within a week nobody reads them. Tuning is the job. Disable rules for software you do not run. Suppress known-good sources. Rank alerts by how valuable the target is. Send them to your central log system to combine with other signals. And measure how many alerts led to action. That number should be high.

Alert fatigue
  • default rules alert on everything
  • analysts stop reading
  • tune: disable rules for software you do not run
  • suppress known-good sources
  • rank by asset value
  • send to the SIEM and correlate with other signals
  • measure: how many alerts led to action?

Common mistakes

Mistakes. Installing a detection system and never tuning it. Turning on blocking from the first day and causing an outage that gets the whole system switched off. Placing sensors only at the edge. Never updating the rules. Giving up on encrypted traffic, when its metadata is still rich. Having no detection on hosts. And alerts that go to a mailbox nobody owns.

Avoid these
  • installing and never tuning
  • blocking on day one
  • sensors only at the edge
  • rules never updated
  • ignoring encrypted traffic entirely
  • no host-based detection
  • alerts nobody owns

Say it like this

In the interview: an IDS inspects a copy of the traffic and raises alerts, while an IPS sits inline and can block, which means its false positives cost availability. Both use signatures for known attacks and anomaly detection for unusual behaviour. I start in detection mode, tune heavily before enabling any blocking, place sensors between internal segments and not just at the edge, and add host-based detection because most traffic is encrypted.

In the interview
  • "An IDS inspects a copy of traffic and alerts; an IPS is inline and can block, so false
  • positives cost availability.
  • Both use signatures and anomaly detection. I start in detect mode, tune hard, place
  • sensors between segments, and add host detection for TLS."

Interview questions

Q1What is the difference between an IDS and an IPS?

An intrusion detection system inspects a copy of network traffic and generates alerts without affecting it. An intrusion prevention system is placed inline and can drop packets or reset connections, so it stops attacks but its false positives block legitimate traffic.

Q2What is the difference between signature-based and anomaly-based detection?

Signature detection matches traffic against known attack patterns: accurate for known threats but blind to new ones. Anomaly detection models normal behaviour and flags deviations: it can catch novel attacks but produces more false positives.

Q3What are Suricata, Snort and Zeek?

Suricata and Snort are open-source IDS/IPS engines that match traffic against rules. Zeek is a network analysis framework that produces structured logs of connections, DNS, HTTP and TLS activity rather than signature alerts, and is widely used for investigation and hunting.

Q4Where should IDS sensors be placed?

At the perimeter to see external attacks, but more valuably between internal segments and in front of critical systems, where they reveal lateral movement. In the cloud, traffic mirroring, flow logs or managed detection services provide the equivalent.

Q5How does encryption affect network intrusion detection?

TLS hides payloads from network sensors, leaving metadata such as endpoints, volumes, SNI and handshake fingerprints. Content-level detection therefore moves to the host (HIDS/EDR) or to points where traffic is decrypted, and both views are used together.

Q6What is a HIDS?

A host-based intrusion detection system runs on the machine itself and monitors logs, file integrity, processes and configuration changes. Examples include Wazuh, OSSEC and osquery-based tooling; EDR products extend the idea with response capabilities.

Q7What is alert fatigue and how do you reduce it?

Analysts being overwhelmed by too many low-value alerts until they ignore them. Reduce it by disabling irrelevant rules, suppressing known-good activity, prioritising by asset value, correlating in a SIEM and measuring the share of alerts that lead to action.

Q8Why run an IPS in detection mode first?

To observe what it would block on real traffic without risking an outage. Rules with a clean record can then be moved to blocking one at a time, which builds confidence and avoids false positives taking down legitimate services.