0Pricing
AWS Security Academy · Lesson

Spotting Suspicious Traffic in Flow Logs

Find port scans and data exfiltration hidden in the records.

Spotting Suspicious Traffic in Flow Logs is a free AWS Security Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

From Records to Threats

Reading individual records is the foundation; the real value is spotting patterns across many records that betray malicious activity. Attackers leave network footprints, and Flow Logs are where those footprints appear. This lesson covers the signatures security teams hunt for in the data.

Detecting Port Scans

A port scan shows up as one source address hitting many destination ports on a host in a short window, usually with many REJECT actions. This pattern reveals reconnaissance, where an attacker maps which services are open. Counting distinct destination ports per source is a reliable way to surface it.

Detecting Sweeps

A network sweep is the inverse: one source contacting the same port across many destination IPs, looking for any host running a target service. Seeing one srcaddr touch a whole subnet on port 22 or 445 is a classic sign of an attacker probing for a foothold to exploit.

Spotting Data Exfiltration

Exfiltration appears as unusually large outbound byte counts from an internal host to an external address, especially a new or foreign one. A web server that normally serves small responses suddenly uploading gigabytes is suspicious. Tracking top talkers by outbound bytes helps these stand out.

Connections to Known-Bad IPs

Cross-referencing destination addresses against threat-intelligence feeds of known malicious IPs flags communication with command-and-control servers. GuardDuty does this automatically, but you can replicate it in Athena queries by joining Flow Logs against an IP blocklist for custom detection.

Unexpected Protocols and Ports

Traffic on unusual ports or protocols for a workload's role is a warning. Outbound IRC, Tor, or cryptocurrency-mining pool ports from a server that should only serve HTTPS suggest compromise. Baselining what normal looks like for each tier makes these deviations obvious.

Lateral Movement

After breaching one host, attackers move sideways. Lateral movement shows as internal-to-internal connections that break normal patterns, such as an application server suddenly opening SSH or SMB sessions to many peers. East-west traffic that does not fit the architecture deserves scrutiny.

Querying with Athena

At scale you analyze Flow Logs in Athena over data in S3. SQL lets you group by source, count distinct ports, sum outbound bytes, and filter by action. A few well-crafted queries turn billions of records into a short list of the riskiest flows, far faster than manual review.

SELECT srcaddr, COUNT(DISTINCT dstport) AS ports
FROM vpc_flow_logs
WHERE action = 'REJECT'
GROUP BY srcaddr
HAVING COUNT(DISTINCT dstport) > 20

Real-Time Alerting

For speed, send Flow Logs to CloudWatch Logs and use metric filters and alarms on suspicious patterns, or stream via subscription filter to a Lambda detector. This converts after-the-fact hunting into near-real-time alerting, shrinking the attacker's window before someone responds.

Reducing False Positives

Not every anomaly is an attack. Scanners from your own security tooling, health checks, and backups create benign patterns. Tuning detections with allow-lists for known sources and baselines for normal volume keeps alerts trustworthy, so the real signal is not lost in noise.

Combining Tools

The strongest approach layers managed and custom detection: let GuardDuty flag known threats from Flow Logs automatically, use Athena for deep custom hunting, and keep CloudWatch alarms for your highest-priority patterns. Flow Logs are the shared evidence base that makes all three work.

Quick Check

Test your threat-hunting skills.

Recap

Hunt for patterns: port scans (one source, many ports, REJECTs), sweeps (one port, many hosts), exfiltration (large outbound bytes to new IPs), known-bad IP contact, and lateral movement (unusual east-west traffic). Use Athena for deep queries, CloudWatch alarms for real-time alerting, and GuardDuty for managed detection, tuning out benign noise.

Frequently asked questions

Is the “Spotting Suspicious Traffic in Flow Logs” lesson free?

Yes — the full text of “Spotting Suspicious Traffic in Flow Logs” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “Spotting Suspicious Traffic in Flow Logs”?

Find port scans and data exfiltration hidden in the records. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS Security Academy?

No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Spotting Suspicious Traffic in Flow Logs” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS Security Academy lesson?

Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What VPC Flow Logs Capture
  2. Reading Flow Log Records and Fields
  3. Flow Logs at VPC, Subnet, and ENI Levels
  4. Spotting Suspicious Traffic in Flow Logs
← Back to AWS Security Academy