Перейти к основному содержимому
Layered Network Defense & Telemetry Collection
Урок 14 из 20

Layered Network Defense & Telemetry Collection

Design layered network defences that pair prevention controls with NetFlow and Zeek telemetry, and triage Zeek conn.log records to uncover stealthy scans and data exfiltration.

Продвинутый 24 мин Форензика и IR
Этого урока пока нет на выбранном языке — показана версия на другом языке. Перевод готовится.

Цели обучения

  • Map preventative controls and visibility layers across perimeter, DMZ, and internal network zones
  • Compare NetFlow/IPFIX flow records, Zeek protocol metadata, and full PCAP across cost and forensic value
  • Interpret Zeek conn.log fields such as conn_state, history, service, and byte ratios to spot anomalies
  • Diagnose common telemetry architecture gaps including asymmetric routing and missing east-west visibility

Рекомендуется заранее: Network Segmentation, DMZs, Microsegmentation & NACSuspicious Network Traffic: Beaconing, Tunneling & ExfilIDS/IPS Architecture, Placement & Signature Logic

#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.

  1. Perimeter EdgeFirewalls, DDoS filtering, egress allow-lists
  2. DMZ BoundaryReverse proxies, inline IPS, WAF inspection
  3. Internal VLANsMicrosegmentation, NAC, east-west Zeek and flow sensors
  4. 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 across dns.log, http.log, ssl.log, and files.log for fast pivoting.
  • service: Protocol identified by payload inspection (for example ssl, dns, ssh), left as - when unrecognised.
  • orig_bytes and resp_bytes: Application payload bytes sent by originator and responder. A sudden reversal where orig_bytes far exceeds resp_bytes suggests 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: S SYN, h SYN-ACK, A ACK, D data, F FIN, R RST). Normal web traffic looks like ShADadFf, whereas a stealthy port scan leaves S or ShR.

You can run Zeek offline against a lab PCAP and filter columns with zeek-cut:

Generating and triaging Zeek conn.log in a lab
$ 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   ShADadFf

Look 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, OTH or S0 states, and incomplete history flags. 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 == 80 misses HTTP running on port 8080 or 443. Always filter on Zeek's protocol-derived service field 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.

Проверка знаний

Войдите, чтобы проходить тест, завершать уроки и сохранять прогресс. Войти в систему

Практика: проверьте свои знания