A cloud solution architect is configuring ingress firewall rules for a Google Cloud Virtual Private Cloud (VPC) network. An existing firewall rule allows SSH traffic (TCP port 22) from any source IP range (0.0.0.0/0) with a rule priority of 1000. The security team issues a new requirement to restrict SSH access so that only connections from the administrative CIDR range 192.168.10.0/24 are permitted, while all other SSH traffic from 0.0.0.0/0 must be blocked. Which firewall rule configuration correctly meets this requirement?
- Create a DENY rule for TCP port 22 from source 0.0.0.0/0 with priority 1000, and create an ALLOW rule for TCP port 22 from source 192.168.10.0/24 with priority 500.Answer
- BCreate a DENY rule for TCP port 22 from source 0.0.0.0/0 with priority 500, and create an ALLOW rule for TCP port 22 from source 192.168.10.0/24 with priority 1000.
- CAttach a conditional IAM policy at the VPC subnet level to revoke network viewer access from unauthorized external IP addresses.
- DAssign the primitive Owner role to the administrative subnet while removing all default egress routes for port 22.
Answer
Create a DENY rule for TCP port 22 from source 0.0.0.0/0 with priority 1000, and create an ALLOW rule for TCP port 22 from source 192.168.10.0/24 with priority 500.
In Google Cloud VPC networking, firewall rules are evaluated based on priority numbers ranging from 0 to 65535, where lower numbers have higher precedence. To allow traffic from a specific subnet (192.168.10.0/24) while blocking all other sources (0.0.0.0/0), the ALLOW rule must have a lower priority number (e.g., 500) than the DENY rule (e.g., 1000). Incoming SSH packets from 192.168.10.0/24 match the priority 500 ALLOW rule first and are accepted. All other incoming packets bypass the first rule and hit the priority 1000 DENY rule.
Step-by-Step Solution
Key Concept
VPC Firewall Rule Priority Precedence