← Back to Security

6 Firewall Use Cases

Firewall policies for ports, addresses, applications, segmentation, and attack filtering.

SecurityFirewallNetwork Security

A firewall is a traffic policy engine. It sits on a host, network edge, or application boundary and decides which packets or sessions may continue. The useful question is not whether a firewall exists, but which decisions it is trusted to make and what blind spots remain.

1. Port-based rules

Port filtering is the simplest control. A rule can allow inbound HTTPS on port 443, block direct database access on port 5432, or limit SSH on port 22 to a management network.

This works because many protocols still use predictable transport ports. The weakness is that a port number says little about user intent. Traffic on port 443 might be normal web traffic or something malicious inside an encrypted tunnel, so port rules are a coarse boundary rather than a complete policy.

2. IP address filtering

IP-based filtering allows or blocks traffic by source or destination range. Teams use it for partner links, office VPN access, and coarse segmentation between internal networks.

It is useful, but a source address is not strong identity. Addresses change, shared cloud egress points can represent many tenants, and remote users rarely keep a stable IP. This control is best treated as one layer in an access model, not as the only gate.

3. Protocol-based rules

Some policies need to distinguish traffic by protocol rather than by port alone. A firewall may allow TCP for web traffic, restrict UDP to specific services, or block unnecessary ICMP types across a boundary.

This matters because protocols behave differently under loss, retransmission, and spoofing conditions. The operational risk is that blocking the wrong protocol can quietly break service discovery, path MTU discovery, or health checks. The result often looks like random instability rather than an obvious firewall problem.

4. Time-based rules

Time-based policies change according to a schedule. Teams use them for maintenance windows, contractor access, or after-hours restrictions on rarely used administrative systems.

They should be used narrowly. Attackers do not keep office hours, and incidents rarely start at convenient times. If a time schedule becomes a substitute for proper authentication or approval workflows, engineers usually end up adding permanent exceptions.

5. Stateful inspection

Stateful inspection tracks the lifecycle of connections instead of judging every packet in isolation. If an internal client starts a TCP session, the firewall records that state and permits the matching return traffic.

This is a major improvement over stateless filtering because most real traffic is conversational. It also creates a new bottleneck: the firewall must keep per-flow state. Under floods or poorly tuned timeouts, the state table itself can become the failure point.

6. Application-based rules

Application-aware firewalls inspect higher-layer details such as host headers, TLS metadata, user identity, or specific protocol commands. That allows policies like blocking file-sharing software, treating admin routes differently from public routes, or applying user-aware access decisions.

The benefit is precision. The cost is complexity, latency, and visibility limits created by encryption. Once traffic is end-to-end encrypted, the firewall may need reverse proxy placement, certificate visibility, or endpoint signals to keep enforcing fine-grained rules.

Good firewall design layers these controls instead of trusting any one of them to be sufficient. Start with simple boundaries, add state and application awareness where the risk justifies it, and review the failure modes before assuming the policy protects what you think it does.