Certopolis

CompTIA Security+ (SY0-801)

Firewall types: packet filter, stateful, proxy and WAF explained

A packet filter allows or blocks traffic by address, protocol and port and keeps no record of connections. A stateful firewall also tracks each connection in a state table, and application firewalls and proxy gateways look inside the traffic at the application layer. A web application firewall sits in front of a web server to stop attacks on it.

The main types

A packet filter, also called a stateless inspection firewall, works at the network layer. It decides from the source and destination address, the protocol, the ports and the interface and direction. It cannot tell that several packets belong to the same session. A router with access control lists is the common example.

Stateful inspection adds a state table that records source and destination address, ports and connection state. Each new packet is checked against that table. A packet that claims to belong to an established connection is blocked if no such connection is listed.

An application firewall adds stateful protocol analysis, which some vendors call deep packet inspection. It can block an executable email attachment or the FTP put command. An application-proxy gateway goes further: it never lets the two hosts connect directly. It makes one connection to the client and a second to the real destination, hides internal addresses, and some can decrypt, inspect and re-encrypt TLS traffic.

Web-facing firewalls

A web application firewall (WAF) sits in front of a web server and detects attacks on HTTP aimed at that server. A secure web gateway (SWG) protects the other direction. NIST SP 800-215 calls it a web filter that protects outbound user traffic through HTTP or HTTPS inspection, so users who click a malicious link are protected. NIST says an SWG is not a replacement for a WAF.

Rules and deployment

Firewalls should block all inbound and outbound traffic that the policy does not expressly permit. NIST calls this deny by default and says it is more secure than allowing everything that is not explicitly forbidden.

High-availability (HA) firewalls are deployed in pairs at the same point in the network, with the same external and internal connections, so one can take over if the other fails or is taken offline for maintenance. That is redundancy, not diversity. NIST SP 800-53 control SC-29 says using diverse technologies reduces the chance that the means used to compromise one component will work against the others.

Where the exam catches people

  • Believing a packet filter can spot a forged reply packet: it keeps no state, so only a stateful firewall checks the packet against an established connection.
  • Believing a WAF filters employees' web browsing: a WAF protects a web server from inbound attacks; a secure web gateway filters users' outbound web traffic.
  • Believing an HA firewall pair stops one exploit beating both firewalls: the pair is two copies of the same product; only a different platform (diversity) does that.
  • Believing an allow-by-default rule base is acceptable if the deny list is long: NIST recommends deny by default, permitting only traffic the policy expressly allows.

Written from CompTIA's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company installs an appliance at headquarters that inspects employees' outbound browsing, including encrypted sessions, and blocks links to malicious websites before they reach laptops. Which of the following has the company installed?

    Right. In the game that’s Renown for your Security Architecture building.

    Not that one: A is right. In the game your Security Architecture building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Inspecting and filtering outbound browsing is its job.

    Written from nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-215.pdf

  2. A company installs a second firewall of the same model at the same point in its network, with identical external and internal connections, so either one can take over if the other goes offline. Which of the following is the company implementing?

    Right. In the game that’s Renown for your Security Architecture building.

    Not that one: C is right. In the game your Security Architecture building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    That is the arrangement the company built.

    Written from nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-41r1.pdf

  3. A company protects its internal network with an outer and an inner firewall, both running the same vendor's software. It wants an exploit that defeats the outer firewall to be less likely to defeat the inner one. Which of the following best achieves this?

    Right. In the game that’s Renown for your Security Architecture building.

    Not that one: D is right. In the game your Security Architecture building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Running the inner firewall on a different vendor's platform means an exploit for the outer firewall's software is unlikely to work on the inner one.

    Written from nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf