Firewall Architecture and Rules

Graduate Depth 51 in the knowledge graph I know this Set as goal
firewall packet-filtering stateful-inspection access-control

Core Idea

Firewalls filter traffic based on rules matching packet headers (stateless) or connection state (stateful), allowing or blocking flows to implement security policies. Stateless firewalls make decisions on individual packets; stateful firewalls track connection state and can make decisions based on the conversation history. Modern firewalls also perform deep packet inspection and application-layer filtering.

Explainer

From your study of network security fundamentals and IP routing, you know that packets traverse networks based on destination addresses and that security requires controlling which traffic is permitted between network segments. A firewall is the enforcement point for that control — it sits at a network boundary (typically between an internal network and the internet, or between security zones) and applies an ordered list of rules to every packet passing through it. Each rule specifies matching criteria (source/destination IP, port numbers, protocol) and an action (allow, deny, or log). Rules are evaluated top-to-bottom, and the first matching rule determines the packet's fate. A default rule at the bottom (usually "deny all") catches everything that no explicit rule matched.

A stateless packet filter evaluates each packet in isolation against the rule set. It examines header fields — source and destination IP addresses, source and destination ports, protocol type — and decides whether to forward or drop the packet. This is fast and simple but creates an awkward problem for return traffic. If you allow outbound HTTP connections (destination port 80), you must also explicitly allow inbound packets from port 80 — but this opens a hole that an attacker could exploit by crafting packets that appear to be HTTP responses but are actually unsolicited. A stateful firewall solves this by maintaining a connection table that tracks active sessions. When an internal host initiates a TCP connection, the firewall records the session (source IP, destination IP, source port, destination port, sequence numbers). Return packets are automatically permitted if they belong to an established session, and no explicit inbound rule is needed. This dramatically simplifies rule management and closes the return-traffic vulnerability.

Modern next-generation firewalls (NGFWs) go further with deep packet inspection — examining not just headers but the actual payload content. This allows application-layer filtering: the firewall can distinguish between HTTP traffic that is web browsing and HTTP traffic that is a file transfer or a tunneled SSH session, even though they use the same port. NGFWs can enforce policies like "allow web browsing but block file uploads" or "permit Zoom but block BitTorrent," which is impossible with header-only inspection. They often integrate intrusion prevention, URL filtering, and malware scanning into the same appliance.

Firewall rule design follows the principle of least privilege: permit only the traffic that is explicitly required and deny everything else. Rules should be ordered from most specific to most general, since the first match wins. A common architecture places the firewall between three zones — the internal network, the internet, and a DMZ (demilitarized zone) for public-facing servers. The DMZ can receive inbound connections from the internet (to reach web servers, for example) but cannot initiate connections to the internal network, limiting the damage if a DMZ server is compromised. Understanding rule ordering, stateful tracking, and zone-based architecture is essential for designing security policies that are both effective and maintainable.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsOperators and ExpressionsArithmetic Operators and Operator PrecedenceComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsCombinational Circuit DesignFlip-Flops and LatchesBinary Counters: Design and AnalysisBinary ArithmeticSubnetting and CIDR NotationIP Routing and ForwardingFirewall Architecture and Rules

Longest path: 52 steps · 221 total prerequisite topics

Prerequisites (2)

Leads To (0)

No topics depend on this one yet.