Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Network Engineer practice bank has an additional 2,437 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your organization runs a two-tier application on Compute Engine VMs across two service projects (svc-app and svc-db) attached to a Shared VPC host project (host-vpc). All VMs reside in the same shared subnet and autoscale dynamically.
You must enforce identity-based micro-segmentation that meets the following requirements:
svc-app to reach database VMs in svc-db on TCP port 5432 without relying on IP addresses.roles/compute.instanceAdmin.v1) from altering a running VM's network identity to bypass firewall rules.How should you configure the IAM permissions and VPC firewall rules?
sa-app in svc-app and bind it to the application VM template, granting the application pipeline roles/iam.serviceAccountUser on sa-app. Apply a network tag db-tier to the database VMs in svc-db, and create an ingress VPC firewall rule in host-vpc allowing TCP port 5432 with source service account sa-app and target network tag db-tier.This approach attempts to combine an IAM-governed service account (sa-app) as the traffic source with a VPC network tag (db-tier) as the traffic target within a single ingress firewall rule. Network tags are arbitrary text strings attached to VM instances to group them for routing or basic firewall targeting.
roles/compute.instanceAdmin.v1) can add or remove network tags on a running VM at any time, allowing them to arbitrarily alter which firewall rules apply to an instance.db-tier lacks IAM binding controls, a rogue or misconfigured administrator in svc-app could attach the db-tier tag to a non-database VM and receive database-destined traffic.Instead of using a network tag for the database tier, the configuration used a dedicated service account (sa-db) or Resource Manager secure tags (targetSecureTags and sourceSecureTags), both of which enforce strict IAM governance.
When strict governance is required without migrating to Cloud NGFW secure tags, always use service accounts on both the source and target sides of the VPC firewall rule rather than mixing tags and identities.
sa-common service account and a tier-specific service account (sa-app or sa-db) to each VM in svc-app and svc-db, and grant roles/compute.instanceAdmin.v1 to the deployment pipelines so they can dynamically swap service accounts on running VMs. In host-vpc, create an ingress firewall rule allowing TCP port 5432 with source service account sa-app and target service account sa-db.This option proposes binding multiple service accounts to each VM simultaneously—one shared identity and one tier-specific identity—while relying solely on roles/compute.instanceAdmin.v1 to manage and hot-swap those identities on running VMs.
sa-common and sa-app (or sa-db) to the same VM.Service Account User permission: Having roles/compute.instanceAdmin.v1 alone does not authorize a pipeline or administrator to start or update a VM with a service account. The principal must explicitly hold roles/iam.serviceAccountUser (iam.serviceAccounts.actAs) on that service account.iam.serviceAccounts.actAs on the target service account.Only one dedicated service account was bound per VM template (sa-app or sa-db), pipelines were granted resource-scoped roles/iam.serviceAccountUser on their respective service accounts, and service account changes were performed via immutable template rollouts or stopped VMs.
If a multi-homed VM genuinely requires distinct network identities on separate network interfaces (vNICs) or runtime updates without rebooting, Cloud NGFW secure tags should be used instead of service accounts, as secure tags bind directly to individual vNICs.
svc-app and svc-db out of Shared VPC into separate standalone VPC networks connected via VPC Network Peering. Create sa-app in svc-app and sa-db in svc-db, grant scoped roles/iam.serviceAccountUser permissions, and create an ingress firewall rule in svc-db allowing TCP port 5432 with source service account sa-app and target service account sa-db.This design replaces Shared VPC with two standalone VPC networks—one in svc-app and one in svc-db—linked by VPC Network Peering, while attempting to authorize ingress traffic in svc-db based on a service account identity located in the peered svc-app project.
sa-app from svc-app inside a firewall rule belonging to svc-db results in a rule that is never enforced, breaking connectivity between tiers.| Architecture | Supported Service Account Scope in Firewall Rules |
|---|---|
| Standalone VPC | Same-project service accounts only |
| Shared VPC | Host project and any attached service project service accounts |
| VPC Network Peering | Does not enable cross-project service account firewall evaluation |
The two tiers remained in a Shared VPC topology (where cross-project service accounts are natively supported) or used organization-scoped secure tags in hierarchical or network firewall policies across peered VPCs.
A common misconception is that VPC Network Peering provides the same cross-project firewall capabilities as Shared VPC. In practice, only Shared VPC allows a single firewall rule to match source and target service accounts residing in different projects.
sa-app in svc-app and sa-db in svc-db, bind them to their respective VM instance templates, and grant each deployment pipeline roles/iam.serviceAccountUser scoped strictly to its designated service account. In host-vpc, create an ingress VPC firewall rule allowing TCP port 5432 with source service account sa-app and target service account sa-db.In Google Cloud, service accounts serve as cryptographically verifiable IAM identities bound directly to Compute Engine VM instances. Unlike IP addresses or arbitrary network tags, service accounts let you enforce identity-based micro-segmentation by authoring VPC firewall rules that evaluate the authenticated identity of both the source and target workloads.
host-vpc) can reference service accounts from the host project or any attached service project (svc-app and svc-db). Using sa-app as the source service account and sa-db as the target service account dynamically authorizes autoscaled VMs on TCP port 5432 without maintaining IP CIDR lists.roles/compute.instanceAdmin.v1 cannot attach or switch to a service account unless they also possess iam.serviceAccounts.actAs permission on that specific service account.roles/iam.serviceAccountUser) at the individual service account resource level ensures the application pipeline can only spin up VMs as sa-app, while the database pipeline can only use sa-db.iam.serviceAccounts.actAs authorization.svc-app and svc-db within a single centralized host-vpc firewall rule.Combining resource-scoped roles/iam.serviceAccountUser bindings with source and target service accounts in a Shared VPC host firewall rule establishes strict, tamper-resistant Layer 4 segmentation that aligns with least-privilege IAM principles.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated