Network access controls
A route is not permission
A cloud network access control decides whether traffic may cross a network boundary. A route selects a possible path; a firewall allows or denies a packet or flow. An application still needs its own authentication and authorization. For example, a bookstore API may be reachable on TCP port 443 but reject a request without a valid workload identity.
Use three fictional tiers: web 10.42.0.10, API 10.42.1.20, database 10.42.2.30. The web tier may call the API on TCP 443; the API may call the database on TCP 5432. The web tier must not call the database directly. These are offline requirements, not commands or deployed rules.
Stateful and stateless filtering
A stateful filter records permitted connections and can recognize response traffic. For a web-to-API connection, the web client might use source port 51000 and destination port 443. The response reverses these ports. A stateful rule that allows the connection normally admits its tracked reply without a separate reverse-direction allow rule in that same filter. Tracking can expire and has limits; it does not permit an unrelated connection in the opposite direction.
A stateless filter evaluates each packet independently. If an inbound rule admits destination TCP 443, the outbound reply needs an applicable allow rule for the client port range. Other filters, routes and host policies may still reject either direction.
Compare cloud controls by scope and precedence
AWS security groups attach to supported resource network interfaces and contain allow rules; multiple associated groups combine their allows. AWS network ACLs apply at subnet boundaries, are stateless and evaluate numbered rules in ascending order until a match. ACL rules can allow or deny.
Azure network security groups (NSGs) can filter at subnet and network-interface scope. Their stateful rules have numeric priorities, with lower numbers evaluated first. When both scopes apply, traffic must pass both. Changes to rules need not immediately terminate already tracked flows.
Google Cloud VPC firewall rules are stateful, scoped to a VPC with eligible targets such as network tags or service accounts. Rules have priorities; lower numbers win, and a deny wins over an allow at the same priority in the applicable VPC rule evaluation. Hierarchical and network firewall policies add evaluation stages; do not reduce the entire policy hierarchy to one flat list. Check the effective policy, not just one rule.
Trace an allow and a deny
Consider this simplified stateless API-subnet policy. Inbound rule 100 allows TCP 443 from 10.42.0.0/24; rule 200 denies other packets. Outbound rule 100 allows TCP destination ports 49152–65535 to 10.42.0.0/24; rule 200 denies other packets. Assume the synthetic client uses port 51000.
The web-to-API request matches inbound rule 100. Its response matches outbound rule 100. A client from 10.42.3.8 fails the inbound rule. If the outbound rule only allowed destination 443, the return to 51000 would fail. If a separate resource-level filter denies the new connection, the subnet allow is insufficient. Real client port ranges depend on OS and configuration; this fixture range is not a universal cloud rule.
Policy review without modifying a network
Write the intended flows as source, destination, protocol, destination port, initiation direction and identity. Check the effective route in each direction and every relevant filter. Inspect approved flow logs or synthetic records for accept/reject evidence; a log entry is not proof of application success. Test the desired connection and a disallowed connection. Keep a rollback plan, preserve management access and avoid blanket allow rules. IPv6 requires separate review where enabled.
Common mistake: using 0.0.0.0/0 for a database rule just because the database currently has no public IP. Other routes, peering or future changes can widen exposure. Restrict sources to the intended tier and keep service credentials narrowly scoped.
Practice and next step
Explain why web-to-API and API-to-database are allowed but web-to-database is denied. Trace a response to a client ephemeral port through both a stateful filter and a stateless ACL. Then learn how outbound NAT and private service endpoints change the network path. See the accompanying Network access controls reference and manual practice.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Network access controls — knowledge check
Choose the best answer for each offline scenario.
A client uses TCP source port 51000 and destination 443. What destination port does the reply have?
Which AWS control requires independent allow rules for reply packets?
An Azure subnet NSG allows a new flow, but the applicable NIC NSG denies it. What happens?
Two matching GCP VPC firewall rules have equal priority, one allow and one deny. Within this rule evaluation, which wins?
A network filter allows TCP 443 to a private API. What remains necessary?