Skip to content

Firewall

A firewall is a network security device, either hardware or software, that inspects traffic crossing a boundary and permits or blocks it according to a defined rule set. It sits between zones of differing trust, most classically a corporate network and the public internet, and decides which connections are allowed to pass. Firewalls are among the oldest and most heavily relied on controls in network defense.

How does a firewall work?

Most firewalls read their rules from the top down and apply the first one that matches. Each rule names a source, a destination, a protocol and port, and an action. Anything that matches no rule falls through to the last one, which should block it. NIST SP 800-41 Rev. 1 puts the principle plainly: firewalls should generally block all inbound and outbound traffic that has not been expressly permitted by the firewall policy. That’s default deny, sometimes written as an implicit deny rule.

The main types build on one another:

Type Works at What it checks
Packet filter Network and transport layers (3 and 4) Header fields such as source, destination, and port, one packet at a time
Stateful inspection Layers 3 and 4, with a state table Whether each packet belongs to a connection the firewall already allowed
Circuit-level gateway Session layer (5) That the session handshake is legitimate, as with SOCKS
Application proxy Application layer (7) Full content of the session, terminated and re-created by the proxy
Next-generation firewall Layers 3 through 7 Applications and users, plus built-in intrusion prevention and threat intelligence

Packet filters are fast but stateless, so they can’t tell a genuine reply from a forged one. Stateful firewalls track active connections so responses are matched back to legitimate requests. Proxy firewalls inspect session content at the application layer, and next generation firewalls add intrusion prevention, application awareness, and threat intelligence. A web application firewall (WAF) is a specialized layer 7 control that sits in front of web apps and filters attacks like SQL injection.

What is the difference between a firewall and an IPS?

A firewall enforces policy. It decides whether a connection is allowed at all. An intrusion prevention system looks inside connections the firewall already permitted and blocks the ones that match attack signatures or anomalies. A firewall that allows HTTPS to the web server won’t stop an exploit sent over that HTTPS session. An IPS might. NGFWs blur the line by bundling both, which is why the exam tests the functions rather than the product label.

What is an example of firewall architecture?

The classic design is the screened subnet. Say an online retailer places its web servers in a DMZ between two firewalls. The outer firewall permits only TCP 443 from the internet to the web servers. The inner firewall permits only the web servers to reach the database on its one port, and blocks everything from the DMZ into the internal network. If an attacker compromises a web server, they’re still stuck behind the inner firewall. Egress rules matter too. A web server has no reason to start outbound connections to arbitrary hosts, so blocking that stops many reverse shells and data theft attempts.

A frequent real world problem is rule sprawl, where years of temporary allow rules accumulate and nobody is willing to remove them, quietly widening the attack surface over time. Shadowed rules that never match, any-any rules added during an outage, and rules with no named owner are the usual findings in a firewall review.

How are firewalls tested on the CISSP exam?

Firewalls sit in Domain 4: Communication and Network Security, which carries 13 percent of the exam. Objective 4.1 covers segmentation, including micro-segmentation with distributed firewalls, and the operational side sits in Domain 7 under objective 7.7, which names next generation, web application, and network firewalls. Expect questions on the firewall types, where each belongs in a defense in depth design, and supporting concepts like the DMZ, bastion host, and screened subnet.

Two traps come up often. One is matching a type to an OSI layer, so learn the table above. The other is treating the firewall as the answer to everything. A firewall can’t inspect encrypted content without TLS inspection, can’t stop an insider using an allowed path, and does nothing against a phishing email that arrives over permitted SMTP. When a question asks for the first step in a firewall project, the managerial answer is usually to define the policy before buying or configuring anything.

NIST offers deployment guidance in SP 800-41, Guidelines on Firewalls and Firewall Policy.

Related terms: DMZ (Demilitarized Zone), Threat Intelligence, Defense in Depth, Attack Surface, Egress Filtering, Proxy Server