Topics in this domain

Firewalls

Network and platform security · 4 min read

The security desk

An office security desk checks everyone coming in. A basic one just checks you’re heading for a floor that exists. A better one remembers who signed in, so only their visitors are let back out. The best one opens your bag and reads your paperwork.

A firewall enforces a security policy on traffic between networks or zones: it allows what’s permitted and blocks the rest. It’s a key boundary control, but only one layer of defence.

Types

Firewall types differ in how far up the network stack they look. The diagram shows them from the simplest at the bottom, packet filters that check only addresses and ports, to web application firewalls at the top that understand application attacks. The higher a firewall looks, the more it understands, and the slower it tends to be.

Firewall types from packet filter to web application firewall.
TypeOpen Systems Interconnection (OSI) layerWhat it does
Packet filtering3-4Checks each packet’s addresses, port and protocol against rules. Fast and simple, but has no memory and can’t see content; vulnerable to spoofing
Stateful inspection3-4Keeps a table of connections, so replies are allowed only for sessions that were legitimately started
Circuit-level gateway5Checks the session handshake, then relays traffic without inspecting it
Application-level gateway (proxy)7Ends the connection and inspects the actual application content. The most secure traditional type, but slower, and needs a proxy per application
Next-generation firewall (NGFW)3-7Stateful inspection plus knowing which application and user is involved, intrusion prevention, and sometimes Transport Layer Security (TLS) inspection
Web application firewall (WAF)7Protects web applications from attacks such as SQL injection and cross-site scripting
Host-based firewallHostSoftware firewall on an individual server or laptop

The DMZ

Internet, external firewall, DMZ with public servers, internal firewall, internal network.

A screened subnet, or DMZ (demilitarised zone), puts public-facing servers in a separate network between an external and an internal firewall. If the web server is hacked, the attacker still faces a second firewall before reaching anything internal. It’s the most secure of the common designs. Putting a public web server on the internal network is wrong.

Older designs you may meet:

  • Screened host: a packet-filtering router allows traffic only to one hardened bastion host.
  • Dual-homed host: a host with two network cards and routing switched off, so all traffic must go through its proxy services.

Rule sets

A good rule base compared with common findings.
  • Default deny: anything not explicitly allowed is blocked.
  • Order matters: firewalls usually apply the first rule that matches.
  • Least privilege: specific sources, destinations and ports, not “any”.
  • Regular review to remove unused and too-broad rules, with business owners confirming each is still needed.
  • Change management for every rule change.
  • Logging of denied and important allowed traffic, sent to a security information and event management (SIEM) and reviewed. Logs nobody reads detect nothing.
  • Harden the firewall itself: patched, restricted admin access, MFA.

Example. A firewall review finds 1,800 rules. 400 haven’t matched any traffic in a year, and one allows any source to reach the database server on any port, added “temporarily” during a migration three years ago. The findings: no periodic rule review, and weak change control over rules.

What firewalls can’t do

The diagram shows four things a firewall can’t protect against. Insiders are already inside the network. Attacks can hide in allowed traffic, such as malware over HTTPS. Bypass routes, such as rogue Wi-Fi or unauthorised VPNs, go around it. And it can’t protect against its own misconfiguration.

Firewalls miss insiders, allowed traffic, bypass routes and misconfiguration.

Firewalls don’t protect against:

  • attacks that start inside the network
  • attacks carried in allowed traffic (such as malware over HTTPS, unless it’s inspected)
  • connections that bypass them (rogue wireless, personal hotspots, unauthorised VPNs)
  • their own misconfiguration

How the exam asks about it

If the question asks…The answer is usually…
Most secure traditional firewall typeApplication-level gateway (proxy)
Firewall type that tracks connectionsStateful inspection
Where to place a public web serverIn a DMZ (screened subnet)
Firewall protecting against SQL injectionWeb application firewall
Best practice for firewall rulesDefault deny; least privilege; periodic review
Limitation of firewallsDon’t stop insider attacks or threats in allowed traffic

In short

  • Packet-filtering firewalls check addresses, ports and protocols (layers 3-4); fast but can't see application content.
  • Stateful inspection firewalls track connections, allowing only responses to legitimate sessions.
  • Application-level gateways (proxies) inspect traffic at layer 7; most secure of the traditional types but slower.
  • Next-generation firewalls combine stateful filtering, application awareness, intrusion prevention and user identity.
  • A screened subnet (DMZ) between two firewalls is the most secure common architecture for internet-facing servers.
  • Rule sets should default-deny, be ordered correctly, be reviewed regularly, and changes should follow change management.
  • Firewalls don't stop attacks from inside, attacks in allowed traffic, or threats that bypass them (such as unmanaged connections).

Exam traps

  • A web application firewall protects web applications from attacks such as SQL injection; a network firewall doesn't inspect that deeply.
  • The most secure firewall type in the traditional list is the application-level gateway.
  • Placing a public web server on the internal network is wrong; it belongs in the DMZ.
  • Rules allowing 'any any' or unused rules left in place are common findings.
  • Firewall logs that aren't reviewed provide no detection.

Check yourself

  1. Where should a public web server be placed?

  2. Which traditional firewall type is MOST secure?

  3. Which firewall rule setting is a common finding?

Slides

Click the slide and use the arrow keys. F toggles full screen.

Turn your phone sideways for a bigger view. Tap any diagram to enlarge it.

CISA · Domain 5 · Network and platform security

Firewalls

The gatekeepers between networks: firewall types from simple packet filters to web application firewalls, the DMZ design, how rule sets go wrong, and what firewalls can't stop.

1 / 8

Turn your phone sideways or scroll to see all of it.