Using VPC Flow Logs for Network Anomaly Detection
Short answer
C Enable VPC Flow Logs on the subnet to capture network flow metadata for identifying anomalies across internal, internet, and Google Cloud traffic.
Question
traffic between end locations on the internet and VMs, and traffic between VMs to Google Cloud services in production. Which method should you use?
Key Takeaways
The trap is confusing deep packet inspection (Packet Mirroring) with flow-level metadata analysis (VPC Flow Logs). For general anomaly detection, metadata is sufficient and more scalable.
This PCSE question explores how to detect network anomalies across VPCs using VPC Flow Logs versus Packet Mirroring. The correct answer is C, as Flow Logs provide essential metadata for identifying suspicious traffic patterns efficiently.
Common mistake: Candidates often choose B (Packet Mirroring) believing that 'anomalies' require payload inspection. However, Flow Logs are designed for monitoring and detecting anomalous traffic patterns based on headers and counters, which is the primary goal here.
Expert Analysis
The question asks for a method to identify all network anomalies across various traffic types (internal, internet, and Google Cloud services) within and across VPCs. The key distinction lies between VPC Flow Logs and Packet Mirroring.
VPC Flow Logs (Option C) provide metadata about IP traffic going through network interfaces in your VPC. They capture information such as source/destination IPs, ports, protocol, and bytes/packets count. This data is sufficient for identifying anomalies like unusual traffic volumes, unexpected connections, or port scanning activities without capturing the actual packet payload. Since the requirement is to "identify" anomalies rather than perform deep packet inspection for specific attack signatures, Flow Logs are the standard, scalable solution. They cover internal VM-to-VM, internet-to-VM, and VM-to-Google service traffic seamlessly at the subnet or VPC level.
Packet Mirroring (Option B) copies full network packets (headers and payload) to a security appliance or analysis tool. While powerful for deep inspection, it is resource-intensive, limited to specific VM instances or routes, and often requires additional infrastructure (like a mirror target). Comments suggesting Packet Mirroring argue that it catches "all" anomalies by inspecting payloads, but this is an over-engineered approach for general anomaly identification and doesn't scale well across all VPC traffic as easily as Flow Logs. Furthermore, comments noting limitations of Packet Mirroring regarding cross-VPC or broad coverage align with the practicality of Flow Logs.
Therefore, VPC Flow Logs are the correct choice because they provide comprehensive visibility into network flows for security analysis and anomaly detection without the overhead and complexity of mirroring every packet.
Official Reference
https://cloud.google.com/vpc/docs/flow-logs
This link opens the official vendor documentation in a new tab.
Exam Strategy
When a question asks for 'monitoring', 'logging', or 'identifying anomalies' in a cloud networking context, prioritize log-based solutions (like Flow Logs or Cloud Logging) over real-time packet inspection tools (like Packet Mirroring) unless deep packet inspection is explicitly required. Log-based solutions are typically more scalable and cost-effective for broad visibility.
Frequently Asked Questions
Why not use Packet Mirroring for anomaly detection?
What kind of data do VPC Flow Logs collect?
Community Votes
56% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 15 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 15
-
Tabayashi 👍 13I think the answer is (C). VPC Flow Logs samples each VM's TCP, UDP, ICMP, ESP, and GRE flows. Both inbound and outbound flows are sampled. These flows can be between the VM and another VM, a host in your on-premises data center, a Google service, or a host on the internet. https://cloud.google.com/vpc/docs/flow-logs
-
hybridpro 👍 8B should be the answer. For detecting network anomalies, you need to have payload and header data as well to be effective. Besides C is saying to enable VPC flow logs on a subnet which won't serve our purpose either.
-
AwesomeGCP 👍 5 Answered BB. Configure packet mirroring policies.
-
tifo16 👍 3https://cloud.google.com/vpc/docs/packet-mirroring#enterprise_security Security and network engineering teams must ensure that they are catching all anomalies and threats that might indicate security breaches and intrusions. They mirror all traffic so that they can complete a comprehensive inspection of suspicious flows. Because attacks can span multiple packets, security teams must be able to get all packets for each flow.
-
hcnh 👍 3 Answered CC is the answer as B has the limitation against question The mirroring happens on the virtual machine (VM) instances, not on the network. Consequently, Packet Mirroring consumes additional bandwidth on the VMs.
Show 10 more comments
-
mikesp 👍 3 Answered CVPC Flow Logs also helps you perform network forensics when investigating suspicious behavior such as traffic from access from abnormal sources or unexpected volumes of data migration
-
GHOST1985 👍 2 Answered B100% Answer B: Anomalies means packet miroiring https://cloud.google.com/vpc/docs/packet-mirroring#enterprise_security "Packet Mirroring is useful when you need to monitor and analyze your security status. It exports all traffic, not only the traffic between sampling periods. For example, you can use security software that analyzes mirrored traffic to detect all threats or anomalies. Additionally, you can inspect the full traffic flow to detect application performance issues. For more information, see the example use cases." https://cloud.google.com/vpc/docs/packet-mirroring
-
Rightsaidfred 👍 2As it is a close tie and ambiguity between B&C, I would say it is C - VPC Flow Logs in this instance, as Question 121 is focusing more on Packet Mirroring with the IDS Use Case.
-
tifo16 👍 2Should be B
-
dija123 👍 1 Answered BBacket mirroring policies allow you to mirror all traffic passing through a specific network interface or VPC route to a designated destination (e.g., another VM, a Cloud Storage bucket). This captured traffic can then be analyzed by security and network engineers using tools like Suricata or Security Command Center for advanced anomaly detection. This approach provides the necessary level of detail and flexibility for identifying anomalies across all the mentioned traffic types
-
sebG35 👍 1The answer is C. The needs is identify all network anomalies within and across VPCs, internal traffic from VMs to VMs ... B- Does not meet all needs. It is limited to the VM and don't cover the needs : across VPCs https://cloud.google.com/vpc/docs/packet-mirroring?hl=en C- Cover all needs https://cloud.google.com/vpc/docs/flow-logs?hl=en
-
tangac 👍 1 Answered CFirst you can use VPC flow log at a subnet level : https://cloud.google.com/vpc/docs/using-flow-logs Then VPC Flow Log main feature is to collect logs that can be used for network monitoring, forensics, real-time security analysis, and expense optimization.
-
irmingard_examtopics 👍 1 Answered CB is overkill, no need for play load inspection here. Question should either say there is only one subnet or C should say the enable on all subnets.
-
b6f53d8 👍 1C is only for subnet, and we need control in many VPCs, so I prefer B
-
jvkubjg 👍 1 Answered BAnomalies -> Packet Mirroring
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.