PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #89
You are configuring the networking of a Cloud SQL instance. The only application that connects to this database resides on a Compute Engine VM in the same project as the Cloud SQL instance. The VM…
The correct answer is D. Disable and remove the external IP address assignment. Removing the external IP address from the Cloud SQL instance ensures all traffic stays on the private VPC network, reducing the attack surface without breaking connectivity for a VM on the same VPC.
Question
You are configuring the networking of a Cloud SQL instance. The only application that connects to this database resides on a Compute Engine VM in the same project as the Cloud SQL instance. The VM and the Cloud SQL instance both use the same VPC network, and both have an external (public) IP address and an internal (private) IP address. You want to improve network security. What should you do?
Options
- ADisable and remove the internal IP address assignment.
- BDisable both the external IP address and the internal IP address, and instead rely on Private
- CSpecify an authorized network with the CIDR range of the VM.
- DDisable and remove the external IP address assignment.
How the community answered
(34 responses)- A6% (2)
- B3% (1)
- C15% (5)
- D76% (26)
Why each option
Removing the external IP address from the Cloud SQL instance ensures all traffic stays on the private VPC network, reducing the attack surface without breaking connectivity for a VM on the same VPC.
Removing the internal IP would break the private, secure connectivity between the VM and the Cloud SQL instance, which is the opposite of improving security.
Relying solely on Private Service Connect while disabling both IPs would break all connectivity unless Private Service Connect endpoints are explicitly configured, adding unnecessary complexity.
Specifying an authorized network with the VM's CIDR range still leaves the Cloud SQL instance reachable over the public internet, only restricting which public IPs can connect - it does not remove the external exposure.
When a VM and Cloud SQL instance share the same VPC network and both have private IP addresses, connectivity over the internal network is already possible. Removing the external IP from the Cloud SQL instance eliminates any exposure to the public internet, improving network security without affecting the application's ability to connect via the private IP.
Concept tested: Cloud SQL network security - disabling external IP
Source: https://cloud.google.com/sql/docs/mysql/configure-ip
Topics
Community Discussion
No community discussion yet for this question.