The correct answer is to create a new ingress firewall rule allowing tcp:22 from 0.0.0.0/0 to instances with the tag 'ssh-access' at priority 1000. This works because Google Cloud VPC firewall rules use target tags to apply rules at the instance level, so the rule only permits SSH to VMs carrying the specified tag, leaving the default-allow-ssh rule intact for untagged instances. On the Google Professional Cloud Security Engineer exam, this scenario tests your understanding of how to scope ingress rules using tags rather than service accounts or IP ranges, with a common trap being the mistaken use of a deny rule or applying the rule to all instances. A key memory tip is to remember that tags act as a selective filter: the rule targets the tag, not the instance, so only tagged VMs inherit the permission.
PCSE Configuring network security Practice Question
This PCSE practice question tests your understanding of configuring 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.
Exhibit
Refer to the exhibit.
gcloud compute firewall-rules list --format="table(name, network, sourceRanges, allowed, direction, priority)"
NAME NETWORK SOURCE_RANGES ALLOWED DIRECTION PRIORITY
default-allow-http default 0.0.0.0/0 tcp:80 INGRESS 1000
default-allow-https default 0.0.0.0/0 tcp:443 INGRESS 1000
default-allow-icmp default 0.0.0.0/0 icmp INGRESS 65534
default-allow-rdp default 0.0.0.0/0 tcp:3389 INGRESS 65534
default-allow-ssh default 0.0.0.0/0 tcp:22 INGRESS 65534
default-deny-all-ingress default 0.0.0.0/0 all INGRESS [IMPLIED]
Refer to the exhibit. An engineer wants to allow inbound SSH (tcp:22) to a VM with network tag 'ssh-access' in the 'default' VPC. Which firewall rule should they create?
Refer to the exhibit.
gcloud compute firewall-rules list --format="table(name, network, sourceRanges, allowed, direction, priority)"
NAME NETWORK SOURCE_RANGES ALLOWED DIRECTION PRIORITY
default-allow-http default 0.0.0.0/0 tcp:80 INGRESS 1000
default-allow-https default 0.0.0.0/0 tcp:443 INGRESS 1000
default-allow-icmp default 0.0.0.0/0 icmp INGRESS 65534
default-allow-rdp default 0.0.0.0/0 tcp:3389 INGRESS 65534
default-allow-ssh default 0.0.0.0/0 tcp:22 INGRESS 65534
default-deny-all-ingress default 0.0.0.0/0 all INGRESS [IMPLIED]
A
Remove the 'default-allow-ssh' rule and create a new rule with no target tags.
Why wrong: Incorrect: removing default rule would block all SSH; a rule without target tags applies to all instances again.
B
Create a new ingress rule allowing tcp:22 from 0.0.0.0/0 to instances with tag 'ssh-access' with priority 1000.
Correct: higher priority rule overrides the lower-priority default allow, ensuring only tagged instances receive SSH.
C
Create a new egress rule allowing tcp:22 from instances with tag 'ssh-access' to 0.0.0.0/0.
Why wrong: Incorrect: egress rule does not control inbound SSH connections.
D
Modify the existing 'default-allow-ssh' rule to add a target tag 'ssh-access'.
Why wrong: Incorrect: modifying the rule would apply to all instances regardless of tag because priority is lower than implied deny? Actually modifying to target tags would work but the existing rule priority 65534 is low; a new rule with priority 1000 would override. But option A says modify existing, which would change its behavior but still allow all? Actually adding target tag would restrict that rule to those tags, but then instances without tag would rely on implied deny blocking SSH. However, the existing rule 'default-allow-ssh' is default allow from all to all. If you modify it to target tags only, it becomes more restrictive, which is also valid. But the question implies best practice? The exhibit shows high priority rules for http and https. The best practice is to create a new rule with priority 1000. Option A is plausible but not the best because modifying the default low-priority rule might still allow SSH to other instances if another rule allows? Actually after modification, only tagged instances get SSH. But to maintain or not? Option B is clearer.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create a new ingress rule allowing tcp:22 from 0.0.0.0/0 to instances with tag 'ssh-access' with priority 1000.
Option B is correct because it creates a new ingress firewall rule that explicitly allows inbound TCP port 22 traffic from any source (0.0.0.0/0) only to VM instances that have the network tag 'ssh-access'. In Google Cloud VPC, firewall rules are stateful and apply at the instance level based on target tags; a priority of 1000 ensures this rule is evaluated appropriately relative to higher-priority (lower number) deny rules. This approach preserves the default-allow-ssh rule for other instances while granting SSH access specifically to tagged VMs.
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.
✗
Remove the 'default-allow-ssh' rule and create a new rule with no target tags.
Why it's wrong here
Incorrect: removing default rule would block all SSH; a rule without target tags applies to all instances again.
✓
Create a new ingress rule allowing tcp:22 from 0.0.0.0/0 to instances with tag 'ssh-access' with priority 1000.
Why this is correct
Correct: higher priority rule overrides the lower-priority default allow, ensuring only tagged instances receive SSH.
Related concept
Read the scenario before looking for a memorised answer.
✗
Create a new egress rule allowing tcp:22 from instances with tag 'ssh-access' to 0.0.0.0/0.
Why it's wrong here
Incorrect: egress rule does not control inbound SSH connections.
✗
Modify the existing 'default-allow-ssh' rule to add a target tag 'ssh-access'.
Why it's wrong here
Incorrect: modifying the rule would apply to all instances regardless of tag because priority is lower than implied deny? Actually modifying to target tags would work but the existing rule priority 65534 is low; a new rule with priority 1000 would override. But option A says modify existing, which would change its behavior but still allow all? Actually adding target tag would restrict that rule to those tags, but then instances without tag would rely on implied deny blocking SSH. However, the existing rule 'default-allow-ssh' is default allow from all to all. If you modify it to target tags only, it becomes more restrictive, which is also valid. But the question implies best practice? The exhibit shows high priority rules for http and https. The best practice is to create a new rule with priority 1000. Option A is plausible but not the best because modifying the default low-priority rule might still allow SSH to other instances if another rule allows? Actually after modification, only tagged instances get SSH. But to maintain or not? Option B is clearer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Google Cloud often tests the distinction between ingress and egress rules, and the trap here is that candidates may mistakenly choose an egress rule (Option C) thinking it controls incoming SSH traffic, or they may incorrectly assume that modifying the default rule (Option D) is the simplest approach without considering the impact on untagged instances.
Trap categories for this question
Command / output trap
Incorrect: modifying the rule would apply to all instances regardless of tag because priority is lower than implied deny? Actually modifying to target tags would work but the existing rule priority 65534 is low; a new rule with priority 1000 would override. But option A says modify existing, which would change its behavior but still allow all? Actually adding target tag would restrict that rule to those tags, but then instances without tag would rely on implied deny blocking SSH. However, the existing rule 'default-allow-ssh' is default allow from all to all. If you modify it to target tags only, it becomes more restrictive, which is also valid. But the question implies best practice? The exhibit shows high priority rules for http and https. The best practice is to create a new rule with priority 1000. Option A is plausible but not the best because modifying the default low-priority rule might still allow SSH to other instances if another rule allows? Actually after modification, only tagged instances get SSH. But to maintain or not? Option B is clearer.
Detailed technical explanation
How to think about this question
Google Cloud VPC firewall rules are stateful, meaning that if an ingress rule allows a connection, the corresponding egress reply traffic is automatically allowed without needing a separate egress rule. The priority field (0–65535) determines rule evaluation order, with lower numbers having higher precedence; a priority of 1000 is a common default for custom rules, but if a higher-priority deny rule exists (e.g., priority 500), it could override this allow rule. In practice, network tags are a flexible way to apply firewall rules to specific VM instances without using IP ranges, which is especially useful in dynamic environments where instance IPs change.
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.
Configuring network security — This question tests Configuring network security — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Create a new ingress rule allowing tcp:22 from 0.0.0.0/0 to instances with tag 'ssh-access' with priority 1000. — Option B is correct because it creates a new ingress firewall rule that explicitly allows inbound TCP port 22 traffic from any source (0.0.0.0/0) only to VM instances that have the network tag 'ssh-access'. In Google Cloud VPC, firewall rules are stateful and apply at the instance level based on target tags; a priority of 1000 ensures this rule is evaluated appropriately relative to higher-priority (lower number) deny rules. This approach preserves the default-allow-ssh rule for other instances while granting SSH access specifically to tagged VMs.
What should I do if I get this PCSE 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 →
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.
This PCSE 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 PCSE exam.
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.
Sign in to join the discussion.