Security groups, ACLs and reachability
Routing is not authorization
A security group controls traffic for associated network interfaces; a network ACL controls traffic crossing a subnet boundary. A route answers where traffic should go, not whether it is allowed. A listening application, its host firewall, DNS, TLS and application authorization can also affect the result. In the bookstore, only the web tier should initiate traffic to the application port. No actual network traffic is generated in this lesson.
Stateful security groups
Security groups contain allow rules, not explicit deny rules. Multiple groups attached to an interface combine their allowances. For a tracked connection permitted by the relevant rules, response traffic is permitted automatically. Configure the app group to allow TCP destination port 8443 from the web group; configure the web group to allow the corresponding outbound traffic. A reference to a group identifies eligible private interfaces, not the other group’s rules. Do not open management or application ports to every source as a troubleshooting shortcut.
web-sg outbound TCP 8443 -> app-sgapp-sg inbound TCP 8443 <- web-sgStateless ACL rules
An ACL evaluates numbered rules in ascending order, separately for each direction; the first matching rule decides allow or deny. If none matches, traffic is denied. A stateless ACL needs permission for both the request and its return. Consider a web client at 10.42.1.10:51000 connecting to 10.42.11.20:8443. At the application subnet boundary, inbound TCP destination port 8443 from the web subnet must be allowed, and outbound TCP destination port 51000 toward the web subnet must be allowed. The web subnet ACL also needs the matching outbound request and inbound response. In production, use the actual client ephemeral-port range, not a single fixture port.
request: 10.42.1.10:51000 -> 10.42.11.20:8443reply: 10.42.11.20:8443 -> 10.42.1.10:51000Read rule order and diagnose
Suppose the app subnet inbound ACL denies TCP 8443 from 10.42.1.10/32 at rule 90 and allows the web subnet on the same port at rule 100. That specific client is denied even though rule 100 allows its subnet. Reversing the rule numbers changes the result. Security groups have no equivalent numbered deny ordering. If the request is permitted but responses time out, inspect the return route and ACL destination ephemeral port before changing policies.
90 DENY TCP 8443 10.42.1.10/32100 ALLOW TCP 8443 10.42.1.0/24* DENY remaining trafficInvestigate one layer at a time
Check the destination name and IP family, address assignment, subnet route and target, both directions of subnet ACLs, source and destination security groups, host listening port and application access. A successful network path does not grant an IAM action such as S3 GetObject. Conversely, a valid IAM role cannot repair a missing route. Security groups and ACLs do not filter every AWS-managed traffic type; for example, the Amazon-provided DNS resolver has special filtering constraints. For DNS filtering use the appropriate resolver controls, not arbitrary ACL changes. Flow logs can help investigate but do not capture every packet or prove application health.
Practice: a minimal allow matrix
On paper, permit web-to-app TCP 8443 and reject unrelated clients. Trace the allowed request and response and identify which controls need each rule. Change only the modeled app outbound ACL to deny the response; explain why an allowed security group does not override it. The offline fixture models simple TCP decisions only, excluding connection-tracking exceptions, DNS, NAT and actual AWS rule evaluation. Next chapter: DNS, HTTP, TLS and edge delivery.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Security groups, ACLs and reachability — knowledge check
Apply the lesson concepts to the fictional VPC.
What does stateful security group behavior mean for a permitted tracked connection?
A TCP client uses port 51000 to reach app port 8443. Which app-subnet ACL rule is needed for the reply?
ACL rule 90 denies a host and rule 100 allows its subnet on the same port. What happens to that host’s matching request?
The network path to S3 works but the API denies GetObject. What is a relevant next check?
An application times out after a security group allows the request. What is a useful next step?