Skip to content

Latest commit

 

History

History
280 lines (203 loc) · 7.08 KB

06-traffic_logging.md

File metadata and controls

280 lines (203 loc) · 7.08 KB
SPDX-FileCopyrightText SPDX-License-Identifier title author footer description keywords color class style
© 2024 Menacit AB <[email protected]>
CC-BY-SA-4.0
Logging course: Network traffic logging
Joel Rangsmo <[email protected]>
© Course authors (CC BY-SA 4.0)
Introduction to network traffic logging
logging
siem
course
#ffffff
invert
section.center { text-align: center; } table strong { color: #d63030; } table em { color: #2ce172; }

Network traffic logging

bg right:30%


Capturing/Sniffing of network traffic allows us to implement inspection-based logging.

Freely available tools like tcpdump and WireShark/TShark are easy to use on your own computer/server.

bg right:30%


$ tcpdump -v -n -A -i "enp2s0" -- port 80              

tcpdump: listening on enp2s0,
link-type EN10MB (Ethernet),
snapshot length 262144 bytes          

[...]
11:16:57.522596 IP (tos 0x0, ttl 64, id 33090,
offset 0, flags [DF], proto TCP (6), length 127)
198.18.100.3.45924 > 93.184.216.34.80: Flags [P.],
[...]
  GET / HTTP/1.1
  Host: example.com
  User-Agent: curl/7.81.0 

Most enterprise-grade switches supports configuration of a "span/mirror/tap" port.

Just connect a computer and start sniffing.

bg right:30%


Public-cloud features like Azure Virtual Network TAP and AWS Traffic Mirroring provide similar capabilities.

bg right:30%


Enables fairly low-friction logging implementations!

bg right:30%


Sounds good! What's the problem?

bg right:30%


Resource intensive

Require many CPU cycles and lots of storage I/O operations to handle gigabits of traffic.

You'll also need quite a bit of disk space to store all that data.

bg right:30%


Prevalence of encryption

These days, most interesting network traffic is encrypted.

Interception boxes exist to decrypt, inspect and re-encrypt data streams.

These interceptors require tricky and risky configuration changes on all networked systems.

bg right:30%


Full network capture and storage is limited to highly sensitive environments with limited traffic.

bg right:30%


NIDS

Network Intrusion Detection System.

Look for suspicious network traffic using IoCs.

Functionality typically provided by enterprise-grade firewalls, dedicated appliances and open-source software (Snort, Suricata, Zeek/Bro IDS, etc.)

Doesn't require storage of traffic.

bg right:30%


IPS

Often extended to act as an Intrusion Prevention System.

Don't just detect attacks, block them.

Sounds great, but introduces some availability risks.

bg right:30%


Shared problems

Requires lots of computing resources.

Limited by wide-spread use of encryption.

bg right:30%


Mayhaps we don't need to store all traffic, but only metadata?

Let me introduce
Network flow logging.

bg right:30%


The basics

Limit collection and storage to information about network communication and not its content.

Many solutions define a flow as the same peers, protocol and (when applicable) port.

bg right:30%


Argus

Highly configurable open-source software.

Only requires a span/mirror/tap port and commodity hardware.

bg right:30%


NetFlow

Proprietary protocol developed by Cisco for traffic meta-data logging.

Typically implemented in hardware, resulting in low overhead.

Routers logging traffic (called "exporters") send flow information to a "collector" over the network.

May optionally use sampling to minimize transfer/processing/storage costs.

bg right:30%


IPFIX

Formally/Openly standardized by IETF as

Internet Protocol Flow Information eXport.

More or less the same as NetFlow.

If you wanna play with it but don't have an "enterprise-grade" switch, try softflowd.

bg right:30%


That's neat, but how is this useful?

bg right:30%


Operational benefits

Understand how systems really communicate with each other.

bg right:30%


Can we decommission this server or does anything still seem to be using it?

Is traffic really reaching the web server or is it blocked somewhere during the path?

Which database server was the application using during a performance incident?

bg right:30%


Security benefits

Detect and investigate suspicious traffic patterns.

bg right:30%


A laptop has been infected with malware, did it try to communicate with anything?

Has any device performed port scanning in our network?

Has any of our systems communicated with a known bad host?

bg right:30%


Conclusions

Complements host-based logging.

Makes more or less sense depending on your network architecture/security model.

bg right:30%


Remember that you may need permission to capture/log network traffic.

bg right:30%