While firewalls function like security doors that determine which ports are open, an Intrusion Detection System (IDS) and Intrusion Prevention System (IPS) act as security cameras and armed guards inspecting the actual behavior of traffic passing through those doors. They examine packet payloads for known exploit signatures, suspicious behavioral anomalies, and unauthorized protocol anomalies.
| Feature | Intrusion Detection System (IDS) | Intrusion Prevention System (IPS) |
|---|---|---|
| Placement | Out-of-Band (Passive) via SPAN/Mirror port or Network TAP. | In-Line (Active) directly in the traffic flow between router and switch. |
| Action on Match | Generates an alert, logs the event, notifies SIEM. Does not stop traffic! | Drops packet immediately, resets TCP connection, blocks attacking IP. |
| Latency Impact | Zero network latency (monitors a mirrored copy of packets). | Introduces minor latency because packets must be inspected before forwarding. |
| Risk of False Positives | Low business disruption (analyst investigates false alarm later). | High risk (a false positive blocks legitimate customer transactions!). |
Snort is the world's most widely adopted open-source network IDS/IPS rule engine. Every Snort rule is divided into a Rule Header and Rule Options:
# Alert on any external IP attempting an /etc/passwd path traversal over HTTP
alert tcp $EXTERNAL_NET any -> $HTTP_SERVERS 80 (
msg:"ATTACK-RESPONSES /etc/passwd path traversal detected";
flow:to_server,established;
content:"/etc/passwd"; nocase;
sid:1000001;
rev:1;
classtype:web-application-attack;
)
alert, log, drop, reject).# Run Snort as live packet sniffer dumping headers to console
sudo snort -v -i eth0
# Run Snort as Network IDS applying configuration rules
sudo snort -A console -q -c /etc/snort/snort.conf -i eth0
Broaden your defensive and offensive security knowledge across our curriculum:
Comparing proactive drop actions with passive detection alerts.
Crafting custom Snort signatures based on Wireshark byte offsets.
Ingesting Snort IDS alerts into Splunk for analyst correlation and response.
Snort rule syntax, header options, and regex content modifiers.