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.
- 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.
- 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.
- 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.
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?
- 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.
- 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.
- 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.
- 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.
- 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.
- "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."