Security · Lesson 02

How does a firewall decide what can pass?

A firewall applies a policy to traffic as it crosses a boundary. Understanding direction, service, source, destination, and connection state makes a block explainable instead of mysterious.

Policy at a boundary

A firewall filters traffic; it does not explain every failure.

A firewall can inspect traffic entering or leaving a host or network and compare it with rules. A rule may allow or deny a protocol, port, source, destination, direction, or connection state.

Filtering can happen on a device, a router, a cloud security group, or a service edge. A timeout may suggest silent dropping, but it is still evidence to compare with logs, captures, and tests from another location.

Ask where the decision was made.A blocked request can be filtered locally, at a gateway, or by the destination. The visible symptom alone does not identify the boundary.

Build the model

Four rule ingredients

01

Direction

Inbound and outbound traffic can follow different policies.

02

Endpoint

Source and destination addresses identify who is communicating.

03

Service

A protocol and port can describe the intended application.

04

State

Rules may treat new, established, and related traffic differently.

Evaluate the policy

Rule order and the default action shape the result.

Many firewalls evaluate rules from top to bottom and apply the first matching action. A broad allow rule placed above a specific deny can make the deny unreachable. A packet that matches no rule then follows the policy's default action, often deny or reject.

A least-privilege policy allows only the traffic needed for a stated purpose. Specific rules, a deliberate default, and decision logs make the boundary easier to review and troubleshoot.

“No matching rule” is still a decision.When a request fails, check both the matching rule and the default action rather than looking only for an explicit deny.

Track the conversation

Stateless filters packets; stateful filters sessions.

A stateless firewall evaluates each packet against its rules without remembering earlier packets. The policy must describe both directions explicitly, including the return traffic.

A stateful firewall records connection information such as addresses, ports, protocol, and state. After allowing a new outbound connection, it can recognize the matching return packets as established traffic. This is a policy decision backed by remembered session state, not an automatic guarantee that every related packet is safe.

State changes what the firewall knows.Stateless filtering asks “does this packet match?” Stateful filtering can also ask “does this packet belong to a permitted conversation?”

Mini investigation

Classify a firewall clue

Select the observed clue and identify the most direct next check.

DIAGNOSISPolicy match

A rule may explicitly deny this source, destination, protocol, or port.

Compare the traffic with the ordered rules and check the firewall decision log.

Knowledge check

Test your firewall model

Answer eleven questions. The answer order changes each time.

0 / 11