Google PCA Designing for Security and Compliance Practice Question
A security engineer needs to allow a Compute Engine instance with the service account 'sa-prod@project.iam.gserviceaccount.com' to connect to a Cloud SQL instance over a private IP. The VPC has no firewall rules allowing this traffic. What is the MOST secure way to grant access?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Add a firewall rule with source service account 'sa-prod@project.iam.gserviceaccount.com' and target service account 'cloud-sql-sa@project.iam.gserviceaccount.com'
Firewall rules can target service accounts directly, allowing fine-grained access without relying on network tags. This avoids managing tags and reduces attack surface.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Add a firewall rule with source service account 'sa-prod@project.iam.gserviceaccount.com' and target service account 'cloud-sql-sa@project.iam.gserviceaccount.com'
Why this is correct
Using service accounts in firewall rules is the secure method, as it ties the rule directly to the identity of the instances.
- ✗
Grant the IAM role 'cloudsql.client' to the service account 'sa-prod@project.iam.gserviceaccount.com'
Why it's wrong here
IAM roles control API access, not network traffic. A firewall rule is still needed.
- ✗
Add a firewall rule with source tag 'prod' and target tag 'cloud-sql'
Why it's wrong here
Tags are less secure than service accounts; they can be misconfigured or applied to unintended instances.
- ✗
Create a VPC peering connection between the Compute Engine VPC and the Cloud SQL VPC
Why it's wrong here
VPC peering enables connectivity but does not replace the need for a firewall rule to allow the specific traffic.
Go deeper
Related to this question
Learn chapter
Introduction to Google Cloud Platform
Key term
Service account
A service account is a special type of account used by an application or a virtual machine, rather than a human user, to authenticate and interact with cloud services and APIs securely.
Key term
Compute Engine
Compute Engine is Google Cloud's Infrastructure-as-a-Service (IaaS) offering that lets you create and run virtual machines on Google's infrastructure.
About these practice questions
One of 955 original PCA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCA practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCA exam.