PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #63
You are managing an application that runs in Compute Engine. The application uses a custom HTTP server to expose an API that is accessed by other applications through an internal TCP/UDP load…
The correct answer is D. Enable VPC Flow Logs on the subnet. To log each IP address accessing an API through a Compute Engine instance using the fewest steps, enable VPC Flow Logs on the relevant subnet.
Question
Options
- AEnable Packet Mirroring on the VPC.
- BInstall the Ops Agent on the Compute Engine instances.
- CEnable logging on the firewall rule.
- DEnable VPC Flow Logs on the subnet.
How the community answered
(26 responses)- A4% (1)
- B4% (1)
- D92% (24)
Why each option
To log each IP address accessing an API through a Compute Engine instance using the fewest steps, enable VPC Flow Logs on the relevant subnet.
Packet Mirroring is for deep packet inspection and network forensics, which is a more complex and resource-intensive solution than simply logging IP addresses for access.
Installing the Ops Agent collects logs *from* the instance, but it's not the primary or most efficient way to capture network-level access IPs for a load-balanced service across all connections.
Enabling logging on the firewall rule only logs when a rule is hit or denied, providing less comprehensive flow information compared to VPC Flow Logs, which capture details for all traffic.
Enabling VPC Flow Logs on the subnet will capture metadata about all IP traffic flows, including source and destination IP addresses, that pass through the subnet's network interfaces. This directly fulfills the requirement to log each IP address accessing the API with minimal configuration changes.
Concept tested: Logging network traffic with VPC Flow Logs
Source: https://cloud.google.com/vpc/docs/flow-logs
Topics
Community Discussion
No community discussion yet for this question.