Module 096 min

Boundaries

Every network that matters is divided, and every division is a rule. This is where a compromise stops being one compromised machine.

After this module
  • You can explain what NAT changes and what it does not protect, and why the server's log shows the wrong address.
  • You can tell a stateless rule from a stateful one, and predict which one breaks when routing is asymmetric.

A laptop is compromised by a phishing email. Nothing else is wrong: no server has been touched, no credential has been reused. Whether that incident becomes one laptop or an entire company is decided by the network's boundaries, and by whether they were ever configured with intent.

9.1NAT is translation, not protection

Your devices use private addresses that the internet does not route. Your router rewrites the source address — and, for most traffic, the source port — to its own public address, and remembers the mapping so replies can find their way back.

192.168.1.42:51544  →  203.0.113.9:41207  →  server:443
                     ←  state table matches  ←

Two consequences follow, and both bite in practice. First, inbound connections do not exist unless you add a rule: there is no path from outside to a private address. Second, the server sees 203.0.113.9, not your laptop — so any log, allowlist, rate limit or geolocation rule based on client address is really talking about the router.

The trap · "we're behind NAT, so we're protected"

NAT blocks unsolicited inbound connections as a side effect, and people mistake that for a firewall. It is not policy, it is arithmetic: there is no translation entry, so there is nowhere to send the packet. The moment you add a port forward, that protection is gone — and a port forward to a database is a database on the internet. Protection comes from an explicit default-deny policy, not from the absence of an address.

9.2Rules: order, state, and the implicit deny

A firewall rule set is read top to bottom, first match wins, and ends with a deny that is usually invisible. That single sentence explains most firewall bugs.

The two families, and the bug each produces.
Stateless (router ACL, cloud NACL)Stateful (firewall, security group)
Each packetEvaluated aloneMatched against a flow table
Return trafficNeeds its own ruleAllowed automatically
Classic bugOutbound replies blocked because ephemeral ports were not permittedAsymmetric routing means the reply never reaches the device holding the state
Where you meet itSubnet level, in the cloud and on routersHost, instance and zone level

The cloud version of this is worth memorising, because it is a weekly incident somewhere: security groups are stateful, network ACLs are not. A rule that permits 443 inbound and nothing outbound leaves the handshake half-complete, and the security group will look perfectly correct while it happens.

9.3Zones, and the point of dividing a network

A mature design writes policy between groups of things — users, servers, guests, management, industrial equipment — rather than between individual addresses. Written between hosts, policy becomes thousands of rules nobody can review; written between zones, it stays small enough to argue about.

THREE ZONES, THREE RULES users laptop phone guest application web · api · jobs load balancer data database backups 443 5432 denied · users never reach data directly
The rule that matters is the one not drawn: nothing in the users zone can open a database connection, so a phished laptop has nothing to pivot to.
Try it · allow, deny, or "it depends"four flows

9.4Zero trust, stated plainly

The older model was a castle: trusted inside, hostile outside, one wall. It stopped matching reality when people worked from home, services ran in three clouds, and the phished laptop was already inside the wall.

The replacement is not a product. It is a decision: authorize each request on evidence — who, which device, which service, what data — instead of on the address it came from. In practice that means identity for both ends of a connection, policy expressed per workload rather than per subnet, and logging that assumes the request might be hostile.

The honest caveat: this is significantly more work than a perimeter, and it depends on an inventory and an identity system that many organizations do not have. Segmentation with explicit inter-zone policy is the achievable version of the same idea, and it captures most of the benefit.

Check yourselfQuestion 1 of 1

A web server behind NAT logs every request from the same address. Why?

60-second recap

  • NAT translates. It hides your address and does not enforce policy.
  • Order and state decide. First match wins; stateful remembers, stateless does not.
  • Segmentation is the goal. VLANs without policy are tidiness, not security.