Question

Difficulty: MediumDeploying Virtual Private Cloud (VPC) Networks, Subnets, and Firewall Rules

An infrastructure team wants to block all incoming SSH traffic (TCP port 22) to Compute Engine instances across a Virtual Private Cloud (VPC) network, while allowing SSH access strictly to instances assigned the network tag `bastion-host`. The team configures a VPC firewall rule with a priority of 1000 that denies ingress TCP port 22 for all instances in the network. Which configuration for a second firewall rule will successfully permit SSH traffic to only the tagged instances?

  1. Create an ALLOW ingress rule for TCP port 22 targeting the network tag `bastion-host` with a priority of 500.Answer
  2. B
    Create an ALLOW ingress rule for TCP port 22 targeting the network tag `bastion-host` with a priority of 2000.
  3. C
    Create an ALLOW egress rule for TCP port 22 targeting the network tag `bastion-host` with a priority of 500.
  4. D
    Grant the primitive Owner role to the instance service account so that incoming traffic bypasses network firewall rules.

Answer

Create an ALLOW ingress rule for TCP port 22 targeting the network tag 'bastion-host' with a priority of 500.
In Google Cloud VPC firewall evaluation, rules are processed according to numerical priority, where lower integer values take precedence. An ALLOW ingress rule set to priority 500 targeting instances with the 'bastion-host' tag will be evaluated before the broad DENY ingress rule set at priority 1000, allowing SSH access to the intended targets while blocking all others.

Step-by-Step Solution

1
Analyze Google Cloud VPC firewall rule priority evaluation order.
GCP evaluates rules in order of priority from 0 to 65535, where lower numerical values indicate higher precedence.
To override a broad DENY rule configured at priority 1000, a specific ALLOW rule must have a priority value strictly less than 1000 (such as 500).
2
Determine the direction and target parameters required for the rule.
The rule must be an INGRESS rule specifying TCP port 22 and target the network tag 'bastion-host'.
SSH access from external clients represents incoming network traffic directed at specific Compute Engine instances.

Key Concept

VPC Firewall Rule Priority and Target Tag Evaluation
Estimated Time:1m 30s
Rate this question