Question 391 of 497
Implementing network securitymediumMultiple ChoiceObjective-mapped

Quick Answer

The answer is to modify the VPC firewall rule to deny ingress traffic on TCP port 22 from all sources except the IAP IP range (35.235.240.0/20). This is correct because IAP TCP forwarding relies on this specific source range to proxy SSH connections, and without a firewall rule explicitly restricting port 22 to only that range, any internal VM in the same VPC can bypass IAP and connect directly via SSH. On the Google Professional Cloud Network Engineer exam, this scenario tests your understanding that IAP does not inherently block internal VPC traffic—you must enforce the restriction at the firewall level. A common trap is assuming IAP alone secures all access, but the key is that IAP acts as a tunnel, not a firewall. Remember the memory tip: “IAP’s IP is the only key to port 22’s door.”

PCNE Implementing network security Practice Question

This PCNE practice question tests your understanding of implementing network security. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company uses Identity-Aware Proxy (IAP) to secure access to a group of Compute Engine instances running a web application. The instances have no external IP addresses and are accessed via IAP TCP forwarding. Recently, the security team discovered that some users can access the instances directly via SSH from other instances within the same VPC, bypassing IAP. What is the most effective way to ensure all SSH access goes through IAP?

Question 1mediummultiple choice
Full question →

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

Modify the VPC firewall rule to deny ingress traffic on TCP port 22 from all sources except the IAP IP range (35.235.240.0/20).

Option A is correct because the IAP TCP forwarding source IP range (35.235.240.0/20) is the only range that should be allowed to initiate SSH connections to the instances. By modifying the VPC firewall rule to deny all other sources on TCP port 22, you ensure that any SSH traffic not originating from the IAP IP range is blocked, even from other instances within the same VPC. This directly addresses the bypass scenario where users SSH from other internal instances.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Modify the VPC firewall rule to deny ingress traffic on TCP port 22 from all sources except the IAP IP range (35.235.240.0/20).

    Why this is correct

    This ensures only IAP can initiate SSH connections.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Assign a service account to each instance with the IAP-secured Tunnel User role.

    Why it's wrong here

    The IAP-secured Tunnel User role is granted to users, not instances.

  • Remove SSH keys from the instances and use OS Login.

    Why it's wrong here

    OS Login still allows SSH access from within the VPC if firewall rules permit.

  • Create a new firewall rule that allows SSH only from the IAP IP range and delete the existing SSH rule.

    Why it's wrong here

    Deleting the existing rule is not necessary; modifying it or adding a higher-priority deny rule is sufficient.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the misconception that IAP alone enforces access control, when in reality it relies on VPC firewall rules to restrict traffic to only the IAP source IP range; candidates may incorrectly choose options that change authentication (OS Login) or authorization (service account roles) instead of addressing the network path.

Detailed technical explanation

How to think about this question

IAP TCP forwarding works by establishing a tunnel from the user's device to the IAP service, which then forwards traffic to the instance using the source IP 35.235.240.0/20. The VPC firewall rule must explicitly allow this range on TCP port 22, while denying all other sources. Without a deny-all rule for internal sources, any instance in the same VPC can reach the target instance's internal IP on port 22, completely bypassing IAP's authentication and authorization checks. This is a common misconfiguration where administrators assume IAP is enforced by default, but it is purely network-based and requires firewall rules to enforce the path.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PCNE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PCNE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PCNE question test?

Implementing network security — This question tests Implementing network security — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Modify the VPC firewall rule to deny ingress traffic on TCP port 22 from all sources except the IAP IP range (35.235.240.0/20). — Option A is correct because the IAP TCP forwarding source IP range (35.235.240.0/20) is the only range that should be allowed to initiate SSH connections to the instances. By modifying the VPC firewall rule to deny all other sources on TCP port 22, you ensure that any SSH traffic not originating from the IAP IP range is blocked, even from other instances within the same VPC. This directly addresses the bypass scenario where users SSH from other internal instances.

What should I do if I get this PCNE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on PCNE

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A security engineer wants to allow SSH access to a VM that has no external IP. The VM is in a VPC with IAP configured. What is the simplest way to enable secure SSH without a bastion host?

easy
  • A.Use Identity-Aware Proxy (IAP) TCP forwarding with the gcloud compute start-iap-tunnel command.
  • B.Create a VPN tunnel to the VPC and SSH over the VPN.
  • C.Configure a SOCKS proxy on a bastion host.
  • D.Assign an external IP to the VM and use a firewall rule to restrict access.

Why A: Identity-Aware Proxy (IAP) TCP forwarding allows secure SSH access to a VM without an external IP by tunneling traffic through the IAP service. The `gcloud compute start-iap-tunnel` command establishes an encrypted tunnel from your local machine to the VM via the IAP proxy, using the VM's internal IP and port 22. This eliminates the need for a bastion host or public IP while leveraging IAP's identity-based access controls.

Variation 2. A company uses Identity-Aware Proxy (IAP) to secure access to Compute Engine VMs. Users report that they can SSH into some VMs but not others, even though they have the IAP-secured Tunnel User role. Both VMs are in the same project and have the same network tags. What is the most likely reason?

medium
  • A.Firewall rules allow ingress from IAP's IP ranges only for some VMs.
  • B.The VMs are in different zones with different DNS resolution.
  • C.The VMs that can be accessed have external IP addresses; the others only have internal IP addresses.
  • D.The VMs do not have OS Login enabled.

Why C: Option C is correct because IAP for TCP forwarding requires the target VM to have an external IP address (or be accessible via a Cloud NAT with specific routing) for the IAP service to establish the tunnel. Without an external IP, the IAP tunnel cannot reach the VM, even if the user has the IAP-secured Tunnel User role and the firewall rules allow ingress from IAP's IP ranges (35.235.240.0/20).

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCNE 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 PCNE exam.