Notes
Four kinds of evidence
There are four kinds of network evidence. Flow records are a summary: who talked to whom, when, on which port, and how much. Protocol logs record what was asked: the DNS names, the web addresses, the TLS details. Alerts say a detection rule matched, as in the IDS episode. And full packet capture keeps every byte. Cost and detail both rise as you go down that list, so the art is collecting each where it pays.
- flow records: who talked to whom, when, how much
- protocol logs: what was asked (DNS names, URLs, TLS details)
- alerts: a rule matched (IDS, from episode 10)
- full packet capture: every byte
- cost rises down the list; so does detail
Flow records
Flow records are like a phone bill: no content, but a complete list of who called whom, when and for how long. They come from routers and switches as NetFlow or IPFIX, and in the cloud as flow logs you simply switch on. They are tiny, so you can keep a year of them, and they work just as well on encrypted traffic. During an incident they answer the first questions: did this machine talk to that address, and how much data left?
src dst port 10.0.2.15 203.0.113.9 443 start 02:14:07 bytes 4.1 GB tiny: keep a year of them works on encrypted traffic answers: did this host talk to that address? how much left? cloud: turn on flow logs
Protocol logs
Protocol logs add meaning. DNS logs record every name each machine looked up, and if you can keep only one network log, keep this one, because almost all malware resolves a name before it does anything. Web and proxy logs give addresses and response codes. TLS logs give the server name, the certificate and a fingerprint of the client. Zeek produces all of these. Add firewall, VPN and DHCP logs, the last so you can tell who held an address at the time.
- DNS: every name each machine looked up. The single most valuable network log
- HTTP/proxy: URLs, user agents, response codes
- TLS: server name, certificate, client fingerprint
- Zeek writes all of these
- also: firewall, VPN, DHCP (who had this address then?)
Packet capture
Full packet capture is the complete truth. With it you can rebuild the exact file that was downloaded or the exact commands that were sent. It is also enormous, mostly ciphertext these days, and full of personal data that needs protecting. So few teams capture everything. The practical approach is to keep a few days at the most important points, or start a capture automatically when an alert fires, and keep the cheap metadata for far longer.
- every byte: you can rebuild files and sessions
- huge: a busy link fills disks in hours
- mostly ciphertext now
- privacy: it holds personal data
- practical: keep days at key points; or capture on demand when an alert fires
- keep metadata far longer
Know normal
Monitoring starts with knowing what normal looks like. Which servers talk to which. Which ones ever reach the internet, and where. How much traffic is usual at each hour. Which names are commonly looked up. With that baseline, the odd things stand out on their own: a database server opening a connection to the internet, a laptop sending forty gigabytes somewhere at three in the morning. Without a baseline, every chart looks equally unremarkable.
- which servers talk to which which ones ever reach the internet, and where
- normal volumes by hour and by day
- which DNS names are common
- then the odd things stand out: a database connecting out, a laptop sending 40 GB at 3 a.m.
What to look for
What should you look for? Beaconing: small connections to one address at suspiciously regular intervals, the heartbeat of malware calling home. Scanning: one source touching many ports or hosts. Lateral movement: one workstation connecting to another, or administrative protocols at odd hours. Exfiltration: large outbound transfers, especially to a destination never seen before. And strange DNS: long random-looking names. Each is one step of the attack chain from Part zero, seen from the network.
- beaconing: small, regular connections to one address (malware calling home)
- scanning: one source, many ports or hosts
- lateral movement: workstation to workstation, admin protocols at odd hours
- exfiltration: large outbound transfers, new destinations
- DNS: long random names
Encrypted traffic
Most traffic is encrypted, and you do not need to read it to monitor it. Destination, timing and size still tell the story. The server name and certificate are visible in the handshake. A fingerprint of the client's handshake identifies which software is talking, which is how malware is spotted inside TLS. DNS shows intent. Pair all that with telemetry from the host for what happened inside. Decrypting traffic for inspection is possible, but it is costly and sensitive.
- destination, timing and size still tell the story
- server name (SNI) and certificate details
- client fingerprints (JA3/JA4) identify the software
- DNS shows the intent
- pair with host telemetry (EDR)
- TLS inspection: possible, costly, privacy-sensitive
In the cloud
In the cloud there is no switch to plug a sensor into, but the provider records the traffic for you if you ask. Turn on flow logs for every network. Turn on DNS query logs. Collect load balancer and WAF logs. Use traffic mirroring when you need full packets. And enable the provider's managed detection service, which analyses these sources for you. In the cloud, the log of API calls matters just as much, which is a subject for Part ten.
- VPC / NSG flow logs: turn them on everywhere
- DNS query logs
- load balancer and WAF logs
- traffic mirroring for full packets, when needed
- managed detection: GuardDuty, Defender for Cloud, Security Command Center
- the control plane log matters as much (Part 10)
A sensible setup
Here is a sensible setup for a small team. Flow logs everywhere, kept for months. DNS logs. Zeek or the cloud equivalent at the important points. A tuned IDS. All of it sent to one place with synchronised clocks, so events line up. Then ten good alerts, each with a written response, rather than a thousand that nobody reads. And packet capture on demand for when you need proof. That is enough to notice most of the attacks in this part.
- 1 flow logs everywhere, kept for months
- 2 DNS logs
- 3 Zeek or the cloud equivalent at key points
- 4 an IDS, tuned
- 5 everything into one place with synced clocks
- 6 ten good alerts, each with a response written down 7 packets on demand
Common mistakes
Mistakes. Watching only the internet edge, with no view of traffic between internal systems. Switching off flow logs to save a little money. No DNS logging. Keeping logs for seven days, when intruders are often found months later. Capturing everything and analysing nothing. Having no baseline of normal. And alerts that fire into a channel nobody owns, which is the same as having no alerts.
- watching only the internet edge
- flow logs switched off to save money
- no DNS logging
- logs kept for seven days
- capturing everything, analysing nothing
- no baseline
- alerts with no owner
Say it like this
In the interview: I collect layered evidence. Flow logs everywhere for who talked to whom, DNS and protocol logs from Zeek for what was asked, a tuned IDS for known attacks, and packet capture on demand for proof, all centralised with synchronised time. I establish a baseline, then alert on beaconing, scanning, lateral movement and large or unusual outbound transfers. For encrypted traffic I rely on metadata and fingerprints, paired with host telemetry.
- "Layered evidence: flow logs
- everywhere, DNS and protocol
- logs from Zeek, a tuned IDS, and packet capture on demand, all in one place. I baseline
- normal, then alert on beaconing, scans, lateral
- movement and large outbound
- transfers, using metadata
- for encrypted traffic."