Protego field desk
Security Logging and Monitoring · 18% of exam

L5. VPC Flow Logs, Traffic Mirroring & DNS Query Logging

Video generating

Check back soon for the video lesson on VPC Flow Logs, Traffic Mirroring & DNS Query Logging

Course outlineLesson 5 of 18
AWS Security Specialty Exam Prep: course overview

Know the difference between metadata-only network visibility (Flow Logs), full packet capture (Traffic Mirroring), and DNS-layer visibility (Resolver query logging) and when each is the right tool.

Flow Logs: Metadata, Not Payload

VPC Flow Logs capture IP traffic metadata at the VPC, subnet, or individual network interface (ENI) level. Each record includes the source and destination IP address and port, the protocol, the number of bytes transferred, and whether the traffic was ACCEPTed or REJECTed by a security group or network ACL. Flow logs can be published to CloudWatch Logs, S3, or Amazon Data Firehose depending on how you want to store or process them downstream.

The critical limitation to remember: Flow Logs never capture packet payload or contents. They tell you that traffic happened and its shape, not what was inside it.

Flow Logs are the go-to tool for detecting:

  • Port scanning, visible as one source probing many destination ports or many hosts on a port. Repeated rejects alone do not prove scanning.
  • Unexpected REJECTed traffic, which can indicate a misconfigured security group or an active probing attempt.
  • Unusual outbound (egress) volume, a common signal of data exfiltration from a compromised instance.

Traffic Mirroring: Packet Copies for Inspection

When you need to see inside the packet, metadata is not enough. Traffic Mirroring copies selected packet traffic from a source ENI to a target, such as another ENI or a Network Load Balancer, which typically feeds a third-party IDS/IPS appliance for deep packet inspection. Mirroring is passive: the target observes a copy and cannot block the original flow as an inline IPS would. Supported source ENIs and instance types are required. Filters and packet-length settings can limit the copy; encrypted payload remains encrypted.

Because Traffic Mirroring operates at the ENI level, you can scope it precisely: mirror only the instances you actually suspect are compromised, or select supported ENIs in a sensitive subnet, instead of paying the cost and complexity of mirroring every packet in the VPC. This selective scoping is a common exam theme when a scenario emphasizes minimizing overhead while still getting full visibility where it matters.

DNS-Layer Visibility

Route 53 Resolver query logging captures the DNS queries made from within a VPC. This is the AWS-native tool for spotting DNS tunneling, where an attacker encodes stolen data inside DNS queries to sneak it out past traditional network monitoring, as well as for detecting communication attempts with known-malicious domains. Resolver query logs omit queries answered from its cache; they are not a record of every DNS request. Flow Logs also exclude traffic to the Amazon DNS server and are best-effort, with possible skipped records.

Choosing the Right Tool

ToolCapturesBest for
VPC Flow LogsTraffic metadata only (IPs, ports, protocol, ACCEPT/REJECT, bytes)Port scan detection, egress volume anomalies, connection auditing
Traffic MirroringSelected packet copies; optional truncation, encryption retainedDeep packet inspection, IDS/IPS integration, malware signature matching
Route 53 Resolver query loggingDNS queries from inside the VPCDNS tunneling detection, malicious domain contact
Exam trap: Flow Logs alone can never detect a payload-level threat, such as a malware signature embedded inside a packet's data. Any scenario asking about inspecting packet contents, not just connection metadata, points to Traffic Mirroring feeding an inspection appliance, not Flow Logs.

References

Continue Learning

Exam Focus Points
  • ✓VPC Flow Logs capture traffic metadata (IPs, ports, protocol, ACCEPT/REJECT, byte counts) at the VPC, subnet, or ENI level, and can be sent to CloudWatch Logs, S3, or Amazon Data Firehose
  • ✓Flow Logs never capture packet payload; deep packet inspection requires Traffic Mirroring instead
  • ✓Traffic Mirroring copies selected packets from a supported source ENI to a target ENI or Network Load Balancer for inspection by a passive inspection appliance
  • ✓Route 53 Resolver query logging captures DNS queries inside a VPC, which is the primary AWS-native tool for detecting DNS tunneling and contact with known-malicious domains
  • ✓Look for a source probing multiple destination ports or hosts; rejected traffic alone can also reflect configuration mistakes
Knowledge Check

1. An analyst needs packet payload inspection on a supported EC2 source ENI. The relevant traffic is unencrypted or can be decrypted by the inspection tool. Which feature can send packet copies to that tool?

2. An instance uses the Amazon-provided Route 53 Resolver and may be exfiltrating data through DNS queries. Which log source provides query names, excluding cache-served requests?

3. Which of the following can be determined directly from a VPC Flow Log record?