#Why this matters
Signature-based IDS/IPS sensors catch known threats quickly, yet adversaries routinely bypass signatures using custom TLS tunnels, living-off-the-land administrative tools, or slow data staging. At the same time, storing full packet captures (PCAP) for months across gigabit links is rarely affordable.
A resilient layered network defense combines preventative enforcement at zone boundaries with tiered telemetry collection. When an alert fires days or weeks after initial compromise, structured telemetry lets defenders answer what happened, which hosts communicated, and how much data left the network.
#Defense in depth across network boundaries
Effective architecture separates prevention (stopping disallowed traffic) from detection and visibility (recording what was permitted). Attackers who compromise a workstation or abuse valid credentials still traverse the network during reconnaissance, command-and-control (C2), and lateral movement.
- Perimeter EdgeFirewalls, DDoS filtering, egress allow-lists
- DMZ BoundaryReverse proxies, inline IPS, WAF inspection
- Internal VLANsMicrosegmentation, NAC, east-west Zeek and flow sensors
- Endpoint LayerHost firewalls, EDR process-to-socket telemetry
Notice why telemetry belongs at multiple layers: if an adversary pivots between two servers on an internal VLAN, perimeter firewalls and edge IDS sensors never see a single packet. Collecting east-west telemetry at core distribution switches ensures internal lateral movement leaves an unmistakable trail.
#Choosing the right telemetry tier
No single telemetry source answers every question. Defenders balance granularity, storage cost, and retention across three tiers:
| Tier | Typical format | Retention window | Best defensive use |
|---|---|---|---|
| Flow telemetry | NetFlow v9, IPFIX (RFC 7011) | Months to a year | Top talkers, volume spikes, lateral fan-out, long-term baselines |
| Protocol metadata | Zeek (conn.log, dns.log, ssl.log) |
Weeks to months | Connection states, DNS queries, TLS SNI/JA3, file hashes via uid |
| Full packet capture | Ring-buffered PCAP | Hours to days | Payload carving, exploit reconstruction, deep protocol forensics |
Flow records (NetFlow / IPFIX) summarize each conversation using source and destination IPs, ports, protocol, timestamps, and byte/packet counts, without inspecting payloads. Zeek sits between flow records and PCAP: it parses protocols dynamically regardless of port (Dynamic Protocol Detection) and emits compact, tab-separated or JSON logs linked by a unique uid. When a Zeek or NetFlow anomaly appears, analysts pull matching packets from the short-term PCAP ring buffer before they roll over.
#Reading Zeek conn.log for anomaly hunting
Every network flow observed by Zeek generates a line in conn.log. Even when payloads are encrypted with TLS 1.3, conn.log exposes strong behavioural signals through several fields:
uid: Unique flow ID shared acrossdns.log,http.log,ssl.log, andfiles.logfor fast pivoting.service: Protocol identified by payload inspection (for examplessl,dns,ssh), left as-when unrecognised.orig_bytesandresp_bytes: Application payload bytes sent by originator and responder. A sudden reversal whereorig_bytesfar exceedsresp_bytessuggests bulk upload or exfiltration.conn_state: Summarizes TCP/UDP lifecycle (SF= normal SYN and FIN teardown;S0= SYN sent with no reply;REJ= rejected with RST;RSTO/RSTR= mid-connection reset by originator or responder).history: Compact letter trace of packet flags seen (uppercase for originator, lowercase for responder:SSYN,hSYN-ACK,AACK,Ddata,FFIN,RRST). Normal web traffic looks likeShADadFf, whereas a stealthy port scan leavesSorShR.
You can run Zeek offline against a lab PCAP and filter columns with zeek-cut:
$ zeek -r campus-lab.pcap
$ zeek-cut uid id.orig_h id.resp_h id.resp_p service duration orig_bytes resp_bytes conn_state history < conn.log
C9xK2p1a 10.10.10.15 198.51.100.10 443 ssl 1.42 640 8420 SF ShADadFf
C7mN8q4b 10.10.10.42 10.10.20.11 22 - 0.00 0 0 S0 S
C7mN8q5c 10.10.10.42 10.10.20.11 445 - 0.01 0 0 REJ Sr
C4vL9z2d 10.10.10.42 203.0.113.77 8443 - 412.8 18450200 11420 SF ShADadFfLook closely at those four rows. Flow C9xK2p1a is routine HTTPS (ssl, SF, normal download ratio). Flows C7mN8q4b and C7mN8q5c show 10.10.10.42 probing internal server 10.10.20.11 with unanswered (S0) and rejected (REJ) connections. Flow C4vL9z2d reveals the payoff: the same host 10.10.10.42 uploaded over 18 MB (orig_bytes) to external IP 203.0.113.77 on port 8443 with no recognised service.
#Common mistakes in telemetry collection
Even well-funded monitoring stacks fail when basic engineering details are overlooked:
- Blindness to east-west lateral movement: Exporting NetFlow or running Zeek only on the internet border misses scanning and credential abuse between internal workstations and servers.
- Asymmetric routing across sensors: If outbound packets traverse Sensor A while return packets traverse Sensor B, Zeek records
missed_bytes,OTHorS0states, and incompletehistoryflags. Aggregate both directions before the sensor or configure symmetric routing. - Clock drift across devices: Unsynchronized clocks (missing NTP) make correlating Zeek timestamps with firewall and endpoint logs slow and error-prone during live incident response.
- Port-based assumptions: Filtering logs by
id.resp_p == 80misses HTTP running on port8080or443. Always filter on Zeek's protocol-derivedservicefield alongside port numbers.
#Summary
Layered network defense pairs preventative boundaries with tiered visibility so attackers cannot hide inside permitted channels. NetFlow/IPFIX captures long-term traffic baselines, Zeek adds rich protocol metadata linked by uid, and short-term PCAP preserves full payloads for deep triage. Reading conn.log fields such as conn_state, history, service, and byte asymmetries lets analysts detect scans and encrypted exfiltration even when signature alerts stay silent.