Skip to content
Visual explainer 3h to learn 4 steps

IDS, EDR & network monitoring

Explain what IDS and EDR detect and read a Suricata or EDR alert.

By Invicly Tech, , in Cyber Security Fundamentals. About 10 minutes to read.

Topic 37 of 49

In short

Intrusion detection systems watch network traffic for known patterns, while endpoint detection and response watches process and file behaviour on hosts and can act. Flow logs and Zeek add network context. Together they give both network and endpoint visibility.

Explained simply

Attackers leave traces in two places: on the network, as they move data around, and on computers, as they run programs. Defenders watch both. Network tools look at traffic on the wire. Endpoint tools sit on each laptop or server.

An IDS (intrusion detection system) such as Suricata or Snort watches a copy of network traffic and compares it with rules that describe known attacks. When something matches, it writes an alert. An IPS (intrusion prevention system) sits in the traffic path, so it can also drop the bad packets.

An EDR (endpoint detection and response) agent runs on each computer. It records which programs start, which files they touch and where they connect. It can also act: stop a process, quarantine a file, or cut the machine off the network while keeping a line open for the security team.

In between sits network metadata: NetFlow and Zeek logs. They do not store full packets, just a summary of each connection. That is cheap to keep for months and very good for spotting odd patterns, like a laptop talking to the same rare server every minute.

Press Play on a diagram to walk through it one step at a time.

CompareIDS vs EDR
IDS/IPS
  • Watches network traffic
  • Signature and anomaly based
  • IPS can block inline
  • Blind to encrypted payloads
EDR
  • Watches endpoint behaviour
  • Rich process telemetry
  • Can isolate a host
  • Needs an agent installed
FlowFollowing one threat across network and endpoint tools
  1. 1
    Suricata alert

    Known bad TLS fingerprint to a rare IP

  2. 2
    Zeek conn.log

    Same host connects every 60 seconds

  3. 3
    Zeek dns.log

    Reveals the domain behind the IP

  4. 4
    EDR process tree

    Shows which program made the calls

  5. 5
    EDR response

    Isolate host, collect evidence

In depth

Where network sensors sit

An IDS needs to see traffic. The usual way is a SPAN port, where a switch copies traffic to the sensor, or a network TAP, a small device that splits a cable. Both are passive: if the sensor crashes, the network keeps working, but the sensor can only alert, not block. An IPS sits inline, so traffic flows through it. It can drop packets, but it adds a little delay, and you must choose what happens when it fails: fail open (traffic passes uninspected) or fail closed (traffic stops).

Place sensors where traffic crosses trust boundaries: the internet edge, between user and server networks, and in front of critical systems. Encryption limits what they see. With TLS, the payload is hidden, but the server name (SNI), the TLS fingerprint (JA3 or JA4) and connection sizes and timing are still visible and useful.

ComparePassive sensor vs inline sensor
Passive (SPAN or TAP)
  • Gets a copy of traffic
  • Can alert, cannot block
  • Failure does not break the network
  • May miss packets when overloaded
Inline (IPS)
  • Traffic flows through it
  • Can drop bad packets
  • Adds a little latency
  • Must fail open or fail closed

Reading a Suricata alert

Suricata writes JSON events, one per line, to eve.json. An alert has event_type set to alert, a timestamp, the five-tuple (src_ip, src_port, dest_ip, dest_port, proto) and an alert object. Inside it, signature is the human-readable rule message, signature_id (the SID) and rev identify the exact rule, category gives the class, severity runs from 1 (most severe) downward, and action says allowed or blocked.

Read it in order. Which way did traffic go: from your host out, or from outside in? Is the destination internal or external? Look up the rule by its SID to see exactly what it matched. Then use flow_id: every event Suricata writes about the same connection, including http, dns, tls and flow records, shares it, so you can see the full conversation and whether the server answered. Rules are commonly kept up to date with suricata-update, which pulls the free ET Open ruleset by default.

  • Rule shape: action proto src port -> dst port (options; sid:N; rev:N;)
  • Local rules use SIDs of 1000000 and above
  • suricata -T -c /etc/suricata/suricata.yaml tests the config

NetFlow and Zeek: a diary of connections

NetFlow (and its standard cousin IPFIX) is exported by routers and firewalls. Each record says who talked to whom: source and destination IP and port, protocol, start and end time, bytes and packets. There is no payload, and busy routers often sample, recording only some packets.

Zeek is a network analysis tool that watches traffic and writes rich, structured logs: conn.log for every connection, plus dns.log, http.log, ssl.log, files.log, x509.log and notice.log. Every connection gets a uid, so you can join its DNS lookup, TLS details and file transfers across logs. The conn_state field tells you how a connection went: SF is a normal open and close, S0 means no reply, REJ means it was refused.

Use this metadata to hunt: regular small connections (beaconing), large uploads (orig_bytes much bigger than resp_bytes), very long connections and destinations no other host visits.

MapOne connection across Zeek logs (same uid)
uid CHhAvVGS1DHFjwGM9
  • conn.log
    • IPs and ports
    • duration and bytes
    • conn_state
  • dns.log
    • query name
    • answers
  • ssl.log
    • server_name (SNI)
    • TLS version
  • files.log
    • file type
    • hashes

What EDR records and how it responds

An EDR agent hooks deep into the operating system. On Windows it uses kernel callbacks and Event Tracing for Windows (ETW); on Linux it often uses eBPF or similar kernel features. It records process starts with command line, hash, signer and parent; file writes; registry changes; network connections; DLL and module loads; and attempts to read another process's memory, such as LSASS, where Windows keeps login secrets. Many also capture script content through AMSI.

The agent streams this to a backend that applies behaviour rules and machine learning, and draws the process tree for each alert. Response actions include isolating the host (blocking all traffic except to the EDR console), killing a process, quarantining a file, running a remote shell for live response and collecting files or memory.

Attackers try to stop or blind EDR, so turn on tamper protection and alert when an agent goes silent.

Learn it in 4 short steps

About 45m each. Track them with a timer in your plan.

  1. 1
    Compare IDS, IPS and EDR~45m
  2. 2
    Read a Suricata alert~45m
  3. 3
    Explain NetFlow and Zeek logs~45m
  4. 4
    Explain EDR telemetry and response~45m

Key points

  • IDS detects; IPS can also block inline.
  • EDR focuses on endpoint process and file behaviour.
  • EDR can respond, for example isolating a host.
  • NetFlow and Zeek add network context without full capture.

Key terms

Tap a card to flip it. 0/4 known

Examples

Reading Suricata alerts with jq

You get a ticket about Suricata alerts from host 10.0.5.23. Step 1: print the latest alerts in a compact form with the fields that matter. Step 2: note the signature, direction and action (allowed means it was not blocked). Step 3: copy the flow_id of one alert and print every event with that ID, which shows the matching dns, tls or http records. Step 4: look up the SID in the rules file to see exactly what matched, then decide whether to pivot to the EDR for that host.

bash
jq -c 'select(.event_type=="alert" and .src_ip=="10.0.5.23")
  | {ts: .timestamp, dst: .dest_ip, dport: .dest_port, sid: .alert.signature_id,
     sig: .alert.signature, sev: .alert.severity, action: .alert.action}' \
  /var/log/suricata/eve.json | tail -n 5

# all events for one connection
jq -c 'select(.flow_id==1234567890123456)' /var/log/suricata/eve.json

# what the rule matches (use the SID from the alert)
grep "sid:2027865;" /var/lib/suricata/rules/suricata.rules

Spotting beaconing in Zeek conn.log

Malware often checks in with its server at a fixed interval. Step 1: list connections from one host to one rare destination. Step 2: compute the seconds between each connection and its previous one, rounded to whole numbers. Step 3: count how often each gap appears. If most gaps are 60 seconds and the bytes are small and similar, you are looking at a likely beacon. Step 4: check dns.log and ssl.log with the same uid values, then the EDR for the process.

bash
zeek-cut ts id.orig_h id.resp_h id.resp_p orig_bytes resp_bytes < conn.log \
  | awk '$2=="10.0.5.23" && $3=="198.51.100.7"' | head

# gaps between connections, most common first
zeek-cut ts id.orig_h id.resp_h < conn.log \
  | awk '$2=="10.0.5.23" && $3=="198.51.100.7" {if (p) printf "%d\n", $1-p; p=$1}' \
  | sort -n | uniq -c | sort -rn | head

Quick reference

  • IDS alerts on a copy of traffic; an IPS sits inline and can drop packets
  • Suricata writes JSON to eve.json; event_type alert holds the rule matches
  • Use flow_id to join a Suricata alert with its http, dns, tls and flow events
  • suricata-update keeps rules current; ET Open is the free default ruleset
  • Zeek uid links one connection across conn.log, dns.log, http.log and ssl.log
  • zeek-cut picks columns: zeek-cut id.orig_h id.resp_h id.resp_p < conn.log
  • NetFlow and IPFIX: who talked to whom, when and how much, with no payload
  • EDR response: isolate host, kill process, quarantine file, collect evidence

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Which sensor placement lets you block malicious traffic?

Question 2

2In Suricata's eve.json, which field links an alert to the http and dns events of the same connection?

Question 3

3A laptop sends about 300 bytes to the same rare IP every 60 seconds all night. What is this pattern?

Question 4

4What does EDR host isolation do?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Run Suricata offline against a sample PCAP file and list the alert signatures by count.

  2. Exercise 2medium

    Write a local Suricata rule that alerts when a host on your network sends HTTP requests with a user agent containing curl, then test that the config still loads.

  3. Exercise 3hard

    Run Zeek on a PCAP and find the top 5 internal hosts (10.x.x.x) by bytes sent to external addresses.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Do I still need an IDS if I have EDR?
They see different things. EDR cannot run on printers, cameras, network gear or unmanaged devices, and an IDS or Zeek sensor still sees their traffic. Many teams use both.
What is the difference between EDR and antivirus?
Antivirus mainly blocks known bad files. EDR records detailed behaviour over time, detects suspicious activity even from unknown tools, and gives responders actions such as isolation and live response.
Can an IDS see inside HTTPS traffic?
Not the content, unless traffic is decrypted at a proxy. It can still see metadata like the server name, TLS fingerprint, certificate details in older TLS versions, and connection timing and size.
What is XDR?
Extended detection and response combines EDR with other sources such as email, identity, network and cloud in one product, so alerts from different places are correlated automatically.

Go deeper

ShareXLinkedInWhatsApp