Securing AWS Network Architecture: VPCs, Subnets and Traffic Control
A conceptual design for isolating public entry points, private workloads, and data tiers while making traffic paths explicit.
In cloud environments, a network boundary is assembled from routes, subnet associations, security groups, network ACLs, endpoints, and service controls. A subnet named private is not private merely because of its name. Its effective exposure depends on routes and attached controls. Security engineering begins by drawing the expected traffic paths and checking that the configuration implements them.
This is a conceptual reference architecture for a small web application. It is not a deployed project or a universal AWS blueprint.
VPC and address planning
An Amazon Virtual Private Cloud (VPC) provides a logically isolated network with IPv4 and optionally IPv6 address ranges. Choose CIDR blocks that avoid overlap with connected networks, other VPCs, VPNs, and future environments. Overlap complicates routing and can block later peering or Transit Gateway connectivity. Reserve enough address space for multiple Availability Zones, scaling, and managed services that consume subnet addresses.
Divide a VPC into subnets, each associated with a route table. A subnet is considered public when its route table provides a path to an internet gateway and its resources have public addressing or an equivalent reachable path. Private subnets have no direct inbound internet route, though they may have controlled outbound paths. Labels alone enforce nothing.
Conceptual three-tier layout
Internet users
|
Internet Gateway
|
Public subnets (load balancer, across two AZs)
| app listener only
Private application subnets (application tasks)
| database port only
Isolated data subnets (database)
Private app subnet -- outbound updates --> NAT Gateway --> Internet Gateway
Application/data services -- AWS service APIs --> VPC endpoints where suitable
The load balancer accepts only the expected client protocol. Its security group references or otherwise permits traffic to the application security group on the application port. The application group permits traffic from the load balancer and allows only required database connections to the database group. The database has no public address and accepts its database port only from the application group. Exact services, ports, and routes depend on the workload.
Route tables determine where packets go. A public route table commonly includes 0.0.0.0/0 to an internet gateway. A private subnet that needs outbound internet access can route through a NAT gateway in a public subnet. NAT gateway connectivity allows private resources to initiate outbound connections; it does not create an unsolicited inbound path from the internet. NAT gateways are zonal resources, so designs should account for availability, cross-zone traffic, cost, and failover. VPC endpoints can provide private access to supported AWS services and reduce reliance on public egress routes.
Security groups and network ACLs
Security groups are stateful, virtual firewalls associated with network interfaces. They contain allow rules; return traffic for an allowed flow is automatically permitted. This makes them well suited to workload-level rules such as “application traffic from the load balancer group.” Referencing another security group can express an intended relationship more robustly than maintaining changing IP ranges.
Network ACLs operate at subnet boundaries and are stateless. They support allow and deny rules evaluated in rule-number order, and return traffic must be explicitly permitted. That means ephemeral ports and both directions must be considered. AWS contrasts these behaviors and describes the controls in its VPC security guidance. Use security groups as the primary workload control and ACLs as deliberate coarse subnet guardrails; duplicated complex rules can create hard-to-debug outages.
Network segmentation limits lateral movement. Separate public entry points, application workloads, databases, administration, and shared services according to trust and operational needs. Segmentation requires explicit permitted paths and observability. If every subnet can reach every other subnet, the diagram may imply separation that the routes and rules do not provide.
Central inspection and visibility
AWS Network Firewall can provide managed stateful and stateless inspection for VPC traffic. A centralized design can route selected traffic through inspection endpoints, but the route tables must force traffic through the intended path in both directions. Asymmetric routing, bypass routes, endpoint placement, and scaling behavior need careful design. Firewall inspection is not automatic simply because a firewall exists in the account. Pair preventive rules with VPC Flow Logs, load balancer logs, DNS logs where appropriate, and CloudTrail for control-plane changes.
Common misconfigurations
Common issues include 0.0.0.0/0 ingress on administrative ports, public database access, broad egress that undermines segmentation, public subnets without a clear purpose, missing IPv6 rules, stale security group references, and route changes that bypass inspection. Another error is assuming a network ACL blocks a path that a security group or alternate route still permits. Review IPv4 and IPv6 independently; an IPv4-only review can miss an exposed IPv6 route.
Recommendations and a lab approach
Begin with an application flow matrix: source, destination, protocol, purpose, and whether the flow is inbound, east-west, or outbound. Translate only required flows into routes and security group rules. Keep management access on a controlled path such as Systems Manager where suitable, rather than exposing SSH or RDP. Use infrastructure review and configuration monitoring to detect drift, and test reachability from the relevant subnets.
A safe lab can deploy a two-AZ VPC with a sample load balancer, private application instances, and a non-production database. Verify that the public endpoint works, direct internet access to the application instances fails, and the database accepts only the application path. This is a proposed exercise, not a report of completed deployment. Cost controls and cleanup matter because NAT gateways and other resources can continue to incur charges.
Conclusion
Secure VPC architecture is a set of explicit, testable traffic decisions. CIDR planning, subnet routes, security groups, ACLs, endpoints, and centralized inspection must agree. The network model also creates a foundation for Terraform controls: every route or permission should be reviewed as code before it becomes a live path.