A data processing application is deployed on Amazon EC2 instances in a private subnet (Subnet A: ). The application must initiate outbound database queries to an Amazon RDS PostgreSQL DB instance in another private subnet (Subnet B: ) on port . The application must also download external software updates over HTTPS (port ) through a NAT Gateway located in a public subnet (Subnet C: ). Custom Network Access Control Lists (NACLs) are used to secure the subnets. Which configuration of NACL rules for Subnet A will allow the required traffic while following the principle of least privilege?
- AInbound: Allow traffic from Source on Port and from Source on Port . Outbound: Allow traffic to Destination on Port and to Destination on Port .
- Inbound: Allow traffic from Source on Port Range . Outbound: Allow traffic to Destination on Port and to Destination on Port .Cevap
- CInbound: No inbound rules are required because Security Groups are stateful and will automatically allow return traffic. Outbound: Allow traffic to Destination on Port and to Destination on Port .
- DInbound: No inbound rules are required. Outbound: Allow traffic to Destination on Port , and configure AWS WAF at the boundary of Subnet A to inspect and allow outbound HTTPS traffic and its associated return traffic.
Cevap
Inbound: Allow traffic from Source on Port Range . Outbound: Allow traffic to Destination on Port and to Destination on Port .
Network Access Control Lists (NACLs) are stateless network filters applied at the subnet boundary. Because they are stateless, both outbound request traffic and inbound response traffic must be explicitly permitted. When the EC2 instances in Subnet A initiate outbound connections to the database (port ) and the external update repository (port ), they select a random source port from the ephemeral port range (). The returning packets from these services will target these ephemeral ports on the EC2 instances. Therefore, the inbound NACL rules must allow return traffic from any source () targeting the ephemeral port range ().
Adım Adım Çözüm
Anahtar Kavram
Stateless behavior of Network Access Control Lists (NACLs) and ephemeral port configurations
Tahmini Süre:2m 0s