Stateless and stateful firewalls
Two ways to filter traffic
A firewall enforces a traffic policy at a boundary. Stateless filtering evaluates each packet against rules without retaining connection history. Stateful filtering also uses tracked flow state. Neither type automatically proves that a user or application is trustworthy.
Follow a reply
Imagine a bookstore client opening a TCP connection to its web server on port 443. A stateless policy must account for both request and response directions. A stateful policy can permit a reply associated with an allowed tracked connection, subject to its rules. A new unrelated connection in the reverse direction is not the same thing as a reply.
Host and network enforcement
A host firewall protects a particular machine at its network boundary. A network firewall controls traffic crossing network boundaries. Both may be useful: the network policy can limit access to the application zone while the host policy limits access to the individual server. A cloud security group and a subnet ACL may have different state and evaluation semantics; AWS VPC security groups are stateful, whereas its network ACLs are stateless.
Limits of connection state
State is not permanent: real products use protocol-specific tracking and expiry. A stateful device may need to observe both directions, so an asymmetric route can affect its decisions. A permitted transport connection does not establish application authorization or TLS success. Do not equate an ACK flag with verified connection state.
Practice with three records
For a fictional policy, classify a permitted new client request, its tracked response, and an unrelated new reverse connection. Assume the model allows only the first two. Explain why the reverse direction alone is insufficient to identify a reply. Next: evaluate ordered rules.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Stateless and stateful firewalls — knowledge check
Reason about fictional firewall policy and verification.
What distinguishes stateful filtering?
An allowed tracked TCP reply and a new reverse connection arrive. What differs?
What does a stateless policy need for a two-way exchange?
Which AWS VPC comparison is correct?
A firewall permits TCP 443. What remains unproven?