An organization hosts a self-hosted Git repository server on an Amazon EC2 instance in Subnet B (). Developer workspaces run on Amazon EC2 instances in Subnet A (). A SysOps Administrator configures custom Network Access Control Lists (NACLs) to allow developers in Subnet A to clone repositories from Subnet B over SSH (TCP port ).
The custom NACL for Subnet A has the following rule configuration:
- Outbound Rule : Allow TCP port to destination
The custom NACL for Subnet B has the following rule configuration:
- Inbound Rule : Allow TCP port from source
- Outbound Rule : Allow TCP ports to destination
Developers report that they cannot connect to the Git repository server. Which rule addition will resolve this network connection issue?
- Add an inbound rule to Subnet A's NACL allowing TCP ports from source Answer
- BAdd an inbound rule to Subnet A's NACL allowing TCP port from source
- CAdd an outbound rule to Subnet A's NACL allowing TCP ports to destination
- DAdd an inbound rule to Subnet B's NACL allowing TCP ports from source
Answer
Add an inbound rule to Subnet A's NACL allowing TCP ports 1024-65535 from source 10.10.2.0/24
Because Network Access Control Lists (NACLs) are stateless, a rule must be explicitly created to allow return traffic. When a client in Subnet A establishes an SSH connection (TCP port 22) to a server in Subnet B, the client allocates an ephemeral port (typically in the range 1024-65535) for the source port of the connection. The server responds from its port 22 back to the client's ephemeral port. Therefore, Subnet A's NACL must allow inbound traffic on TCP ports 1024-65535 from the Subnet B source CIDR.
Step-by-Step Solution
Key Concept
Stateless Network Access Control Lists (NACLs) require explicit rules for both the request and the return traffic paths, including the allocation of client ephemeral ports.