CLOUD-NETWORK practice question 26 of 30

You created a new VPC for your development team. You want to allow access to the resources in this VPC via SSH only. How should you configure your firewall rules?

Full set: 233 questions
Answer options
A: Create two firewall rules: one to block all traffic with priority 0, and another to allow port 22 with priority 1000.
B: Create two firewall rules: one to block all traffic with priority 65536, and another to allow port 3389 with priority 1000.
C: Create a single firewall rule to allow port 22 with priority 1000. Correct answer
D: Create a single firewall rule to allow port 3389 with priority 1000.
Correct Answer:
C. Create a single firewall rule to allow port 22 with priority 1000.
Explanation

By default, every Google Cloud VPC network includes two implied firewall rules: an "allow all egress" rule and a "deny all ingress" rule, both at the lowest possible priority (65535). To allow only SSH traffic, you only need to create a single higher-priority ingress rule that allows traffic on TCP port 22. The implied deny rule will automatically block all other incoming traffic. A priority of 1000 is a standard, effective choice that overrides the default deny rule.

Why Incorrect

A. A block-all rule with priority 0 (the highest) would block all traffic, including the SSH traffic you intend to allow with the lower-priority rule.
B. Port 3389 is for Microsoft Remote Desktop Protocol (RDP), not SSH. Also, a priority of 65536 is an invalid value.
D. This rule would allow RDP traffic (port 3389), not the required SSH traffic (port 22).

References

1. Google Cloud Documentation

"VPC firewall rules". Section: "Implied rules". It states

"Every VPC network has two implied firewall rules... The implied deny ingress rule blocks all incoming connections."

2. Google Cloud Documentation

"Use VPC firewall rules". Section: "Firewall rule components". It describes how priority (an integer from 0 to 65535) determines the order of evaluation

with lower numbers indicating higher priority.

3. IETF RFC 4251

"The Secure Shell (SSH) Protocol Architecture"

Section 4.2. The standard assigned port for SSH is 22.

Scroll to Top